[Gdal-dev] Angular or linear coordinates for a shapefile

Frank Warmerdam warmerdam at pobox.com
Wed Sep 26 02:08:51 EDT 2007


On 9/25/07, Dan Homerick <danhomerick at gmail.com> wrote:
> Hello List,
>
> This probably something of a naive question -- please don't hesitate to
> point out what "should be obvious."
>
> I'm creating polygon-filled shapefiles using data extracted from a geotif.
> To do this, I'm using the OGRLinearRing::SetPoints() method and then adding
> the ring(s) to a polygon.
>
> My question is, what coordinate system should I be setting the points with?
> I want the resulting shapefile to still be georeferenced. The way I see it,
> I have 3 options, one of which is clearly wrong:
>
> 1. Pixel/Line coordinates from the image. (wrong)
> 2. Linear geo coords, resulting from GDALApplyGeoTransform.
> 3. Angular geo coords, resulting from something like:
>
> /**********************************************************/
> OGRSpatialReference* m_TargetSRS = m_SourceSRS.CloneGeogCS();
>
> m_LinearCoordToAngCoord =
> OGRCreateCoordinateTransformation(
>                                               &m_SourceSRS,
>                                               m_TargetSRS
> );
>
> m_LinearCoordToAngCoord->Transform(...)
> /**********************************************************/
> where m_SourceSRS is set from the GeoTiff.
>
> Will my shapefiles be properly georeferenced if I use the second method (and
> a .prj file is used)?

Dan,

Yes

>  Will the be properly georeferenced if I use the third (without a .prj
> file)?

They won't be *properly* georeferenced, but they could still
be considered georeferenced with an implicit coordinate system.
But the third method with a .prj containing the geographic
coordinate system would be properly georeferenced.

> Also, what's the correct names for the "linear geo coords" and "angular geo
> coords"?

"linear geo coords" = Project Coordinate System (PROJCS)
"angular geo coords" = Geographic Coordinate System (GEOGCS)

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the Gdal-dev mailing list