Skip to main content
Tweeted twitter.com/StackGIS/status/991306459735646208
add tag geometry, as the question deals with geometry data type issues
Link
til_b
  • 5.2k
  • 1
  • 20
  • 37
edited tags
Link
kamome
  • 767
  • 2
  • 12
  • 25
Source Link
kamome
  • 767
  • 2
  • 12
  • 25

How to load the full content of a vector layer using PyQGIS?

I am trying to load a geojson file using the following code:

capa = QgsVectorLayer("C:/...file.geojson","capa","ogr")
if not layer.isValid():
  print("Layer failed to load!")

QgsProject.instance().addMapLayer(capa)

The geojson file contents a FeatureCollection, some points feature and a multiline. But just the poinst are rendered. Cannot load the multiline.

How can I do that stuff?