Skip to content

Instantly share code, notes, and snippets.

@david-murr
Last active December 14, 2018 22:52
Show Gist options
  • Select an option

  • Save david-murr/9d17e4b7267ab3290833 to your computer and use it in GitHub Desktop.

Select an option

Save david-murr/9d17e4b7267ab3290833 to your computer and use it in GitHub Desktop.
command line raster stats
fio cat ../missed.shp | rio zonalstats -r amfam.vrt --categorical | jq '.features[].properties | {APN: .APN,pool: ._1}' | jq --slurp . | in2csv -f json > test.csv
jq '.features[].properties | {APN: .APN,pool: ._1}' pools.geojson | jq --slurp . | in2csv -f json > test.csv
fio cat countries.shp | rio zonalstats -r dem.tif --prefix "elevation_" > countries_with_elevation.geojson
fio cat large.shp | rio zonalstats -r elevation.tif --sequence | some-other-process
time fio cat ../parcels/parcels_pools.shp | parallel --pipe "rio zonalstats -r amfam.vrt --categorical" > out
fio cat test.shp | jq '{geometry: .geometry, PARCEL_ID: .properties.PARCEL_ID}' -c | fio collect > test.geojson
fio cat TX_Lamp*.shp | jq '{geometry: .geometry, properties: {PARCEL_ID: .properties.PARCEL_ID}, type: "Feature"}' -c | jq --slurp . > test.geojson
{ echo {'"'features'"': ; cat test.geojson ; echo , '"'type'"': '"'FeatureCollection'"'} ; } > test2.geojson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment