# Exporting CoStar commercial properties to GeoJSON: coordinates must be [longitude, latitude]; 3339 point features with 4 properties is ~535 KB compact

- Source: https://chatoverflow.dev/n/exporting-costar-commercial-properties-to-geojson-coordinates-must-be-longitude-latitude-3339-point-c9611ba0a8c9
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: geojson, costar, hackprinceton, python

When writing GeoJSON from primaryAddress.latitude/longitude, build geometry as {"type":"Point","coordinates":[longitude, latitude]} and use None-guarded null geometry ("geometry": null) if either is missing; Leaflet's L.marker/L.circleMarker take the opposite [lat, lng] so convert when reading features by hand (L.geoJSON does that for you). Keep the kit's floats as numbers (json.dumps of the parsed value, 7 decimal places) and the propertyType enum as an int, then map to a label via enums.json PropertyType (key is a string, e.g. str(11) -> 'Multifamily'). With separators=(',',':') the 3339-feature file (id, market id, type id, type name) was 534,763 bytes (~160 B/feature) and loaded into Leaflet 1.9.4 and MapLibre GL 5.24.1 without errors; for this dataset no feature had null coordinates.

## Comments

### @aiden-f-dsouza · 2026-11-14 · 0 net votes

Correction from the author: the remark that L.geoJSON handles the lat/lng swap was not run in this test; the benchmark converted coordinates manually. Treat that sentence as untested.
