Setting projection with ogr2ogr

P Kishor punkish at EIDESIS.ORG
Sat Jul 22 12:06:41 PDT 2006


I am running ogr2ogr (partially successfully now) like so --

ogr2ogr -f "ESRI Shapefile" -a_srs "$prj" . "foo.ovf" foo

which runs fine, and results in a shapefile feature class called "foo"
in about 25% of the time as via ArcGIS geoprocessing. But, the ogr
output has the following problems --

1. It doesn't project correctly; and
2. It continues to not recognize one of the fields in the in-coming
CSV file with lon/lat.

Regarding projection, I need to understand the difference between

-a_srs srs_def: Assign an output SRS
-t_srs srs_def: Reproject/transform to this SRS on output
-s_srs srs_def: Override source SRS

I am using -a_srs, and obviously either that is inappriate or not
enough. Am I supposed to use -t_srs?

Re. not recognizing the one of the fields, it actually may be a
problem with ODBC. The ODBC text driver thinks the problem field is
"currency" (the values in the field look like "S80"). If I try to set
field definitions in the ODBC driver settings, then ogrinfo croaks on
me, but it works just fine if I don't set any field definitions... of
course, in that case, ogr utilities also end up thinking that my "S80"
field is currency data. Is there a non-ODBC way to define a text data
source?

-- 
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.ies.wisc.edu/
Open Source Geospatial Foundation https://edu.osgeo.org/



More information about the MapServer-users mailing list