Geometry handling

Learn how to correctly provide geometries while creating orders with the SDK.


In a geometry file

UP42 SDK supports the following file formats:

  • GeoJSON
  • KML
  • Shapefile
  • WKT

Use the read_vector_file tool to upload your geometry from a vector file:

Python

    geometry = up42.read_vector_file("data/aoi_washington.geojson")

  

Directly in the code

AOIs

Python

    aoi = {
    "type": "Polygon",
    "coordinates": (
        (
            (13.375966, 52.515068), # Bottom-left corner
            (13.375966, 52.516639), # Bottom-right corner
            (13.378314, 52.516639), # Top-right corner
            (13.378314, 52.515068), # Top-left corner
            (13.375966, 52.515068), # Bottom-left corner
        ),
    ),
}

  

Python

    bbox = [
    13.382853541948975, # Min longitude
    52.512321097987126, # Min latitude
    13.39586259650261,  # Max longitude
    52.5185756711692,   # Max latitude
]


  

POIs

Python

    poi = {
    "type": "Point",
    "coordinates": (
        (
            (13.375966, 52.515068),
        ),
    ),
}