Aircraft Detection¶
- Get Pleiades imagery for the given airports
- Execute tiling and aircraft detection blocks via parallel jobs
Visualize the results
The example costs around 1700 UP42 credits
Setup¶
Import required libraries
In [14]:
Copied!
import up42
import geopandas as gpd
import rasterio
from rasterio.plot import show
import matplotlib.pyplot as plt
from shapely.geometry import box
import up42
import geopandas as gpd
import rasterio
from rasterio.plot import show
import matplotlib.pyplot as plt
from shapely.geometry import box
Configure areas of interest
In [15]:
Copied!
aoi_txl = {"type":"FeatureCollection","features":[{"type":"Feature","properties":{},
"geometry":{"type":"Polygon","coordinates":[[[13.286740779876709,52.5509016976356],
[13.300495147705078,52.5509016976356],
[13.300495147705078,52.556890079685594],
[13.286740779876709,52.556890079685594],
[13.286740779876709,52.5509016976356]]]}}]}
aoi_muc = {"type":"FeatureCollection","features":[{"type":"Feature","properties":{},
"geometry":{"type":"Polygon","coordinates":[[[11.789016723632812,48.348577346994944],
[11.809401512145996,48.348577346994944],
[11.809401512145996,48.360155725059116],
[11.789016723632812,48.360155725059116],
[11.789016723632812,48.348577346994944]]]}}]}
aois = [{'title': 'TXL', 'geometry': aoi_txl},
{'title': 'MUC', 'geometry': aoi_muc}]
aoi_txl = {"type":"FeatureCollection","features":[{"type":"Feature","properties":{},
"geometry":{"type":"Polygon","coordinates":[[[13.286740779876709,52.5509016976356],
[13.300495147705078,52.5509016976356],
[13.300495147705078,52.556890079685594],
[13.286740779876709,52.556890079685594],
[13.286740779876709,52.5509016976356]]]}}]}
aoi_muc = {"type":"FeatureCollection","features":[{"type":"Feature","properties":{},
"geometry":{"type":"Polygon","coordinates":[[[11.789016723632812,48.348577346994944],
[11.809401512145996,48.348577346994944],
[11.809401512145996,48.360155725059116],
[11.789016723632812,48.360155725059116],
[11.789016723632812,48.348577346994944]]]}}]}
aois = [{'title': 'TXL', 'geometry': aoi_txl},
{'title': 'MUC', 'geometry': aoi_muc}]
Authenticate with UP42
In [16]:
Copied!
#up42.authenticate(project_id="123", project_api_key="456")
up42.authenticate(cfg_file="config.json")
up42.settings(log=False)
#up42.authenticate(project_id="123", project_api_key="456")
up42.authenticate(cfg_file="config.json")
up42.settings(log=False)
2020-12-03 13:49:53,328 - Got credentials from config file. 2020-12-03 13:49:53,769 - Authentication with UP42 successful! 2020-12-03 13:49:53,770 - Logging disabled - use up42.settings(log=True) to reactivate.
Catalog Search¶
Search cloudfree Pleiades image for the two aois and visualise the quicklooks.
In [17]:
Copied!
catalog = up42.initialize_catalog()
for aoi in aois:
print("\n---------" + aoi["title"] + "---------\n")
search_paramaters = catalog.construct_parameters(geometry=aoi['geometry'],
start_date="2020-04-01",
end_date="2020-04-30",
sensors=["pleiades"],
max_cloudcover=10,
sortby="acquisitionDate",
ascending=False,
limit=3)
search_results = catalog.search(search_paramaters)
# Download & Visualise quicklooks
catalog.download_quicklooks(image_ids=search_results.id.to_list(), sensor="pleiades")
display(search_results.head())
catalog.plot_quicklooks(figsize=(18,5), titles=search_results.sceneId.to_list())
# Select least cloud scene for further workflow
aoi["sceneId"] = search_results.sceneId.to_list()[0]
catalog = up42.initialize_catalog()
for aoi in aois:
print("\n---------" + aoi["title"] + "---------\n")
search_paramaters = catalog.construct_parameters(geometry=aoi['geometry'],
start_date="2020-04-01",
end_date="2020-04-30",
sensors=["pleiades"],
max_cloudcover=10,
sortby="acquisitionDate",
ascending=False,
limit=3)
search_results = catalog.search(search_paramaters)
# Download & Visualise quicklooks
catalog.download_quicklooks(image_ids=search_results.id.to_list(), sensor="pleiades")
display(search_results.head())
catalog.plot_quicklooks(figsize=(18,5), titles=search_results.sceneId.to_list())
# Select least cloud scene for further workflow
aoi["sceneId"] = search_results.sceneId.to_list()[0]
---------TXL---------
100%|██████████| 3/3 [00:02<00:00, 1.34it/s]
geometry | id | acquisitionDate | constellation | providerName | blockNames | cloudCoverage | up42:usageType | providerProperties | sceneId | |
---|---|---|---|---|---|---|---|---|---|---|
0 | POLYGON ((13.20640 52.58098, 13.20616 52.45458... | c5497393-8f8d-4367-9527-c39344e220fe | 2020-04-28T10:31:35Z | PHR | oneatlas | [oneatlas-pleiades-fullscene, oneatlas-pleiade... | 2.31 | [DATA, ANALYTICS] | {'commercialReference': 'SO20025725', 'acquisi... | DS_PHR1B_202004281031350_FR1_PX_E013N52_0513_0... |
1 | POLYGON ((13.21800 52.58082, 13.21860 52.45684... | 07e5eaba-7830-4aee-8c27-6b69fa1da89f | 2020-04-23T10:19:52Z | PHR | oneatlas | [oneatlas-pleiades-fullscene, oneatlas-pleiade... | 0.00 | [DATA, ANALYTICS] | {'commercialReference': 'SO20022129', 'acquisi... | DS_PHR1B_202004231019525_FR1_PX_E013N52_0513_0... |
2 | POLYGON ((13.20760 52.58274, 13.20828 52.45502... | 11616f18-4002-44fc-bfeb-571c6657ccf4 | 2020-04-17T10:16:45Z | PHR | oneatlas | [oneatlas-pleiades-fullscene, oneatlas-pleiade... | 0.40 | [DATA, ANALYTICS] | {'commercialReference': 'SO20017653', 'acquisi... | DS_PHR1A_202004171016453_FR1_PX_E013N52_0513_0... |