My geolocation in OpenLayers is incorrect by more than 5000 meters. I want to correct this issue, how can I programatically move my geolocation to the most accurate location? Or is it even possible?

  • Which coordinate system do you use? Are your raw coordinates exact, so is only the visualization in OpenLayers wrong? – Mesa Aug 23 '18 at 19:08
  • @Mesa Projected coordinate system (in meters), but i'm not sure which, I am located in Addis Ababa, Ethiopia. My location wrongly shows about 5000 meters to North when zooming. This seems to be an accuracy issue with OpenLayers 5 itself, but how can i correct it? – Kaleab Aug 23 '18 at 19:46
  • OL geolocation exmple page shows correct location with my device. try the example with your device. OL's geolocation just use browser's geolocation. so the location should be up to your device. – Chase Choi Aug 24 '18 at 1:24
  • @Kaleab Knowing the SRID/EPSG code of the used coordinate system is essential for working with spatial data. – Mesa Aug 24 '18 at 7:20
  • @Mesa the srid=20137 (UTM 37 Adindan). Even in the example given, accuracy is 6000meters. – Kaleab Aug 24 '18 at 16:50

Is openlayers rendering the coordinates wrong?

If you are certain about the coordinates being accurate, i would check projections in Openlayers, making both your map and your coordinates are EPSC:4326 for example...

  • Let me describe it. I know where i am on the map, but the geolocation's accuracy is 5000 meters to the North. It means the coodinates are wrong? I tried a different projection , UTM 37 EPSG: 20137, but still incorrect geolocation. I am assuming an accuracy issue with html5? – Kaleab Aug 29 '18 at 16:02
  • i would try to get the coordinates from google maps from where you are (or where your coordinates should be), and load that same coordinates (the one obtained from google maps) in Openlayers to check if the issue is about representing the coordinates or the coordinates itself... – Hellcracker Aug 30 '18 at 17:10
  • I use openlayers everyday for cadastral purpose with about 5cm/px accuracy, using Openlayers 5. so i lean over an obtaining problem. is it a gps or what kind of device?... i'm near the ecuator, take in consideration that UTM loses presition as it comes near the poles. – Hellcracker Aug 30 '18 at 17:12
  • I'm at ( real position) LAT: 8°59'20.651"N LON: 38°45'55.614"E Google maps: maps.google.com/maps?q=8.9890698,38.7654484 – Kaleab Sep 1 '18 at 11:04
  • that would be 8.989079, 38.765434 EPSG:4326 OR 4315349.97, 1004789.16 EPSG:3857. try with those values (depending on which version [lat,long] can be [long,lat] ). Coordinate converter: epsg.io/… – Hellcracker Sep 4 '18 at 17:23

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.