diff --git a/docs/index.html b/docs/index.html index 480d652..44b7132 100644 --- a/docs/index.html +++ b/docs/index.html @@ -311,7 +311,7 @@
GeoJSON
eatures/objects and want a quick CLI tool to filter and slice them, you should give jq a try! Since there are not many tutorials…
+If you are manipulating a lot of GeoJSON
features/objects and want a quick CLI tool to filter and slice them, you should give jq a try! Since there are not many tutorials…
If you are manipulating a lot of GeoJSON
eatures/objects and want a quick CLI tool to filter and slice them, you should give jq a try! Since there are not many tutorials that exist on using jq to manage objects in the GeoJSON family, we hope that these few tricks will help you on your learning journey.
If you are manipulating a lot of GeoJSON
features/objects and want a quick CLI tool to filter and slice them, you should give jq a try! Since there are not many tutorials that exist on using jq to manage objects in the GeoJSON family, we hope that these few tricks will help you on your learning journey.
data/vt-bb.geojson
is the path of our file as the last argument
'.features | length'
is a jq filter. Remember, we are in the shell and whitespace has meaning. Not quoting it would mean that we have 4 arguments when we just have 2.
.features
will return the json array containing every feature
|
will pipe the stream of features into a new filter
length
is a built-in function that behaves differently depending the object input. Given an array, it will return the number of elements
.features
will return the json array containing every feature|
will pipe the stream of features into a new filterlength
is a built-in function that behaves differently depending the object input. Given an array, it will return the number of elements(.features[0].properties | keys_unsorted)
here nothing new we added parentheses to enforce precedence. We are getting the header of our csv
(.features[].properties | to_entries | map(.value))
:
we are starting from all our properties (not the first one)
passing it to to_entries
convert our object to multiple objects with “key” / “value” (see margin)
finally, map(.value)
gets all “value” for every selected features
to_entries
convert our object to multiple objects with “key” / “value” (see margin)map(.value)
gets all “value” for every selected featuresWe have just explored the surface! jq
can help to filter some specific features:
every geometries “served” in our file?
the first node in every geometries)?
etc!
jq
is a generic tool for filtering json and lot of people are following the JSON spec in GeoJSON, so we can build on top of all their monumental work!