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?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338

1 Answers1

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.

Doruk Karınca
  • 815
  • 1
  • 9
  • 21