API Docs¶
Documentation for the package’s Python API for usage as a library.
Individual files¶
The main function is:
geoextent.fromFile(input, bbox, time)
- Parameters:
input
: a string value of input file or pathbbox
: a boolean value to extract spatial extent (bounding box)time
: a boolean value to extract temporal extent ( at “day” precision ‘%Y-%m-%d’)
The output of this function is the bbox and/or the tbox for individual files (see: Supported file formats). The resulting coordinate reference system CRS
of the bounding box is the one resulting from the extraction (i.e no transformation to other coordinate reference system).
Examples¶
Extract bounding box from a single file¶
Code:
geoextent.fromFile('muenster_ring_zeit.geojson', True, False)
Output:
Extracting time interval from a single file¶
Code:
geoextent.fromFile('muenster_ring_zeit.geojson', False, True)
Output:
Extracting both bounding box and time interval from a single file¶
Code:
geoextent.fromFile('muenster_ring_zeit.geojson', True, True)
Output:
Folders or ZIP file(s)¶
Geoextent also supports queries for multiple files inside folders or ZIP files.
geoextent.fromDirectory(input, bbox, time, details)
- Parameters:
input
: a string value of directory of zipfile pathbbox
: a boolean value to extract spatial extent (bounding box)time
: a boolean value to extract temporal extent ( at “day” precision ‘%Y-%m-%d’)details
: a boolean value to return details (geoextent) of individual files (default False)
The output of this function is the combined bbox or tbox resulting from merging all results of individual files (see: Supported file formats) inside the folder or zipfile. The resulting coordinate reference system CRS
of the combined bbox is always in the EPSG: 4326 system.
Extracting both bounding box and time interval from a folder (with details)¶
Code:
geoextent.fromDirectory('folder_one_file', True, True, True)
Output:
Zenodo repositories¶
Geoextent also supports queries for Zenodo repositories. Geoextent creates a temporal copy of the repository and extracts the temporal or geographical extent. Geoextent only allows to query Open Zenodo repositories.
geoextent.from_repository(repository_identifier, bbox, time, details)
- Parameters:
repository_identifier
: a string value with a Zenodo link (e.g., https://zenodo.org/record/3528062) or DOI (e.g., https://doi.org/10.5281/zenodo.3528062)bbox
: a boolean value to extract spatial extent (bounding box)time
: a boolean value to extract temporal extent (at “day” precision ‘%Y-%m-%d’)details
: a boolean value to return details (geoextent) of individual files (default False)
The output of this function is the combined bbox or tbox resulting from merging all results of individual files (see: Supported file formats) inside the repository. The resulting coordinate reference system CRS
of the combined bbox is always in the EPSG: 4326 system.
Code:
geoextent.from_repository('https://zenodo.org/record/820562', True, True, False)
Output: