/up42-py

Python SDK for UP42, the geospatial marketplace and developer platform. (BETA)

Primary LanguagePythonMIT LicenseMIT

(BETA) Python package for UP42, the geospatial marketplace and developer platform.

Documentation   •   UP42.com   •   Support

Highlights

  • Python package for easy access to UP42's geospatial datasets & processing workflows
  • For geospatial analysis & product builders!
  • Interactive maps & visualization, ideal with Jupyter notebooks
  • Command Line Interface (CLI)
  • Developer tools for UP42 custom blocks (coming soon)

Install

The package requires Python > 3.6.

pip install up42-py

See the installation docs for all details and learn how to get started!


Overview

  • The UP42 Python SDK uses six object classes, representing the hierarchical structure of UP42:
    • Project > Workflow > Job > JobTask
    • Catalog
    • Tools
  • Each object can spawn elements of one level below, e.g.
    • project = up42.initialize_project()
    • workflow = Project().create_workflow()
    • job = workflow.create_and_run_job()

30-seconds Example

After authentication with the UP42 project, a new workflow is created and filled with tasks (Sentinel-2 data, image sharpening). The area of interest and workflow parameters are defined. After running the job, the results are downloaded and visualized.

import up42

up42.authenticate(porject_id=12345, project_api_key=12345)
project = up42.initialize_project()

workflow = project.create_workflow(name="30-seconds-workflow", use_existing=True)
# Add blocks/tasks to the workflow.
blocks = up42.get_blocks(basic=True)
input_tasks= [blocks['sobloo-s2-l1c-aoiclipped'], 
              blocks['sharpening']]
workflow.add_workflow_tasks(input_tasks=input_tasks)

# Define the aoi and input parameters of the workflow to run it.
aoi = workflow.read_vector_file("data/aoi_berlin.geojson", as_dataframe=True)
input_parameters = workflow.construct_parameters(geometry=aoi, 
                                                 geometry_operation="bbox", 
                                                 start_date="2018-01-01",
                                                 end_date="2020-12-31",
                                                 limit=1)
input_parameters["sobloo-s2-l1c-aoiclipped:1"].update({"max_cloud_cover":60})

job = workflow.create_and_run_job(input_parameters=input_parameters)
job.track_status()

job.download_results()
job.map_results()

Support

For any kind of issues or help please contact us via Email support@up42.com or open a github issue.