[postgis-users] User Friendly vs Explicit

Mike Leahy mgleahy at fes.uwaterloo.ca
Sat May 14 16:57:39 PDT 2005


Mark,

Normally the data that you have is already associated with a projection...the
only way to be sure what projection your data are in is to check any metadata
included with the data, or ask whoever created/gave you the data.  Even the data
are in lat/lon coordinates, there are different earth models that the
coordinates might be based on.  For example, you might have data in lat/lon
coordinates based on the WGS '84 datum.  The SRID for that would be 4326 (if I
recall correctly), and by associating the layer with the correct SRID, PostGIS,
or other programs using PostGIS, will be able to properly project the data,
and/or associate them with data in other layers that might have different
projections.

I believe that SetSRID() does not change the coordinates at all, but returns the
same geometry with the SRID reference number changed (e.g., SetSRID(geom,
4326)).  It is good practice to associate all your data with an SRID whenever
possible (i.e., when using shp2pgsql, or executing AddGeometryColumn()), so that
people/software won't have to guess later on, and so you won't need to use
SetSRID().  If you have an SRID associated with the geometry, you can perform
operations such as Transform(geom,srid), which reprojects the geometry to the
projection specified by srid.  This is useful, for example, to convert lat/lon
to UTM coordinates so that you can get spatial measurements in metres rather
than degrees...

I think one of the small challenges you have highlighted is the difficulty of
finding the correct SRID associated with the projection that your data are
already in.  I've been able to find the SRIDs for my data by searching through
the records in the spatial_ref_sys table.  However, that's not always easy,
especially if you're not familliar with projections.  Does anyone know an easy
or more user-friendly approach to lookup SRIDs for projections?  Perhaps there
is a reference table somewhere external to PostGIS...

Mike

Quoting Mark Fenbers <Mark.Fenbers at noaa.gov>:

> 
> 
> OK, well, reading through more documentation and online stuff, I
> learned of a spatial_ref_sys.sql file that wasn't run during
> installation.  So now I have the spatial_ref_sys table populated and
> now understand that SRID relates to different map projections.  But
> this brings up even more questions, like "How in the world
> (figuratively) will I be able to pick an SRID that's right for the work
> I am doing?"  And is the use of SetSRID() what actually reprojects my
> data?
> 
> 
> 
> Mark
> 





----------------------------------------
This mail sent through www.mywaterloo.ca



More information about the postgis-users mailing list