[postgis-users] beginner questions re. SRID

Paul Ramsey pramsey at refractions.net
Fri Oct 21 07:03:41 PDT 2005


On Oct 21, 2005, at 6:37 AM, Rick Schumeyer wrote:
> Is there a more human-readable table that contains the SRIDs and  
> descriptions?
More than spatial_ref_sys? Not really. The SRTEXT isn't completely  
*un*readable though.

>  Are the SRIDs always the same?  For example, SRID 2959 on my  
> system is UTM zone 18 with the GRS80 ellipse.  Is this always SRID  
> 2959 for everybody?

No. (And Yes!) No, because the spatial_ref_sys table is internal to  
your database, so the identifiers in the table (SRID) are internal to  
the database.  Yes, because the PostGIS spatial_ref_sys table uses an  
externally defined number from the European Petroleum Survey Group  
(EPSG) as the SRID.  Note that spatial_ref_sys has an AUTH_NAME and  
AUTH_SRID.  Aha.  These are the external authority and identifier.   
For PostGIS they are the same as the internal identifier.  For other  
systems, not necessarily so.  Clear as mud!

> The documentation includes this example:
> CREATE TABLE parks ( PARK_ID int4, PARK_NAME varchar(128),  
> PARK_DATE date, PARK_TYPE varchar(2) );SELECT AddGeometryColumn 
> ('parks', 'park_geom', 128, 'MULTIPOLYGON', 2 ); This column has an  
> SRID of 128?  Does this mean that only objects with SRID=128 can be  
> inserted in the column?  I thought you included an SRID when you  
> INSERT an object?

Yes! Confusing! But part of the standard.  The specification says  
that all geometries have an SRID.  It also says that the  
geometry_columns table contains a single SRID for each spatial column.

> How does postgis use the SRID internally?

Only really for the transform(geometry,id) function, which takes the  
SRID of the geometry as the input projection and converts to the  
output projection defined by the id.

> Can it properly compare an object with one SRID with an object with  
> a different SRID?

No, and most/many functions will error out if you try, because it is  
not really correct to compare geometries with different SRID (unless  
they happen to map to the same projection! ha!).

> Finally, if I have missed some documentation that explains this,  
> please point me in that direction!

If you have learned something from this post, please distill it into  
the wiki for others!


> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users

More information about the postgis-users mailing list