[Gdal-dev] projection with ogr2ogr

Lijian Shi lijian.shi at und.nodak.edu
Tue Mar 6 16:36:20 EST 2007


Mateusz,

Thank you for your response! 

Except WGS84 with epsg 4326, I also want to add the projection information:

PROJCS[" Projection Name = Lambert Azimuthal Equal-ar",
......
PROJECTION["Lambert_Azimuthal_Equal_Area"],
PARAMETER["latitude_of_center",45],
PARAMETER["longitude_of_center",-100],
PARAMETER["false_easting",0],
PARAMETER["false_northing",0],
UNIT["metre",1,
AUTHORITY["EPSG","9001"]]]

So I tried the command: ogr2ogr -a_srs EPSG:4326 -t_srs "+proj=laea" out.shp
point.shp

And then I get the "header" of shp file as followed:
PROJCS["Lambert_Azimuthal_Equal_Area",
    GEOGCS["GCS_WGS_1984",
        DATUM["unknown",
            SPHEROID["WGS84",6378137,298.257223563]],
        PRIMEM["Greenwich",0],
        UNIT["Degree",0.017453292519943295]],
    PROJECTION["Lambert_Azimuthal_Equal_Area"],
    PARAMETER["latitude_of_center",0],
    PARAMETER["longitude_of_center",0],
    PARAMETER["false_easting",0],
    PARAMETER["false_northing",0],
    UNIT["Meter",1]]

But there are still some difference between the "header" of shp file and
geotiff file. I don't know whether my result is right. So look forward to
your suggestion.

Lijian



-----Original Message-----
From: Mateusz Loskot [mailto:mateusz at loskot.net] 
Sent: Tuesday, March 06, 2007 10:55 AM
To: Lijian Shi
Cc: gdal-dev at lists.maptools.org
Subject: Re: [Gdal-dev] projection with ogr2ogr

Lijian Shi wrote:
> Now I want to use ogr2ogr to project the shp file in order that the
> shp file has the same geoinformation(same projection, same datum)
> with the geotiff file. I use the command like:
> 
> ogr2ogr -s_srs WGS84 -t_srs EPSG:code utm2.shp point.shp

Lijian,

If I understand you correctly, you have georeferenced GeoTIFF and
you have a Shapefile *without* any referencing.
Now, you have read SRS details from GeoTIFF - it is WGS84 with
EPSG code 4326 - and you want to *assign* the same
one to your Shapefile.

If that's what you want to do, then the command should look as follows:

ogr2ogr -a_srs EPSG:4326 out.shp point.shp

where -a_srs means you want to *assign* SRS to output Shapefile (out.shp).


> Am I right? If right, how can I get the code?

Here is the code, in the GeoTIFF details:

AUTHORITY["EPSG","4326"]],

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net




More information about the Gdal-dev mailing list