# Bulk GPS Coordinate Format Converter (`automation-lab/bulk-gps-coordinate-format-converter`) Actor

Convert mixed GPS coordinate strings to decimal degrees, DMS, and DDM with validation, precision, and per-row errors for GIS data cleanup.

- **URL**: https://apify.com/automation-lab/bulk-gps-coordinate-format-converter.md
- **Developed by:** [Stas Persiianenko](https://apify.com/automation-lab) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.44 / 1,000 coordinate row processeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Bulk GPS Coordinate Format Converter

Normalize mixed coordinate lists without sending location data to an external geocoding service.

This **GPS coordinate format converter** accepts batches of latitude/longitude strings in decimal degrees (DD), degrees-minutes-seconds (DMS), and degrees-decimal-minutes (DDM). It detects the source notation, validates ranges, and returns every valid point in all three formats.

Invalid rows can remain in the output with stable error codes, making the Actor useful in GIS imports, logistics files, field-survey cleanup, and recurring ETL validation.

### What this Actor does

For each supplied coordinate string, the Actor:

1. separates the two coordinate components;
2. detects DD, DMS, or DDM;
3. resolves latitude/longitude order;
4. applies N, S, E, and W hemisphere signs;
5. validates latitude from -90 to 90;
6. validates longitude from -180 to 180;
7. converts the point to normalized DD;
8. converts the point to normalized DMS;
9. converts the point to normalized DDM;
10. emits a typed validation result.

Processing is deterministic and offline. The Actor does not call a maps API, geocoder, website, proxy, or browser.

### Who is it for?

- **GIS analysts** cleaning mixed coordinate columns before an import.
- **Survey teams** standardizing DMS observations from field notes.
- **Logistics teams** validating depot or delivery coordinates.
- **Data engineers** enforcing one coordinate format in an ETL pipeline.
- **Researchers** normalizing points collected from multiple instruments.
- **No-code users** converting a pasted list into an exportable Apify dataset.

### Supported GPS coordinate formats

| Input notation | Example | Detected value |
| --- | --- | --- |
| Decimal degrees (DD) | `40.7128, -74.0060` | `decimal-degrees` |
| Degrees-minutes-seconds (DMS) | `51° 30′ 26.64″ N, 0° 7′ 39.12″ W` | `degrees-minutes-seconds` |
| Degrees-decimal-minutes (DDM) | `33° 51.528′ S, 151° 12.558′ E` | `degrees-decimal-minutes` |
| Longitude-first decimal | `-74.0060, 40.7128` | DD with `coordinateOrder: lon-lat` |

Comma, semicolon, slash, and pipe separators are accepted. A simple unsigned decimal pair may also use whitespace.

The Actor converts notation on WGS84-style latitude/longitude values. It does not reproject coordinates between datums or EPSG coordinate reference systems.

### Input parameters

| Field | Type | Default | Description |
| --- | --- | --- | --- |
| `coordinates` | string array | required | One coordinate pair per item; 1 to 10,000 items. |
| `coordinateOrder` | string | `auto` | `auto`, `lat-lon`, or `lon-lat`. |
| `outputPrecision` | integer | `6` | Decimal places for formatted DD, DMS seconds, and DDM minutes; 0 to 10. |
| `includeInvalid` | boolean | `true` | Keep rejected rows with error details. |
| `maxItems` | integer | `20` | Maximum supplied rows processed in one run; increase up to 10,000 when needed. |

`auto` uses hemisphere letters first. For unsigned values, a first component outside latitude range implies longitude-first; otherwise the Actor assumes latitude-first. Set an explicit order when your source stores longitude first.

### Get started

1. Open the Actor in Apify Console.
2. Paste one or more strings into **GPS coordinate strings**.
3. Leave **Coordinate order** on auto unless your unsigned source is longitude-first.
4. Choose the desired output precision.
5. Keep invalid rows enabled for data-quality audits.
6. Click **Start**.
7. Open the dataset and export JSON, CSV, Excel, XML, or another supported format.

Example input:

```json
{
  "coordinates": [
    "40.7128, -74.0060",
    "51° 30′ 26.64″ N, 0° 7′ 39.12″ W",
    "33° 51.528′ S, 151° 12.558′ E"
  ],
  "coordinateOrder": "auto",
  "outputPrecision": 6,
  "includeInvalid": true
}
```

### Output fields

| Field | Meaning |
| --- | --- |
| `row` | One-based source position. |
| `input` | Original supplied text. |
| `valid` | Whether parsing and range checks passed. |
| `detectedFormat` | DD, DMS, or DDM source notation. |
| `detectedOrder` | Resolved `lat-lon` or `lon-lat` order. |
| `latitude` | Numeric normalized latitude. |
| `longitude` | Numeric normalized longitude. |
| `decimalDegrees` | Formatted normalized DD pair. |
| `dms` | Formatted normalized DMS pair. |
| `ddm` | Formatted normalized DDM pair. |
| `latitudeDms` / `longitudeDms` | Individual DMS components. |
| `latitudeDdm` / `longitudeDdm` | Individual DDM components. |
| `inputPrecision` | Decimal places in the most precise source component. |
| `outputPrecision` | Requested formatting precision. |
| `errorCode` | Stable rejection code for invalid rows. |
| `error` | Human-readable rejection reason. |

Example valid result:

```json
{
  "row": 1,
  "input": "40.7128, -74.0060",
  "valid": true,
  "detectedFormat": "decimal-degrees",
  "detectedOrder": "lat-lon",
  "latitude": 40.7128,
  "longitude": -74.006,
  "decimalDegrees": "40.7128, -74.006",
  "dms": "40° 42′ 46.080000″ N, 74° 0′ 21.600000″ W",
  "ddm": "40° 42.768000′ N, 74° 0.360000′ W",
  "inputPrecision": 4,
  "outputPrecision": 6,
  "errorCode": null,
  "error": null
}
```

### Validation and per-row errors

When `includeInvalid` is true, bad rows do not hide inside logs. They appear in the same dataset with `valid: false` and one of these codes:

- `EMPTY_COORDINATE` — the input is blank;
- `UNRECOGNIZED_FORMAT` — the pair cannot be parsed as DD, DMS, or DDM;
- `AMBIGUOUS_ORDER` — hemisphere labels do not identify one latitude and one longitude;
- `LATITUDE_OUT_OF_RANGE` — normalized latitude exceeds ±90;
- `LONGITUDE_OUT_OF_RANGE` — normalized longitude exceeds ±180.

Turn `includeInvalid` off when downstream consumers should receive valid rows only. Filtered invalid rows are not emitted and do not incur an item event.

### How much does it cost to convert GPS coordinates?

The Actor uses pay-per-event pricing:

- **$0.001 per run start**;
- **$0.002404 per emitted coordinate row on the BRONZE tier**;
- subscription tiers apply progressively lower per-row prices.

Typical BRONZE examples:

| Emitted rows | Estimated total |
| ---: | ---: |
| 1 | $0.003404 |
| 10 | $0.025040 |
| 100 | $0.241400 |
| 1,000 | $2.405000 |

The item charge covers both valid conversion rows and typed invalid-row results because each is usable data-quality output. Your active Apify plan determines the exact tier price shown before a run.

### Accuracy and precision

The converter uses standard arithmetic:

`decimal degrees = degrees + minutes / 60 + seconds / 3600`

S and W produce negative values. Numeric `latitude` and `longitude` retain JavaScript number precision. `outputPrecision` controls only the formatted strings.

`inputPrecision` reports textual decimal places; it is not a promise of GPS measurement accuracy. A coordinate with many digits can still come from an inaccurate sensor.

### Automation and integration ideas

- Run after CSV ingestion to validate a coordinate column.
- Schedule recurring cleanup of field-observation batches.
- Send valid rows to a mapping or routing workflow.
- Route invalid rows to a review queue using `errorCode`.
- Compare normalized points across periodic dataset snapshots.
- Export DDM strings for devices that require degrees and decimal minutes.

Apify integrations can send datasets to Google Sheets, Zapier, Make, webhooks, cloud storage, or your own API.

### Run with the Apify API

Replace `YOUR_TOKEN` with an Apify API token.

#### cURL

```bash
curl -X POST \
  "https://api.apify.com/v2/acts/automation-lab~bulk-gps-coordinate-format-converter/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"coordinates":["40.7128, -74.0060"],"coordinateOrder":"auto"}'
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('automation-lab/bulk-gps-coordinate-format-converter').call({
  coordinates: ['40.7128, -74.0060', '51° 30′ 26.64″ N, 0° 7′ 39.12″ W'],
  includeInvalid: true,
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient('YOUR_TOKEN')
run = client.actor('automation-lab/bulk-gps-coordinate-format-converter').call(run_input={
    'coordinates': ['-74.0060, 40.7128'],
    'coordinateOrder': 'lon-lat',
    'outputPrecision': 5,
})
items = client.dataset(run['defaultDatasetId']).list_items().items
print(items)
```

### Use through MCP

#### Claude Code

```bash
claude mcp add --transport http apify \
  "https://mcp.apify.com?tools=automation-lab/bulk-gps-coordinate-format-converter"
```

Use this equivalent MCP server configuration in the supported desktop and editor clients:

#### Claude Desktop

```json
{
  "mcpServers": {
    "apify": {
      "url": "https://mcp.apify.com?tools=automation-lab/bulk-gps-coordinate-format-converter"
    }
  }
}
```

#### Cursor

Add the same `apify` server object to Cursor's MCP settings.

#### VS Code

Add the same `apify` server URL through the VS Code MCP server configuration.

Example prompts:

- “Convert these GPS points to decimal degrees and DMS, and keep invalid rows.”
- “Treat this list as longitude-first and return five decimal places.”
- “Normalize this mixed field survey batch and summarize the error codes.”

### Limits and failure behavior

- One run processes at most 10,000 supplied strings.
- Both components in one row must use the same notation.
- The Actor supports DD, DMS, and DDM only.
- It does not support UTM, MGRS, geohash, Plus Codes, Maidenhead, or datum reprojection.
- It does not geocode addresses or reverse-geocode points.
- It does not calculate distance, bearing, midpoint, or bounding boxes.
- Decimal commas inside a component are not supported because commas separate coordinate components.
- Fatal top-level input errors fail the run with a non-zero status.
- Row-level parse and range errors remain typed dataset records by default.

### Legality, responsible use, and privacy

Coordinate conversion is generally a neutral data-processing activity. You are responsible for having permission to process and store the supplied location data.

Avoid uploading precise locations tied to private individuals unless you have a lawful purpose and appropriate safeguards. Review retention, access, and export settings for sensitive field, health, home, or infrastructure coordinates.

Because conversion is offline, coordinate strings are not shared with an external map or geocoding provider by this Actor. Standard Apify platform storage and account controls still apply.

### Troubleshooting

**Why was an unsigned pair interpreted as latitude first?**

Auto mode assumes latitude-first when both numbers fit latitude range. Set `coordinateOrder` to `lon-lat` for GeoJSON-style or database longitude-first rows.

**Why is my UTM or MGRS value rejected?**

Those coordinate systems are outside this Actor's DD/DMS/DDM contract. Convert them to WGS84 latitude/longitude before running this Actor.

**Why did fewer rows appear than I supplied?**

Check `maxItems`. Also check whether `includeInvalid` is false, which omits rejected rows.

**Does output precision improve location accuracy?**

No. It changes formatting only and cannot add measurement accuracy to the source.

### FAQ

**Can I mix DD, DMS, and DDM in one run?**

Yes. Detection happens independently for every row.

**Can latitude and longitude use different formats in the same row?**

No. Mixed-component notation is rejected to prevent silent guesses.

**Can I export to CSV or Excel?**

Yes. Use the dataset export controls or dataset API after the run.

**Are invalid rows charged?**

Only if they are emitted as typed results. Set `includeInvalid` to false to omit them.

**Does the Actor need a proxy or API key?**

No. It performs the conversion locally inside the Actor run.

### Related automation-lab Actors

- [CSV Diff Tool](https://apify.com/automation-lab/csv-diff-tool) — compare normalized dataset snapshots.
- [Dataset Dedup](https://apify.com/automation-lab/dataset-dedup) — remove duplicate rows after conversion.
- [Bulk DNS AAAA Record Checker](https://apify.com/automation-lab/bulk-dns-aaaa-record-checker) — another typed bulk validation utility for infrastructure datasets.

Use this Actor for coordinate notation cleanup; use the related tools only when those separate workflow steps are needed.

# Actor input Schema

## `coordinates` (type: `array`):

One latitude/longitude pair per item. Supported examples: 40.7128, -74.0060; 40° 42′ 46.08″ N, 74° 0′ 21.6″ W; 40° 42.768′ N, 74° 0.360′ W.

## `coordinateOrder` (type: `string`):

Auto uses hemisphere letters and range clues, otherwise assumes latitude then longitude. Choose an explicit order for ambiguous unsigned decimal pairs.

## `outputPrecision` (type: `integer`):

Decimal places used for converted decimal degrees, seconds, and decimal minutes. Numeric latitude and longitude remain full-precision numbers.

## `includeInvalid` (type: `boolean`):

Keep rejected inputs in the dataset with errorCode and error fields. Disable to emit only valid conversions.

## `maxItems` (type: `integer`):

Maximum number of supplied coordinate strings to process in this run.

## Actor input object example

```json
{
  "coordinates": [
    "40.7128, -74.0060",
    "51° 30′ 26.64″ N, 0° 7′ 39.12″ W",
    "33° 51.528′ S, 151° 12.558′ E"
  ],
  "coordinateOrder": "auto",
  "outputPrecision": 6,
  "includeInvalid": true,
  "maxItems": 20
}
```

# Actor output Schema

## `overview` (type: `string`):

Open the default dataset overview containing normalized coordinates, detected formats, precision, validation status, and per-row errors.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "coordinates": [
        "40.7128, -74.0060",
        "51° 30′ 26.64″ N, 0° 7′ 39.12″ W",
        "33° 51.528′ S, 151° 12.558′ E"
    ],
    "coordinateOrder": "auto",
    "outputPrecision": 6,
    "includeInvalid": true,
    "maxItems": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("automation-lab/bulk-gps-coordinate-format-converter").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "coordinates": [
        "40.7128, -74.0060",
        "51° 30′ 26.64″ N, 0° 7′ 39.12″ W",
        "33° 51.528′ S, 151° 12.558′ E",
    ],
    "coordinateOrder": "auto",
    "outputPrecision": 6,
    "includeInvalid": True,
    "maxItems": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("automation-lab/bulk-gps-coordinate-format-converter").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "coordinates": [
    "40.7128, -74.0060",
    "51° 30′ 26.64″ N, 0° 7′ 39.12″ W",
    "33° 51.528′ S, 151° 12.558′ E"
  ],
  "coordinateOrder": "auto",
  "outputPrecision": 6,
  "includeInvalid": true,
  "maxItems": 20
}' |
apify call automation-lab/bulk-gps-coordinate-format-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automation-lab/bulk-gps-coordinate-format-converter"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/44DzRbkX54iZskXFl/builds/CET4JznGZmb3Rwisb/openapi.json
