Troubleshooting

Too many polygons error - R0177- PIX4Dfields

The geometry type can sometimes lead to errors when importing shapefiles generated by different farm machinery, such as as-applied maps, yield maps, or coverage maps.

Introduction

Shapefiles containing large multi-polygon geometries beyond 1000 objects, will fail to import in PIX4Dfields and lead to Error "Too many polygons. R0177"
To address this issue, it is recommended that the data be cleaned and prepared before attempting to import these files. QGIS is an excellent tool for these preprocessing steps, as it allows you to simplify, repair, or otherwise adjust the geometry to ensure a successful import.

Example of an "As-applied" map with more than 8k polygons.

AssAppliedMapExample

Error message

"Too many polygons. R0177: The file contains too many polygons or sub-polygons for PIX4Dfields to import as vector data."

Workaround/Solution


Dissolve shapefile to reduce the amount of polygons

Load shapefile to QGIS

  1. Open QGIS.

  2. In the Layers panel (usually on the left), right-click and select Add Layer > Add Vector Layer… (or just click the Add Vector Layer button in the toolbar).

  3. In the dialog that appears, browse to your shapefile’s location and click Open.

Dissolve shapefile 

  1. Go to the top menu and click Processing > Toolbox (or click the “gear” icon to open the Processing Toolbox if it’s not already open).
  2. Find the Dissolve function. 
    image-png-Jan-15-2025-03-23-02-3779-PM
  3. Set the Input layer
  4. Select the Dissolve field if there's a column with the same name on all objects. Otherwise, leave it un-selected.
  5. Click Run
    dissolve_setting
    1. If an invalid geometry error is present, run a Fix geometries before dissolving.
  6. Once the Dissolved is done, Righ-click on the dissolved layer.
  7. Click Export, and Save feature as.

    Export
  8. Go to PIX4Dfields, Annotations, Import geometry.
    importAnot
  9. Example of the dissolved As-applied map imported to PIX4Dfields as Annotations. 

    ASsApplied_Imported