NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

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's gravatar image

abctester3984
6113
accept rate: 0%

converted 23 Aug '20, 09:11

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701


https://jsfiddle.net/fLgaksd7/ has latitude and longitude values switched.

permanent link

answered 23 Aug '20, 10:45

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

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 ♦

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×29

question asked: 23 Aug '20, 00:17

question was seen: 1,293 times

last updated: 24 Aug '20, 08:01

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum