2

I want to draw a polygon from the below JSON data from a GeoJSON file. However I am confused about the coordinates array since I believed they corresponded to a latitude and a longitude. But clearly from the below example they are not valid longitude and latitudes.

{
"type": "Feature",
"geometry": {
    "type": "Polygon",
    "coordinates": [
        [
            [7634622.475699998, 1247905.0877999999],
            [7634603.934699997, 1247985.6240000017],
            [7634671.5713, 1248001.2551000006],
            [7634660.179200001, 1247921.3847999983],
            [7634622.475699998, 1247905.0877999999]
        ]
    ]
},
"properties": {
    "OBJECTID": 1,
    "Longitude": -73.520563459,
    "Latitude": 45.522783335,
    "CSDUID": "2458227",
    "CSDNAME": "Longueuil",
    "Data_prov": "Longueuil",
    "Build_ID": "24582270000001",
    "Shape_Leng": 301.838065514,
    "Shape_Area": 4277.81119671
}

}

The below JSON from GeoJSON renders as a polygon since the coordinates point to a longitude and latitude. Do I need to parse the above JSON differently?

{
"type": "FeatureCollection",
"features": [{
    "type": "Feature",
    "id": "osm-r554096",
    "properties": {},
    "geometry": {
        "type": "Polygon",
        "coordinates": [
            [
                [2.359211, 48.850304],
                [2.359124, 48.850431],
                [2.359173, 48.850497],
                [2.359228, 48.850565],
                [2.359262, 48.850612],
                [2.359184, 48.850637],
                [2.359174, 48.850628],
                [2.359107, 48.85065],
                [2.359087, 48.850657],
                [2.35893, 48.85071],
                [2.358843, 48.850597],
                [2.358682, 48.850385],
                [2.358608, 48.850288],
                [2.358733, 48.850247],
                [2.358837, 48.850213],
                [2.358871, 48.850213],
                [2.35891, 48.850213],
                [2.359022, 48.850247],
                [2.359211, 48.850304]
            ]
        ]
    }
}]

}

1
  • 1
    The first geometry is a polygon but in some other coordinate reference system than WGS84 longitude-latitude. Ask the data provider what is the CRS that they use.
    – user30184
    Jan 7 '20 at 19:30
2

You can find an unknown projection using projfinder.com if you have a coordinate in lat-long and a nearby coordinate in the other system.

From your data, I took one of the points in the geoJSON:

 7634671.5713, 1248001.2551000006

and zoomed into this coordinate from the geoJSON attribute data:

"Longitude": -73.520563459,
"Latitude": 45.522783335,

projfinder tells me that either of these two coordinate systems:

0   EPSG:3347 Name:NAD83 / Statistics Canada Lambert    Distance:254.143075
1   EPSG:3348 Name:NAD83(CSRS) / Statistics Canada Lambert  Distance:254.143075

maps to lat-long:

 -73.519263 , 45.525259

which is pretty close. I guess your points are in EPSG:3347 coordinates. How you convert them to lat-long is dependent on the software you are using.

5
  • Thanks for your reply. In case I need to change my CRS then do you know which one can match the one which has Latitude and Longitude? Jan 7 '20 at 19:54
  • As I said (sorry if I wasn't clear) but I used projfinder.com - put an X-Y projected coordinate in the boxes, zoom to the lat-long where you think it is, and it finds the nearest projections. If there's a point not too far, then that's probably it.
    – Spacedman
    Jan 7 '20 at 20:50
  • By definition, GeoJSON is SRID 4326 (GCS WGS84).
    – Vince
    Jan 7 '20 at 20:54
  • 1
    @Vince RFC 7946 says "However, where all involved parties have a prior arrangement, alternative coordinate reference systems can be used without risk of data being misinterpreted.". I suspect such prior arrangement has not been made here...
    – Spacedman
    Jan 7 '20 at 21:18
  • Thanks guys this worked. Jan 8 '20 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.