merlos / iOS-Open-GPX-Tracker

GPS Tracker app for iOS + WatchOS. Log your tracks without limits and share them; Open source GPX tracker app written in Swift
http://www.merlos.org/iOS-Open-GPX-Tracker/
GNU General Public License v3.0
605 stars 149 forks source link

Correct offsets over China #192

Open xyb opened 4 years ago

xyb commented 4 years ago

Due to national law, most online maps are intentionally distorted over China and will not match satellite images or GPS location. It would be nice if Open GPX Tracker supports “Correct offsets over China” to display the correct routes on the map.

See also:

vincentneo commented 4 years ago

firstly I need to know more about this:

is it to convert WGS-84 to GCJ-02/Baidu, maybe with something like this (https://github.com/TinyQ/TQLocationConverter)? Also, is GCJ-02 or Baidu more preferred? Only the coordinates logged must be corrected right?

Vincent

xyb commented 4 years ago

is GCJ-02 or Baidu more preferred?

Only Baidu Maps is using bd-09 and I don't think Open GPX Tracker needs to support it.

Only the coordinates logged must be corrected right?

I think it would be best to save the coordinates as WGS-84, but offset them when displayed on a map within China, except for Apple Maps, which has already done that.

maybe with something like this (https://github.com/TinyQ/TQLocationConverter)?

Maybe. I'm not sure about the code for this repository, it seems to work.

merlos commented 4 years ago

@xyb Thanks for pointing it out.

Would it be legal?

xyb commented 4 years ago

Would it be legal?

It's hard to say legal or not. Haven't heard of any prosecutions for translating GPS addresses, and there is a lot of discussion in the Chinese tech community about converting GPS addresses that are not banned.

vincentneo commented 4 years ago

I personally think that implementing this would be playing with fire, and would personally not be willing to take part in the implementation, considering legal ambiguity. Unsure if @merlos would share the same thoughts.

Though @xyb thanks for sharing about this offset thing in China.

frostblazergit commented 4 years ago

@vincentneo @xyb

From https://wiki.openstreetmap.org/wiki/Converting_to_WGS84

OpenStreetMap uses the WGS-84 coordinate system, as do most GPS units.

When recording in real time, there is no offset using the Apple Mapkit inside the settings, and there is an offset when Open Street Map is selected.

When viewing recorded GPX files, there is an offset when Apple Mapkit is selected, but there is no offset when Open Street Map is selected.

The GPS data is WGS-84, and Open Street Map is also WGS-84, so there is no offset when viewing the recorded GPX file.

When you select Apple Mapkit as the map of GPX file, the GPS (WGS-84) coordinates are passed in. iOS Chinese users use the local map service provider "AutoNavi Maps", so the WGS-84 coordinates are not consistent with the coordinates of "AutoNavi Maps", which causes the offset.

In the real-time logging, select Open Street Map, but the logo of "AutoNavi Maps" appears in the bottom right corner, it should be a configuration problem or an API problem in iOS system, so the offset appears.

But it's not a big deal. I can open the GPX file with GPXSee (https://github.com/tumic0/GPXSee) on my computer to check the speed and path, and it's perfect!

papadave66 commented 3 years ago

I use this app to record trackers, and upload it to Openstreet Map. It works well.The coordinate match exactly same. This shift problem just cause display stuff. The apple map doesn't have this shift display problem. It happens in other maps. Like Openstreet Map