GeoJson features coordinates are in meters not in [lng, lat]. How to display in google map?

前端 未结 2 1218
谎友^
谎友^ 2021-01-03 04:21

Eg: [360590, 555610] - [lng, lat] in meters from google map api - GeoJson data

{
  \"type\": \"FeatureCollection\",
  \"features\": [
    {
      \"type\":         


        
相关标签:
2条回答
  • 2021-01-03 04:51

    Are you sure that these coordinates are in a meter?

    It may be EPSG: 27700 or EPSG:4326 so you can try with it.

    and you this link QGIS for convert coordinates and It might be useful for you.

    0 讨论(0)
  • 2021-01-03 05:13

    Mapbox has a Utility class that can perform the conversion of meters to latitude/longitude for you:

    public static Vector2d MetersToLatLon(Vector2d m)
    

    Converts Spherical Mercator EPSG:900913 in xy meters to WGS84 lat/lon.

    public static Vector2d LatLonToMeters(Vector2d v)
    

    Converts Vector2d struct, WGS84 lat/lon to Spherical Mercator EPSG:900913 xy meters.

    If you're looking to do the conversion yourself, then a simple approach is the following:

    • Assume the earth is a sphere with a circumference of 40,075km.
    • Length in meters of 1° of latitude is always 111.32km
    • Length in meters of 1° of longitude = 40,075 km * cos(latitude) / 360
    0 讨论(0)
提交回复
热议问题