I have downloaded a very large file of polygon multiparcels as a CSV with supporting csvt and vrt metadata using QGIS and the Vector loader dialog. It loads into a layer beautifully including varchar(n) widths, geometry and crucially an ogc_fid autoincrement primary key is added.

But there are a million null geometries that are just skipped completely because the WKT column is empty. In the past they have been included with Null geometry. I can edit a sample and replace the null field with "MULTIPOLYGON NONE" that works really well. If only there was a switch to set that for a null value...

If I use the plain CSV loader it does load, but without the schema widths or primary key or geometry field as a nonspatial table.

  • 3
    "loads into a layer" - using what software, which tool or function and with what tool or function parameters?
    – user2856
    Commented Jul 11 at 3:13
  • What would be the purpose of using 17 extra characters (or a Nil geometry, which is larger) vice a NULL, besides making the dataset more unwieldy?
    – Vince
    Commented Jul 11 at 11:40
  • Yes, sorry I am using QGIS Vector loader which is designed to load CSV files properly. The purpose of all the extra characters is because that is the OGC Standard required for Null geometry. Yes I would have hoped that QGIS would recognise an empty field as Null Geometry, not skip the record altogether.
    – KimO
    Commented Jul 12 at 5:16


Your Answer

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

Browse other questions tagged or ask your own question.