I was trying to draw a polygon on Google maps from the lat and long I received from OSM. It draws somewhere else in google maps. Geojson for Lonnig = https://nominatim.openstreetmap.org/search?q=Lonnig&polygon_geojson=1&format=json&limit=1 ploygon drawn on Google maps from the geojson coordinates = https://jsfiddle.net/fLgaksd7/ lonnig is in germany - https://www.google.com/maps/place/Lonnig,+Germany/@50.3123136,7.3844964,14z/data=!3m1!4b1!4m5!3m4!1s0x47be67ad07c4b15f:0xffae687465c8779!8m2!3d50.3104922!4d7.4063611 asked 23 Aug '20, 00:17 abctester3984 SimonPoole ♦ |
https://jsfiddle.net/fLgaksd7/ has latitude and longitude values switched. answered 23 Aug '20, 10:45 SimonPoole ♦ Thank you so much I feel terrible :( But i am going to keep this question so that any other person coming across similar situation wont have to spend two days over this OSM geojson data is in the format of longitude , latitude
(24 Aug '20, 02:18)
abctester3984
1
Errors due to lon - lat being switched is easily the most common geo-programming error (and it goes both ways as there is no agreement on the "correct" order), and has happened essentially to everybody.
(24 Aug '20, 08:01)
SimonPoole ♦
|