mapbox / geojson.io

A quick, simple tool for creating, viewing, and sharing spatial data
http://geojson.io/
ISC License
1.92k stars 572 forks source link

Longitude value is out of the range #871

Open devBaqar opened 10 months ago

devBaqar commented 10 months ago

{ "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": {}, "geometry": { "coordinates": [ [ [ 126.91596844872151, -22.3046382567438 ], [ 126.91596844872151, -46.53652237354679 ], [ 187.70482077200649, -46.53652237354679 ], [ 187.70482077200649, -22.3046382567438 ], [ 126.91596844872151, -22.3046382567438 ] ] ], "type": "Polygon" } } ] }

Here longitude value is out of the box which is causin trouble loading this polygon on mobile..How to resolve this?

raviqqe commented 10 months ago

You have out-of-range longitudes (e.g. 187.70482077200649). So you need to normalized it. In the case of the example, you just do 187.7 - 360 = -172.3.

But I wonder whether we should do those normalization automatically if the GeoJSON spec allows that.