[gdal-dev] Convert DBX/SHP to JSON using ogr2ogr

Tobias Preuss tobias.preuss at googlemail.com
Sun Jun 3 09:32:48 PDT 2012


Hello. I am trying convert shape files [1] of London (Canada) into
JSON. I am totally new to these formats but at least I found out that
ogr2ogr is able to do the job. However, there are two files that
contain the data as far as I can tell. One file TREES.DBF contains all
the properties. The other file trees.shp holds the main objects (trees
in this case) with an identifier. I can convert each file into JSON
with the following commands.

$ ogr2ogr -f GeoJSON -s_srs EPSG:26917 -t_srs EPSG:4326
trees_coordinates.json trees.shp
$ ogr2ogr -f GeoJSON -s_srs EPSG:26917 TREES_properties.json TREES.DBF

I am not sure what the other files are good for?!
After the conversion, however, I end up with two files again. Is there
a way to combine both datasets - so each tree object will be matched
with its corresponding property information from the other file?

Note: I am not totally sure about the source SRS. If you can teach me,
how I can find out what the source SRS is from the files, I would very
much appreciate that!
Best regards, Tobias


_________
[1] http://www.london.ca/OpenData/ShapeFiles_Zipped/Tree_Inventory_Public.zip


More information about the gdal-dev mailing list