Skip to main content

format geojson

Project description

GeoJSON format

Formatting geojson with each feature on its own line

Requirements

  • Python: >=3.5

Installation

python -m pip install geojsonformat

Usage example

Input:

{"type":"FeatureCollection","name":"ne_50m_admin_0_countries_lakes","crs":{"type":"name","properties":{"name":"urn:ogc:def:crs:OGC:1.3:CRS84"}},"features":[{"type":"Feature","properties":{"featurecla":"Admin-0 country","scalerank":1},"geometry":{"type":"Polygon","coordinates":[[[26.1474609375, 56.78884524518923],[25.521240234375, 56.24334992410525],[26.54296875,55.979945357882315],[27.158203125,56.52919914018469],[27.290039062499996,56.90900226702048],[26.1474609375, 56.78884524518923]]]}},{"type":"Feature","properties":{"featurecla":"Admin-0 country"},"geometry":{"type":"Polygon","coordinates":[[[26.1474609375, 56.78884524518923],[25.521240234375, 56.24334992410525],[26.54296875,55.979945357882315],[27.158203125,56.52919914018469],[27.290039062499996,56.90900226702048],[26.1474609375, 56.78884524518923]]]}}]}

Formatting:

geojsonformat -i input.geojson -o out.geojson

Output:

{"type": "FeatureCollection", "name": "ne_50m_admin_0_countries_lakes", "crs": {"type": "name", "properties": {"name": "urn:ogc:def:crs:OGC:1.3:CRS84"}},"features":[
{"type": "Feature", "properties": {"featurecla": "Admin-0 country", "scalerank": 1}, "geometry": {"type": "Polygon", "coordinates": [[[26.1474609375, 56.78884524518923], [25.521240234375, 56.24334992410525], [26.54296875, 55.979945357882315], [27.158203125, 56.52919914018469], [27.290039062499996, 56.90900226702048], [26.1474609375, 56.78884524518923]]]}},
{"type": "Feature", "properties": {"featurecla": "Admin-0 country"}, "geometry": {"type": "Polygon", "coordinates": [[[26.1474609375, 56.78884524518923], [25.521240234375, 56.24334992410525], [26.54296875, 55.979945357882315], [27.158203125, 56.52919914018469], [27.290039062499996, 56.90900226702048], [26.1474609375, 56.78884524518923]]]}}
]}

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

geojsonformat-0.0.1.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

geojsonformat-0.0.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file geojsonformat-0.0.1.tar.gz.

File metadata

  • Download URL: geojsonformat-0.0.1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.4

File hashes

Hashes for geojsonformat-0.0.1.tar.gz
Algorithm Hash digest
SHA256 3b221f0df852142c149483cecdaaa2872ec4265c4041ee823caf46d1e8c347c7
MD5 01172317678c34f57d88635ad60da445
BLAKE2b-256 0356c5f7e8e9febdd4a5266b65439f346b39b6b98f542d2eb411959d81d1f894

See more details on using hashes here.

File details

Details for the file geojsonformat-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: geojsonformat-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.4

File hashes

Hashes for geojsonformat-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 bf80078ad0085318dc1e3903b1450da84c7ae20590beda22d2e978cbbeed082f
MD5 4a88b8aaf71921f5525c028edda5cdc9
BLAKE2b-256 b9f5f4b1cff7aad14ba0058180bac8af8b159b2cceb8ddf9ef15e98850d44019

See more details on using hashes here.

Supported by

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