jldgeo

Various geojson/json utilities


Install
pip install jldgeo==0.7

Documentation

jldjson
=======

Reads a JSON NL input stream. Keep the wanted (key:value) pairs from the stream
using the -k option.

Once the wanted pairs are selected, chosen other actions to perform.

Options
* -k : "keep" the specified (key:value) from the json NL object
* -u : "unpack" the specified dict value for the specified key. The value in the pair must
       of course be a dictionary.

Example:

jldjson -k properties -k geometry --stderr -i



"features": [
{ "type": "Feature", 
  "properties": { "PCA_ID": 180000059, "POSTALCODE": "P0R1L0", "PROV": "ON", "MAF_ID
": 350002523, "PREC_CODE": 2, "PCA_COUNT": 516, "DOM_PCA": 0, "MULTI_PC": 0, "DEL_M_ID": "LB0001", "LON
GITUDE": -83.442568069900005, "LATITUDE": 46.289068144200002 }, 
"geometry": { 
	"type": "MultiPolygon", 
	"coordinates": [ 
		[ 
			[ 
				[ -83.432379699999956, 46.29642750000005 ], 
				[ -83.432314099999985, 46.295825900000068 ], 
				[ -83.4323528, 46.29552810000007 ], ... ] ] ] } },

ijson parser snippet:
---------------------
 start_map None
 map_key type
type string FeatureCollection
 map_key name
name string ON_LDU
 map_key crs
crs start_map None
crs map_key type
crs.type string name
crs map_key properties
crs.properties start_map None
crs.properties map_key name
crs.properties.name string urn:ogc:def:crs:OGC:1.3:CRS84
crs.properties end_map None
crs end_map None
 map_key features
 
features start_array None

features.item start_map None

features.item map_key type
features.item.type string Feature

features.item map_key properties
features.item.properties start_map None
features.item.properties map_key PCA_ID
features.item.properties.PCA_ID number 180000059
features.item.properties map_key POSTALCODE
features.item.properties.POSTALCODE string P0R1L0
features.item.properties map_key PROV
features.item.properties.PROV string ON
features.item.properties map_key MAF_ID
features.item.properties.MAF_ID number 350002523
features.item.properties map_key PREC_CODE
features.item.properties.PREC_CODE number 2
features.item.properties map_key PCA_COUNT
features.item.properties.PCA_COUNT number 516
features.item.properties map_key DOM_PCA
features.item.properties.DOM_PCA number 0
features.item.properties map_key MULTI_PC
features.item.properties.MULTI_PC number 0
features.item.properties map_key DEL_M_ID
features.item.properties.DEL_M_ID string LB0001
features.item.properties map_key LONGITUDE
features.item.properties.LONGITUDE number -83.442568069900005
features.item.properties map_key LATITUDE
features.item.properties.LATITUDE number 46.289068144200002
features.item.properties end_map None

features.item map_key geometry
features.item.geometry start_map None
features.item.geometry map_key type
features.item.geometry.type string MultiPolygon
features.item.geometry map_key coordinates