[postgis-users] parametrized domains (was: SRID Confusion)

strk at refractions.net strk at refractions.net
Fri Apr 29 09:58:30 PDT 2005


On Fri, Apr 29, 2005 at 12:23:25PM -0400, Abe Gillespie wrote:
> You can set the SRID for an entire table and for an individual
> geometry.  This confuses me.  What happens when given A a geometry
> table and B a geometry in A.  And A has SRID X and B has SRID Y.  Does
> one override the other, is this not allowed?
> 
> Is there anywhere in the docs I can read up on this?

Table-level SRID is a convenience only layout. You can live
w/out. But clients, like mapserver, will use that information
to find out the projection of your table data, and will
transform the user/gui defined BOX in your table data coordinate
system. This is performed by the find_srid() function.

If we drop support for table-level SRID definition clients will
need other ways to find out. A brute force approach would be
getting a list of distinct SRID(geom) from table, which is
a pretty expensive task.

Another approach would be looking at constraints, but you could
do w/out constraints.

The most elegant solution would be to specify that at table
creation time. Something you already use with 'varchar' - for
example:

	CREATE TABLE test ( a varchar(10); )

	CREATE TABLE test ( geom geometry(4326); )

We asked Tom Lane about this, but he saied the parser were
not ready for this kind of extensibility. I cc him so if
he have news will let us know.

The obvious consequence of this is that postgis would then
provide domains for geometry types and eventually use more
the 'parametrized' type approach to specify dimensions:

	CREATE TABLE test (
		OGCPolygon(3, 4326);
		OGCPolygonM(3, 4326);
		OGCPoint(4); // SRID=-1
	)

If this will be possible, there'll be some system catalogue
storing SRID and dimensions of any geometry column in the
database, and the geometry_columns could be a simple view
on that.

Note that in that case we won't need setting constraints,
as them would be implicit in the domain.

--strk;


> 
> Thanks.
> -Abe
> _______________________________________________
> 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