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': 'application/shp',
 'crs': '4326',
 'bbox': [7.6016807556152335,
  51.94881477206191,
  7.647256851196289,
  51.974624029877454]}

(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': 'application/shp',
 'crs': '4326',
 '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': 'application/shp',
 'bbox': [7.6016807556152335,
  51.94881477206191,
  7.647256851196289,
  51.974624029877454],
 'crs': '4326',
 'tbox': ['2018-11-14', '2018-11-14']}

(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)
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’)

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

Code:

geoextent.fromDirectory('folder_two_files', True, True)

Output:

{'format': 'folder',
 'crs': '4326',
 'bbox': [2.052333387639205,
  41.31703852240476,
  7.647256851196289,
  51.974624029877454],
 'tbox': ['2018-11-14', '2019-09-11']}

folder_two_files