Command-Line Interface (CLI)

Basics

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

usage: geoextent [-h] [--formats] [--version] [-b] [-t] [-input= '[filepath|input file]']
-h, --help

show help message and exit

--formats

show supported formats

--version

show installed version

-b, --bounding-box

extract spatial extent (bounding box)

-t, --time-box

extract temporal extent

-input=

input file or path

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] [-b] [-t] [-input= '[filepath|input file]']

optional arguments:
  -h, --help            show help message and exit
  --formats             show supported formats
  --version             show installed version
  -b, --bounding-box    extract spatial extent (bounding box)
  -t, --time-box        extract temporal extent
  -input= INPUT= [INPUT= ...]
                        input file or path

By default, both bounding box and temporal extent are extracted.

Examples:

geoextent path/to/geofile.ext
geoextent -b path/to/directory_with_geospatial_data
geoextent -t path/to/file_with_temporal_extent
geoextent -b -t path/to/geospatial_files


Supported formats:
- GeoJSON (.geojson)
- Tabular data (.csv)
- Shapefile (.shp)
- GeoTIFF (.geotiff, .tif)

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 -input= 'muenster_ring_zeit.geojson'

Output:

INFO:root:Extracting bbox=True tbox=False from file ../tests/testdata/geojson/muenster_ring_zeit.geojson
INFO:root:Module used: geojson
INFO:root:Checking validity of ../tests/testdata/geojson/muenster_ring_zeit.geojson 

INFO:root:Extracting content from path ../tests/testdata/geojson/muenster_ring_zeit.geojson 

{'format': 'application/geojson',
 'crs': 4326,
 'bbox': [7.60168075561523,
  51.9488147720619,
  7.64725685119629,
  51.9746240298775]}

Extract time interval from a single file

geoextent -t -input='file.geojson'

Output:

INFO:root:Extracting bbox=False tbox=True from file ../tests/testdata/geojson/muenster_ring_zeit.geojson
INFO:root:Module used: geojson
INFO:root:Checking validity of ../tests/testdata/geojson/muenster_ring_zeit.geojson 

INFO:root:Extracting content from path ../tests/testdata/geojson/muenster_ring_zeit.geojson 

{'format': 'application/geojson',
 'crs': 4326,
 'tbox': ['2018-11-14', '2018-11-14']}

Extract both bounding box and time interval from a single file

geoextent -b -t -input= 'file.geojson'
INFO:root:Extracting bbox=True tbox=True from file ../tests/testdata/geojson/muenster_ring_zeit.geojson
INFO:root:Module used: geojson
INFO:root:Checking validity of ../tests/testdata/geojson/muenster_ring_zeit.geojson 

INFO:root:Extracting content from path ../tests/testdata/geojson/muenster_ring_zeit.geojson 

INFO:root:Extracting content from path ../tests/testdata/geojson/muenster_ring_zeit.geojson 

{'format': 'application/geojson',
 'crs': 4326,
 'tbox': ['2018-11-14', '2018-11-14'],
 'bbox': [7.60168075561523,
  51.9488147720619,
  7.64725685119629,
  51.9746240298775]}