2

I'm trying to export a .geojson file as a shapefile but I get an error stating that "Unsupported type for field style". Any solution to that?enter image description here

3
  • Welcome to Geographic Information Systems! Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works
    – Ian Turton
    Commented Jul 12, 2022 at 7:31
  • 1
    what types does your input file have in it?
    – Ian Turton
    Commented Jul 12, 2022 at 7:31
  • Shapefile does not support datetime field type: do you have such a field in your layer?
    – Babel
    Commented Jul 12, 2022 at 7:49

1 Answer 1

3

In QGIS, make sure to check the option "Use Key/Value" for the field concerned ('style' in your case) when exporting a GeoJSON file into an ESRI shapefile.

enter image description here

Otherwise, you'll get an Error: Unsupported type for field prop1

enter image description here

2
  • 1
    How can make this checkbox acvtive while using pyqgis? I mean, probably this codeblock gives same error beacuse of same issue: >>> layer = iface.layerTreeView().selectedLayers()[0] >>> QgsVectorFileWriter.writeAsVectorFormat(layer, outfile, 'utf-8', 'GeoJSON') (4, 'Unsupported type for field extra') what should do in this case? Commented May 12, 2023 at 7:58
  • Is there a solution for this in pyQGIS?
    – i.i.k.
    Commented Dec 20, 2023 at 12:30

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.