GeoJSON Converter for CSV, KML and GPX
Pricing
$0.50 / 1,000 results
GeoJSON Converter for CSV, KML and GPX
Convert CSV lat/lon, KML and GPX to GeoJSON, or GeoJSON to CSV, with validation, bbox and centroids. Use when you need map data in another format or checked.
Pricing
$0.50 / 1,000 results
Rating
0.0
(0)
Developer
Plain Pipe
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
16 days ago
Last modified
Categories
Features
Share
Convert CSV lat/lon, KML and GPX to GeoJSON, or GeoJSON to CSV with centroids. Validates GeoJSON and returns bbox and feature counts.
Use this when: you have points or tracks as CSV, KML, GPX or GeoJSON and need them as valid GeoJSON or as a flat CSV with coordinates.
Why this one
- $0.50 per 1,000 results, one result per feature (or per file in file mode).
- Each row includes
validandissuesfrom a GeoJSON check, plusbbox, centroidlongitude/latitudeandgeometryType; file mode also saves the full .geojson and a centroid CSV. - Format is detected from the content; column names like lat/latitude/y are found automatically. No browser, no proxy, no external service.
- The prefilled example (3 cities) finishes in under 3 seconds in our test runs; 7 edge-case inputs are checked before each release.
What it does
Paste geo data, give links, or upload a file, and the Actor turns it into GeoJSON features. It reads CSV files with latitude and longitude columns (each row becomes a point), GeoJSON (FeatureCollection, a single Feature, a bare geometry, or a JSON array of features), KML placemarks, and GPX waypoints, routes and tracks. KML and GPX are read with the open-source @tmcw/togeojson and @xmldom/xmldom libraries; CSV is parsed with papaparse (comma, semicolon or tab, and decimal commas such as 48,1351). Bounding boxes and centroids are computed by the Actor itself.
GeoJSON input is also checked against the structure rules of RFC 7946: geometry types, positions that are [longitude, latitude] numbers inside the valid ranges, polygon rings that are closed and have at least four positions, and line strings with at least two positions. Problems are listed per feature, so you can find the broken record quickly.
Use cases
- Turn a spreadsheet of store or site locations (CSV with lat/lon) into GeoJSON for a web map.
- Convert a GPX track from a GPS device, or a KML file from a mapping tool, into GeoJSON.
- Flatten a GeoJSON file into a CSV with one line per feature, its centroid and its properties.
- Check a GeoJSON file before loading it into a database or map library, and find features with open rings or swapped coordinates.
- Get the overall bounding box and feature counts of a geo file to set a map's initial view.
How to use it
- Paste your data into Input text, add file links to Input URLs, or upload one file. The prefilled example is a small CSV with three cities and needs no network access.
- Choose the Output mode: One row per feature (longitude/latitude, bbox, validation and properties per feature; export as CSV for GeoJSON to CSV), or One row per file (counts, overall bbox and validation summary, with the full
.geojsonand a centroid CSV saved in the key-value store). - Optional: set the CSV latitude and longitude column names if they are not detected.
- Set Max results and run the Actor.
- Export the dataset as JSON, CSV or Excel, or read it through the Apify API.
Input
| Field | What it does | Default | Example |
|---|---|---|---|
inputText | Geo data pasted as text (CSV, GeoJSON, KML or GPX) | none | name,lat,lon + Paris,48.8566,2.3522 |
inputUrls | Direct links to CSV, GeoJSON, KML or GPX files; each link is converted separately | [] | ["https://example.com/places.geojson"] |
inputFile | One uploaded file, in addition to text and links | none | an uploaded track.gpx |
inputFormat | auto (detected from content), csv, geojson, kml or gpx | auto | csv |
outputMode | features (one row per feature) or file (one row per input, files in the key-value store) | features | file |
latColumn | CSV latitude column; empty detects lat, latitude or y | empty | Breite |
lonColumn | CSV longitude column; empty detects lon, lng, long, longitude or x | empty | Länge |
keepRowsWithoutCoordinates | Keep CSV rows without numeric coordinates as features with null geometry | false | true |
includeGeometry | Add the full geometry to each row in features mode | true | false |
coordinatePrecision | Decimal places for computed longitude, latitude and bbox (geometry kept as given) | 6 | 3 |
maxItems | Maximum results: features in features mode, files in file mode | 100 | 5000 |
Output
Features mode, one row per feature. Example from the prefilled CSV:
{"source": "inputText","inputFormat": "csv","featureIndex": 0,"featureId": null,"name": "Paris","geometryType": "Point","longitude": 2.3522,"latitude": 48.8566,"bbox": [2.3522, 48.8566, 2.3522, 48.8566],"positionCount": 1,"valid": true,"issues": [],"properties": { "name": "Paris", "country": "France" },"geometry": { "type": "Point", "coordinates": [2.3522, 48.8566] }}
| Field | Meaning |
|---|---|
longitude, latitude | The point, or the centroid of a line or polygon |
bbox | [minLon, minLat, maxLon, maxLat] of the feature |
valid, issues | GeoJSON validation result and the list of problems, e.g. ring is not closed |
properties | The feature's properties (CSV: every non-coordinate column) |
geometry | Full GeoJSON geometry (when includeGeometry is on) |
File mode, one row per input file:
{"source": "inputText","inputFormat": "kml","featureCount": 3,"geometryCounts": { "Polygon": 1, "LineString": 1, "Point": 1 },"bbox": [2, 48, 2.5, 48.85],"bboxCenter": [2.25, 48.425],"positionCount": 8,"valid": true,"invalidFeatureCount": 0,"issues": [],"notes": [],"geojsonKey": "1-inputText.geojson","geojsonUrl": "https://api.apify.com/v2/key-value-stores/<store id>/records/1-inputText.geojson","csvKey": "1-inputText.csv","csvUrl": "https://api.apify.com/v2/key-value-stores/<store id>/records/1-inputText.csv","sizeBytes": 422}
Centroids: polygons use the area-weighted centroid (holes are subtracted), lines use the length-weighted midpoint, multi-points use the mean position. For a mixed GeometryCollection the highest dimension wins. A polygon centroid can fall outside a strongly concave shape; it is not a "point on surface".
Pricing
Pay per result: $0.50 per 1,000 results ($0.0005 per result). One result is one feature row in features mode, or one file row in file mode. You only pay for results the Actor returns. Set a maximum total charge on the run to cap your spend.
Limits
- Files up to 50 MB each, UTF-8 text. Links must point straight at the file. Zipped KMZ files are not read; unzip them to KML first.
- Coordinates are treated as WGS84 longitude/latitude. Projected coordinate systems are not reprojected; their values are flagged as out of range.
- Validation covers structure and coordinate ranges. It does not check ring winding order, self-intersections or overlapping polygons.
- Only GeoJSON input is validated; KML and GPX are converted as the library reads them. KML styles, network links and ground overlays are not carried over.
- Bbox and centroid math is planar on longitude/latitude; it does not handle geometries that cross the 180th meridian.
- CSV input only produces points. The first line must be the header row.
- All features of a file are held in memory, so very large files need more run memory.
- Sources that cannot be read or parsed are skipped with a warning; if nothing is produced the run fails and nothing is charged.
FAQ
How much does a conversion cost?
In features mode you pay per feature: 2,000 features cost $1.00. In file mode you pay one result per input file, and the .geojson and CSV files in the key-value store are free.
Are invalid features charged or dropped?
Invalid GeoJSON features are still returned with valid: false and an issues list, so you can fix them; they count as results. Sources that cannot be read at all are skipped and not charged.
My CSV uses other column names. What do I do?
Set latColumn and lonColumn, for example Breite and Länge. If the columns are not found, the error lists the column names in the file.
Can I clean or merge the CSV before converting? Yes. Merge several location files and remove duplicates with the Plain Pipe Actor Merge CSV Files and Remove Duplicates, or convert an Excel sheet first with Excel XLSX to JSON and CSV Converter.
Can I run it on a schedule or from my own code? Yes. Use Apify Schedules to convert a file that is updated at the same link, or start runs through the Apify API, webhooks or integrations such as Make and Zapier.
Legal and data
This Actor processes only what you give it or public, non-personal technical data. It does not log in anywhere, does not collect personal data, and does not bypass paywalls, CAPTCHAs or access controls. You are responsible for having the right to process the inputs you provide.
Support
Open an issue on the Issues tab. Issues are answered within 14 days.
Built and maintained by Plain Pipe.