summaryrefslogtreecommitdiff
path: root/localosmfeature2geojson
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2017-04-17 00:18:21 +0200
committerJonas Smedegaard <dr@jones.dk>2017-04-17 00:18:21 +0200
commit2c7ce962ac661f9b80377e1f0ca6069f6f5c9824 (patch)
tree8652b175eb7b6a87bb4dba41d362f9d217f1f2b5 /localosmfeature2geojson
parent840f79e1d83fa15d0a1eadfacda8c585b7b078f5 (diff)
Use jq (not json_pp) for slightly more compact syntax: No space before colon.
Diffstat (limited to 'localosmfeature2geojson')
-rwxr-xr-xlocalosmfeature2geojson6
1 files changed, 3 insertions, 3 deletions
diff --git a/localosmfeature2geojson b/localosmfeature2geojson
index dfd1a26..5df4b4b 100755
--- a/localosmfeature2geojson
+++ b/localosmfeature2geojson
@@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-# Depends: gdal-bin perl-modules
+# Depends: gdal-bin jq
set -eu
@@ -56,5 +56,5 @@ onlineosmxml2geojson() {
}
onlineosmxml2geojson $features \
- | json_pp -json_opt pretty,canonical \
- | perl -0 -pe 's/ /\t/g; s/},\s*{/}, {/g; s/\[\s*([\d.,]+)\s*([\d.]+)\s*\]/[$1 $2]/g'
+ | jq --tab --sort-keys . \
+ | perl -0 -pe 's/},\s*{/}, {/g; s/\[\s*([\d.,]+)\s*([\d.]+)\s*\]/[$1 $2]/g'