bash shell scripts for batch geoprocessing spatial data using OGR2OGR
Install FWTools (I used the Linux 64-bit version which is here.
Make sure ogr2ogr is working in command line with basic command: ogr2ogr
I suppose you could just add the shell_scripts directory to your PATH
, but I just run the commands with the full file path.
These resources have helped me a lot in building the ogr2ogr
batch commands:
- Directory of Spatial Reference Systems (SRS)
- FYI, GitHub currently likes (i.e., requires)
urn:ogc:def:crs:OGC:1.3:CRS84
for displaying geoJSON.
- FYI, GitHub currently likes (i.e., requires)
- List of OGR-supported Vector Formats...so many options!
- clip-extent-project.sh
- clip-raster-to-shp.sh
- clip-to-polygon.sh
- geojson-to-shp.sh
- get-extent.sh
- gpx-to-shp.sh
- grep-find-replace.sh
- merge.sh
- project-google.sh
- project-mercator.sh
- project-wgs84.sh
- rename-files-gis-friendly.sh
- separate-roads-by-type.sh
- separate-roads-by-type-skeletron.sh
This does xyz for abc.
.abc
./xxx_yyy.sh $ARGS
test
This does xyz for abc.
.abc
./xxx_yyy.sh $ARGS
test
This does xyz for abc.
.abc
./xxx_yyy.sh $ARGS
test
This script will export all .geojson files in a directory to .shp files in a specified subdirectory
.geojson
cd
to the directory of .geojson
files you want to convert
./$SCRIPTHOME/geojson-to-shp.sh
Writes new files to a data
subdirectory.
This does xyz for abc.
.shp
./get-extent.sh $DIR/$FILE
-84.391994 33.758135 -84.376599 33.754353
This does xyz for abc.
.abc
./xxx_yyy.sh $ARGS
test
This does xyz for abc.
.abc
./xxx_yyy.sh $ARGS
test
This does xyz for abc.
.abc
./xxx_yyy.sh $ARGS
test
This does xyz for abc.
.abc
./xxx_yyy.sh $ARGS
test
This does xyz for abc.
.abc
./xxx_yyy.sh $ARGS
test
This does xyz for abc.
.abc
./xxx_yyy.sh $ARGS
test
This does xyz for abc.
.abc
./xxx_yyy.sh $ARGS
test
This does xyz for abc.
.abc
./xxx_yyy.sh $ARGS
test
This does xyz for abc.
.abc
./xxx_yyy.sh $ARGS
test
This converts all shapefiles in a directory $DIR1
into geoJSON files in $DIR2
. If $DIR1
is not specified, the script looks in the present working directory. If $DIR2
is not specificied, the script will place the new geoJSON files in a new subdirectory called geojson
.
.shp
./shp-to-geojson.sh $DIR1 $DIR2
converting file: /data/bike_lanes.shp...