Command-Line Interface (CLI)

Basics

geoextent can be called on the command line with this command :

usage: geoextent [-h] [--formats] [--version] [--debug] [--details] [--output] [output file] [-b] [-t] [input file]'] 
files

input file or path

-h, --help

show help message and exit

--formats

show supported formats

--version

show installed version

--debug

turn on debug logging, alternatively set environment variable GEOEXTENT_DEBUG=1

--details

Returns details of folder/zipFiles geoextent extraction

--output <output>

Creates geopackage with geoextent output

-b, --bounding-box

extract spatial extent (bounding box)

-t, --time-box

extract temporal extent (%Y-%m-%d)

Examples

Note

Depending on the local configuration, geoextent might need to be called with the python interpreter prepended:

python -m geoextent …

Show help message

geoextent -h

geoextent is a Python library for extracting geospatial and temporal extents of a file
 or a directory of multiple geospatial data formats.

usage: geoextent [-h] [--formats] [--version] [--debug] [--details] [--output] [output file] [-b] [-t] [input file]'] 

positional arguments:
  files               input file or path

optional arguments:
  -h, --help          show help message and exit
  --formats           show supported formats
  --version           show installed version
  --debug             turn on debug logging, alternatively set environment
                      variable GEOEXTENT_DEBUG=1
  --details           Returns details of folder/zipFiles geoextent extraction
  --output OUTPUT     Creates geopackage with geoextent output
  -b, --bounding-box  extract spatial extent (bounding box)
  -t, --time-box      extract temporal extent (%Y-%m-%d)


Examples:

geoextent -b path/to/directory_with_geospatial_data
geoextent -t path/to/file_with_temporal_extent
geoextent -b -t path/to/geospatial_files
geoextent -b -t --details path/to/zipfile_with_geospatial_data


Supported formats:
- GeoJSON (.geojson)
- Tabular data (.csv)
- GeoTIFF (.geotiff, .tif)
- Shapefile (.shp)
- GeoPackage (.gpkg)
- GPS Exchange Format (.gpx)
- Geography Markup Language (.gml)
- Keyhole Markup Language (.kml)


Extract bounding box from a single file

Note

You can find the file used in the examples of this section from muenster_ring_zeit. Furthermore, for displaying the rendering of the file contents, see rendered blob.

geoextent -b muenster_ring_zeit.geojson

Output:

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

Extract time interval from a single file

Note

You can find the file used in the examples of this section from muenster_ring_zeit. Furthermore, for displaying the rendering of the file contents, see rendered blob.

geoextent -t muenster_ring_zeit.geojson

Output:

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

Extract both bounding box and time interval from a single file

Note

You can find the file used in the examples of this section from muenster_ring_zeit. Furthermore, for displaying the rendering of the file contents, see rendered blob.

geoextent -b -t 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']}

Folders or ZIP files(s)

Geoextent also supports queries for multiple files inside folders or ZIP file(s).

Extract both bounding box and time interval from a folder or zipfile

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

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.

Zenodo repositories

Geoextent also supports queries from (Open) Zenodo repositories.

Extract both bounding box and time interval from Zenodo

geoextent -b -t https://zenodo.org/record/820562
WARNING:geoextent:The folder /tmp/tmpg2ocinua has no identifiable time extent
{'format': 'repository',
 'crs': '4326',
 'bbox': [96.21146318274846,
  25.558346194400002,
  96.35495081696702,
  25.632931128800003]}

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 Zenodo repository. The resulting coordinate reference system CRS of the combined bbox is always in the EPSG: 4326 system.

Debugging

You can enable detailed logs by passing the --debug option, or by setting the environment variable GEOEXTENT_DEBUG=1.

geoextent --debug -b -t muenster_ring_zeit.geojson

GEOEXTENT_DEBUG=1 geoextent -b -t muenster_ring_zeit.geojson

Details

You can enable details for folders and ZIP files by passing the --details option, this option allows you to access to the geoextent of the individual files inside the folders/ ZIP files used to compute the aggregated bounding box (bbox) or time box (tbox).

geoextent --details -b -t folder_one_file
{'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']}}}

Export function

You can export the result of Geoextent to a Geopackage file. This file contains the output of all files within the folder or repository.

geoextent -b -t --output path/to/output/geopackage_file.gpkg folder_path