88. Mutation: Export ZonesMap as Zipped Shapefile

Generate a zip archive with the selected "ZonesMap" as shapefile.

The archive consists of *.shp, *.shx, *.prj, *.dbf files in EPSG:4326.

1. Preparation

  • The attribute vectorAnalysisMaps contains an array of ZonesMaps (VectorAnalysisMaps) objects to be exported. Each such object includes a pair of fieldUuid (linkage to the selected Field) and uuid (linkage to the selected ZonesMap).

  • The boolean attribute asMultiGeometry determines whether zones are exported as Polygons or MultiPolygons (when set to true ).

  • The boolean attribute onlyProductColumns specifies if only columns with products (RX) should be included in the shapefile (when true). Otherwise, all statistical attributes and zone IDs will be included as columns.

  • The attribute archiveName holds the name of the generated zip archive.

  • The attribute filePostfix allows for custom postfixes to be added to the exported files and archive.

mutation exportData {
  exportData(
    input: {
      filePostfix:"_GP" 
      vectorAnalysisMaps:[
        {
          uuid:"<placeholder_zones_map_uuid>"
          fieldUuid:"<placeholder_field_uuid>"
        },
        {
          uuid:"<placeholder_zones_map_uuid>"
          fieldUuid:"<placeholder_field_uuid>"
        }
      ]
      asMultiGeometry:true 
      onlyProductColumns:true 
      archiveName:"ArchivedZonesMaps"
    }
  ) {
    archiveUrl
    
    zippedVectorAnalysisMaps {
      uuid
      fieldUuid
      status
    }
    ignoredVectorAnalysisMaps  {
      uuid
      fieldUuid
      status
    } 
  }
}

2. Download the generated archive

After execution of the GraphQL query, it is possible to download it using curl or a similar approach.

curl '<archiveUrl>' --compressed >> '<archiveUrl>'

Last updated

Powered by GeoPard Agriculture - Automated precisionAg platform