Skip to main content

Classification of GeoJSON features

Project description

https://travis-ci.org/sgillies/fio-taxa.svg https://coveralls.io/repos/github/sgillies/fio-taxa/badge.svg?branch=master

fio_taxa classifies GeoJSON features.

Given a sequence of Features, fio_taxa finds and returns the set of unique kinds of Features in the sequence. Uniqueness is determined by geometry type and by the set of names and types of values in a Feature’s ‘properties’ member. Members foreign to the GeoJSON specification are not considered.

Usage

fio_taxa has one function: fio_taxa.classify().

>>> import json
>>> from fio_taxa import classify
>>> src = open('tests/data/trio.geojson')
>>> collection = json.loads(src.read())
>>> for taxon in classify(collection['features']):
...     print(taxon)
...
((('aqueduct', 'str'),), 'LineString')
((('architect', 'str'), ('name', 'str')), 'Polygon')
((('name', 'str'),), 'Point')

Command line interface

fio_taxa adds a “taxa” command to Fiona’s “fio” program.

$ cat tests/data/trio.seq | fio taxa
{"geometry": "Polygon", "properties": {"architect": "str", "name": "str"}}
{"geometry": "Point", "properties": {"name": "str"}}
{"geometry": "LineString", "properties": {"aqueduct": "str"}}

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
fio_taxa-1.0.0-py2-none-any.whl (4.7 kB) Copy SHA256 hash SHA256 Wheel py2
fio_taxa-1.0.0-py3-none-any.whl (4.7 kB) Copy SHA256 hash SHA256 Wheel py3
fio_taxa-1.0.0.tar.gz (2.7 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page