H.Frankstone
H.Frankstone

Reputation: 11

GeoJson data rendering off the map

I am trying to use geojson data to place points on a map. When I run my geojson data through a validator, the points appear on the edge of the map above the arctic circle and I'm not sure why. I plan on using this data with a leaflet map and a project built with angularjs. If anyone can add insight about any problems in my geojson code below, or things to look out for while using leaflet and angular, I would appreciate it! Thanks! Here is my geojson code

{"type":"FeatureCollection",
"features":[
{"type":"Feature",
    "geometry":{
        "type":"Point",
        "coordinates":[36.1199, -86.7775]
    },
    "properties":{
        "name":"Kroger"
    }
},
{"type":"Feature",
    "geometry":{
        "type":"Point",
        "coordinates":[36.0903, -86.7323]
    },
    "properties":{
        "name":"ALDI"
    }
},
{"type":"Feature",
    "geometry":{
        "type":"Point",
        "coordinates":[36.1266, -86.8474]
    },
    "properties":{
        "name":"Publix"
    }
}
]
}

Upvotes: 1

Views: 319

Answers (1)

IvanSanchez
IvanSanchez

Reputation: 19059

GeoJSON uses a longitude-latitude (or easting-northing) format for the coordinates (read the relevant bit of the GeoJSON specification), but your points seem to be in latitude-longitude.

I know this is confusing, since Leaflet uses lat-lng instead of lng-lat. Confusion abounds.

Make sure to use longitude-latitude for the coordinates of your GeoJSON and you'll be fine.

Upvotes: 3

Related Questions