4

In Pablo's answer to How to open a GeoJSON file with mixed geometries in QGIS?

He says he 'imported each type at a time' and I do not know how to do that.

I am working with a GeoJSON file that has a mixture of points and polygons, but points are first, so it only shows points.

How do I get QGIS to show the polygons instead of the points?

1 Answer 1

1

If point features are on one end of the page and polygons in the other, open up your geojson in the Notepad, and then cut-paste the polygons feature to a separate text file.

Initial file:

var initial = [{
"type": "Feature",
"geometry": {
    "type": "Polygon",
    "coordinates": [[
        [-104.05, 48.99],
        [-97.22,  48.98],
        [-96.58,  45.94],
        [-104.03, 45.94],
        [-104.05, 48.99]
    ]]
   }
  }, {
"type": "Point",
"geometry": {
    "type": "Point",
    "coordinates": [-104.99404, 39.75621]
  }
}];

Pulling out the polygon:

var polygon = [{
"type": "Feature",
"geometry": {
    "type": "Polygon",
    "coordinates": [[
        [-104.05, 48.99],
        [-97.22,  48.98],
        [-96.58,  45.94],
        [-104.03, 45.94],
        [-104.05, 48.99]
    ]]
   }
  }];

Afterwards you'd save it as another geojson file and add it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.