[FWTools] ogr2ogr

Ken Boss Ken.Boss at dnr.state.mn.us
Sun Aug 21 11:32:57 EDT 2005


David--

I'm just guessing here, but I suspect that you may need to specify your input reference system with -s_src, since georeferencing information is more often than not missing from shapefiles (if it's there, it's in the associated *.prj file).  Also, I think you need to use -t_srs as opposed to -a_srs for your output option, since you're wanting to transform to that srs, rather than simply assign it as a metadata item.

HTH,

--Ken

>>> David Fawcett <david.fawcett at gmail.com> 08/21/05 1:40 AM >>>
I am using org2ogr on linux (fc3).  I am attempting to reproject a
shapefile that is in lat/long to UTM Zone 15.

Here is my syntax:  [root at localhost data]# ogr2ogr sail_trk.shp -a_srs
EPSG:26915

I get this response indicating that my syntax is either wrong or that
it doesn't recognize my epsg code:

Usage: ogr2ogr [-skipfailures] [-append] [-update] [-f format_name]
               [-select field_list] [-where restricted_where]
               [-sql <sql statement>]
               [-spat xmin ymin xmax ymax] [-preserve_fid] [-fid FID]
               [-a_srs srs_def] [-t_srs srs_def] [-s_srs srs_def]
               [[-dsco NAME=VALUE] ...] dst_datasource_name
               src_datasource_name
               [-lco NAME=VALUE] [-nln name] [-nlt type] layer [layer ...]]

 -f format_name: output file format name, possible values are:
     -f "ESRI Shapefile"
     -f "TIGER"
     -f "S57"
     -f "MapInfo File"
     -f "DGN"
     -f "Memory"
     -f "CSV"
     -f "GML"
     -f "Interlis 1"
     -f "Interlis 2"
     -f "SQLite"
     -f "PostgreSQL"
 -append: Append to existing layer instead of creating new
 -update: Open existing output datasource in update mode
 -select field_list: Comma-delimited list of fields from input layer to
                     copy to the new layer (defaults to all)
 -where restricted_where: Attribute query (like SQL WHERE)
 -sql statement: Execute given SQL statement and save result.
 -skipfailures: skip features or layers that fail to convert
 -spat xmin ymin xmax ymax: spatial query extents
 -dsco NAME=VALUE: Dataset creation option (format specific)
 -lco  NAME=VALUE: Layer creation option (format specific)
 -nln name: Assign an alternate name to the new layer
 -nlt type: Force a geometry type for new layer.  One of NONE, GEOMETRY,
      POINT, LINESTRING, POLYGON, GEOMETRYCOLLECTION, MULTIPOINT, MULTILINE,
      MULTIPOLYGON, or MULTILINESTRING.  Add "25D" for 3D layers.
      Default is type of source layer.
 -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

 Srs_def can be a full WKT definition (hard to escape properly),
 or a well known definition (ie. EPSG:4326) or a file with a WKT
 definition.

Any ideas on what I am doing wrong?  

David.

_______________________________________________
FWTools mailing list
FWTools at lists.maptools.org
http://lists.maptools.org/mailman/listinfo/fwtools
http://fwtools.maptools.org/




More information about the FWTools mailing list