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


Download files

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

Source Distribution

fio_taxa-1.0.0.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distributions

fio_taxa-1.0.0-py3-none-any.whl (4.7 kB view hashes)

Uploaded Python 3

fio_taxa-1.0.0-py2-none-any.whl (4.7 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page