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 path

  • bbox: 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:

{'format': 'geojson',
 'geoextent_handler': 'handleVector',
 'bbox': [7.6016807556152335,
  51.94881477206191,
  7.647256851196289,
  51.974624029877454],
 'crs': '4326'}

(source of file muenster_ring_zeit.geojson)

Extracting time interval from a single file

Code:

geoextent.fromFile('muenster_ring_zeit.geojson', False, True)

Output:

{'format': 'geojson',
 'geoextent_handler': 'handleVector',
 'tbox': ['2018-11-14', '2018-11-14']}

(source of file muenster_ring_zeit.geojson)

Extracting both bounding box and time interval from a single file

Code:

geoextent.fromFile('muenster_ring_zeit.geojson', True, True)

Output:

{'format': 'geojson',
 'geoextent_handler': 'handleVector',
 'tbox': ['2018-11-14', '2018-11-14'],
 'bbox': [7.6016807556152335,
  51.94881477206191,
  7.647256851196289,
  51.974624029877454],
 'crs': '4326'}

(source of file muenster_ring_zeit.geojson)

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 path

  • 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 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:

{'format': 'folder',
 'crs': '4326',
 'bbox': [7.6016807556152335,
  51.94881477206191,
  7.647256851196289,
  51.974624029877454],
 'tbox': ['2018-11-14', '2018-11-14'],
 'details': {'muenster_ring_zeit.geojson': {'format': 'geojson',
   'geoextent_handler': 'handleVector',
   'bbox': [7.6016807556152335,
    51.94881477206191,
    7.647256851196289,
    51.974624029877454],
   'crs': '4326',
   'tbox': ['2018-11-14', '2018-11-14']}}}

folder_two_files

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:

The folder /tmp/tmp88fbyv84 has no identifiable time extent
{'format': 'repository',
 'crs': '4326',
 'bbox': [96.21146318274846,
  25.558346194400002,
  96.35495081696702,
  25.632931128800003]}