[GRASS-user] ogr2ogr help

José María Michia jose.maria.michia at gmail.com
Sun Jan 25 19:52:05 EST 2009


2009/1/25  <mtnbiketrail en zzz.com>:
> Hi,
> beginner user. First off, am disappointed with help files for syntax for
> ogr2ogr.
> I have a shp file( with .shx, and .dbf) and want to convert it to a
> different projection. When I run ogr2ogr from command line, it doesn't do
> anything, I tried to set the debug level for more verbose and there is not
> enough information to get debug to work. I assume debug is like verbose. I
> tried --debug [on], --debug 1. Just get back usage description.
>
> Here is the command I'm using:
> ogr2ogr -f "ESRI Shapefile" -t_srs EPSG:32610 myfile.shp mynewfile.shp
>
> it just returns the usage description help file. No errors, no way of
> knowing what is wrong. I looked online at gdal.org and it is almost
> worthless for help.
> p.s. I also have "Desktop GIS" by Gary Sherman and not all the book examples
> work(pg 188).thanks,
> Tom

Hi Tom. I think that you have an error syntax, at least. You must
write first the name of the destination shape file, and later the name
of the source shape file.

Try this:

ogr2ogr -f "ESRI Shapefile" -t_srs EPSG:32610  mynewfile.shp myfile.shp

Also, make sure that your source shape file, has a coordinate system
defined. You can verify this using ogrinfo:

ogrinfo -so myfile.shp myfile

If not, use the option "-s_srs" to assign one, like following:

ogr2ogr -f "ESRI Shapefile" -s_srs EPSG:4326 -t_srs EPSG:32610
mynewfile.shp myfile.shp

Change EPSG:4326 to the correct epsg code.

I hope that be useful.

Saludos
José María


More information about the grass-user mailing list