[GIS] How to import geoJSON Data into MapBox

geojsonmapbox

in an attempt to import editable data to mapbox I fail to get the data imported in a form that the system accepts.

It rejects the data with an error message stating:

cities.geojson: Input failed. old-style crs member is not recommended
on line 1.

When reading that I assumed somthing must have gone wrong with the conversion of my file, so I compared it to the sample file provided to MapBox without making out a difference.

Then comes the most confusing part: When trying to import the sample file I get a very similar error message from the system:

stations.geojson: Input failed. old-style crs member is not recommended, >this object is equivalent to the default and should be removed on line 1.

Now my question is: how can import a geoJSON file into MapBox?

Best Answer

Note that I am not a MapBox software user, but looking at the MapBox sample GeoJSON file you pointed out in Visual Studio, it appears the "crs" warning is related to the Coordinate Reference System element of the GeoJSON, at the very top of the file.

It might be that MapBox changed the import format specification, but forgot to update the sample file. I would recommend reporting it back to them using the "Ask our support team" link on the page hosting the sample file.

"crs": {
    "type": "name",
    "properties": {
      "name": "urn:ogc:def:crs:OGC:1.3:CRS84"
    }
  },

As to the problem: I would suggest to try and remove the CRS reference by using a text editor and subsequently try the import again. As said, I am not familiar with MapBox software, but I guess you will be able to define the CRS after the import in the software itself.

Be careful when editing the file, make sure the comma's and brackets are properly removed for the CRS object only! The top part of the MapBox sample GeoJSON should probably look like this:

{
  "type": "FeatureCollection",
  "features": [
    {
      "type": "Feature",
      "properties": {
        "name": "Van Dorn Street",
        "marker-color": "#0000ff",
        "marker-symbol": "rail-metro",
        "line": "blue"
      },
      "geometry": {
        "type": "Point",
        "coordinates": [
          -77.12911152370515,
          38.79930767201779
        ]
      }
    },

So the "type": "FeatureCollection", at the very top should most likely stay, as it is a separate object before the CRS definition.