#!/usr/bin/env python # coding: utf-8 # # OneAtlas WorldDEM Full Resolution Block - Data Access Example # WorldDEMâ„¢ Streaming Service is a Digital Surface Model (DSM) with unprecedented quality, accuracy and coverage. The resolution of the data is 12 meters and it is in GeoTIFF format to represent the surface of the Earth including buildings, infrastructure and vegetation. # # In the example, the workflow, the area of interest and the workflow parameters are defined. After running the job, the results are downloaded and visualized. For more information, refer to the block's [UP42 Marketplace page](https://marketplace.up42.com/block/1cdf4786-f524-41d5-9d88-b877c2a2bb4f) and [Documentation](https://docs.up42.com/up42-blocks/data/oneatlas-worlddem-12m.html). # In[1]: import up42 # In[2]: # authenticate and intialize the project up42.authenticate(project_id="1234", project_api_key="abcd") project = up42.initialize_project() # In[3]: # Construct workflow workflow = project.create_workflow(name="worlddem12-data-access", use_existing=True) # In[4]: # construct parameters input_tasks = ["oneatlas-worlddem-12m"] workflow.add_workflow_tasks(input_tasks) # In[5]: # set aoi aoi = {"type": "FeatureCollection","features": [{"type": "Feature","properties": {}, "geometry": {"type": "Polygon","coordinates": [[[13.368789,52.495375], [13.383853,52.495375], [13.383853,52.502715], [13.368789,52.502715], [13.368789,52.495375]]]}}]} # In[6]: # Define the aoi and input parameters of the workflow to run it. input_parameters = workflow.construct_parameters(geometry=aoi, geometry_operation="bbox") # In[7]: # Price estimation workflow.estimate_job(input_parameters) # In[8]: # Run a test job to query data availability and check the configuration. test_job = workflow.test_job(input_parameters, track_status=True) # In[9]: # Run the actual job. job = workflow.run_job(input_parameters, track_status=True) # In[ ]: job.download_results() # In[13]: job.plot_results(bands=[1]) # In[ ]: