GeoJSON Coordinates?

2019-08-05 04:30发布

问题:

I have a GeoJSON file that I am trying to process in order to draw some features on top of google maps. The problem, however, is that the coordinates are not in the conventional latitude/longitude representation, but rather some large six/seven figure numbers. Example:

    {
      "type": "FeatureCollection",
      "features": [
        {
          "type": "Feature",
          "id": 0,
          "properties": {
            "OBJECTID": 1,
            "YR_BUILT": 1950.0
          },
          "geometry": {
            "type": "Polygon",
            "coordinates": [
              [
                [
                  772796.724674999713898,
                  2960766.746374994516373
                ],
                [
                  772770.131549999117851,
                  2960764.944537505507469
                ],
                [
                  772794.544237494468689,
                  2960796.93857
                ],
                [
                  772810.48285000026226,
                  2960784.77685
                ],
                [
                  772796.724674999713898,
                  2960766.746374994516373
                ]
              ]
            ]
          }
        },
      .....
    ]
}

I have been reading about the different coordinates systems, but being new to this I have not reached any where. Ideas?

回答1:

If your coordinate source is in the United States, most likely the coordinate system is some variation of State Plane or UTM. Otherwise, it's some other coordinate system that works best for the country of origin. There are literally thousands of coordinate systems, and it can be difficult to guess which you have based on just the coordinates.

You'll need to find out from the data provider what the coordinate system is, and then use an API in your programming language of choice to reproject the points. proj4 is a popular one, with bindings in many languages, and it has a port to Javascript called proj4js.