[Shapelib] Coordinate System?

Frank Warmerdam warmerdam at pobox.com
Mon Sep 29 22:11:00 PDT 2008


On Tue, Sep 30, 2008 at 12:09 AM, sagent100 <sagent100 at yahoo.com.ar> wrote:
>
> Hi,
>
> When I create a .shp file using shapelib, where we can indicate the
> coordinate system ?
> I want to create a file with lat/long wgs84 or UTM Zone 1 NAD 83  for
> example.
>
> Another question:
> When I open a .shp file using shapelib, how can I know the coordinate system
> the file has ?

sagen100,

The coordinate system will sometimes be found in an
associated .prj file (same base name as the .shp, .shx and .dbf).
If found it will be in ArcGIS "Projection Engine" format which is
similar to OGC Well Known Text for coordinate systems.

Shapelib does not have any code to manipulate the .prj files.

If you want to assign a particular coordinate system, it is best
for you to programmatically or manually create the .prj file
yourself.  Major ESRI products are shipped with a collection
of .prj files in the software distribution that you could use.  Or
you can create an ESRI compatible .prj file with OGR or
http://spatialreference.org.  For example:

http://spatialreference.org/ref/epsg/32737/esriwkt/

Much like styling, coordinate systems is considered
to be outside the scope of shapelib, though it is addressed
in the shapelib based OGR data access library.

  http://www.gdal.org/ogr

Good luck,

-- 
---------------------------------------+--------------------------------------
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 Shapelib mailing list