From ec402eeeb672d17493f294319556bef0cc7d7966 Mon Sep 17 00:00:00 2001 From: Thomas Morrell Date: Mon, 19 Dec 2022 09:42:01 -0800 Subject: [PATCH] Fix geojson coordinate order --- caltechdata_api/customize_schema.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/caltechdata_api/customize_schema.py b/caltechdata_api/customize_schema.py index 3d7cff8..a769167 100644 --- a/caltechdata_api/customize_schema.py +++ b/caltechdata_api/customize_schema.py @@ -290,7 +290,7 @@ def customize_schema_rdm(json_record): if "geoLocationPoint" in location: lat = location["geoLocationPoint"]["pointLatitude"] lon = location["geoLocationPoint"]["pointLongitude"] - new["geometry"] = {"type": "Point", "coordinates": [lat, lon]} + new["geometry"] = {"type": "Point", "coordinates": [lon, lat]} if "geoLocationBox" in location: south = float(location["geoLocationBox"]["southBoundLatitude"]) north = float(location["geoLocationBox"]["northBoundLatitude"]) @@ -300,11 +300,11 @@ def customize_schema_rdm(json_record): "type": "Polygon", "coordinates": [ [ - [north, east], - [north, west], - [south, west], - [south, east], - [north, east], + [east, north], + [west, north], + [west, south], + [east, south], + [east, north], ] ], }