nutonomy / nuscenes-devkit

The devkit of the nuScenes dataset.
https://www.nuScenes.org
Other
2.2k stars 617 forks source link

About the EPSG projection information #966

Closed basbaba closed 8 months ago

basbaba commented 11 months ago

In nuscenes-devkit/python-sdk/nuscenes/map_expansion/map_api.py I see: "We use the same WGS 84 Web Mercator (EPSG:3857) projection as Google Maps/Earth."

So I converted the 4 maps(1 in Boston and 3 in Singapore) from EPSG:3857 to EPSG:4326, and export them to the GeoServer(A GIS system), the result is: the Singapore's nuScenes maps are matched with OpenStreetMap(OSM) perfectly, but the Boston is not.

In the SDK, there are 4 cities reference coordination: "boston-seaport": [42.336849169438615, -71.05785369873047], "singapore-onenorth": [1.2882100868743724, 103.78475189208984], "singapore-hollandvillage": [1.2993652317780957, 103.78217697143555], "singapore-queenstown": [1.2782562240223188, 103.76741409301758], First, I think maybe it's a problem of boston-seaport's reference coordination, so I tried to give it an offset, but the result is still unmatched with OSM. At last I found Boston nuScenes map is not only having Offset problem but also Scaled problem. So I'm in doubt: the Boston nuScenes map is projected under EPSG:3857. If it's not, what EPSG is with Boston nuScenes map?

The fist picture is composed of nuScenes Boston map and OSM and Overture map: boston_nuscenes_osm

Red lines are roads from OSM, Grey blocks are buildings from Overture, Green polygons are from nuScenes, they both are projected into EPSG:4326, you can find out Green polygons are unmatched with Red lines. As a reference, this is the same area from google map: boston_google

Let me set several reference points on the first image to show where nuScenes Boston Green polygons should be at in correct position: boston_nuscenes_osm_correct

For a temporary solution, I did the following:

  1. scale the nuScenes Boston map polygons' coordinates with factor=1.35 as scaled_polygon
  2. convert "boston-seaport": [42.336849169438615, -71.05785369873047] to EPSG:3857 as ref_coords_3857
  3. scaled_polygon_on_map = scaled_polygon + ref_coords_3857
  4. converted scaled_polygon_on_map from EPSG:3857 to EPSG:4326
  5. import the results into GeoServer and get this result: boston_nuscenes_osm_scaled It looks better but not a thorough solution. I need to know: is nuScenes Boston map is under EPSG:3857 or something else or I did some mistakes? The last image is nuScenes Singapore map without polygon coordinates scaled(Only converted from EPSG:3857 to EPSG:4326): singapore_nuscenes_osm

Thanks!

basbaba commented 11 months ago

I did another test:

  1. keep nuScenes Boston map unmodified
  2. transform Overture buildings from EPSG:4326 to EPSG:3857 as building_3857
  3. scale down building_3857 with factor=1./1.35
  4. overlay the scaled building_3857 on nuScenes Boston map I got a right map(Red is nuScenes map, Blue is Overture map): boston_nuscenes_osm_3857_scaled

So are you sure the Boston map is projected under EPSG:3857?

Best Regards!

whyekit-motional commented 11 months ago

@basbaba EPSG:4326 is likely the correct projection to use

Thanks for investigating! We will open a PR to fix the docstring for the Boston map

basbaba commented 11 months ago

Hi whyekit, Thanx a lot!

Best Regards!