[postgis-users] check constraint for geometry column

strk strk at keybit.net
Fri Jun 4 07:04:05 PDT 2004


On Fri, Jun 04, 2004 at 09:57:11AM -0400, Robert W. Burgholzer wrote:
> Ahhh, thanks for the insight into my lack of insight into postgreSQL.
> 
> r.b.

Also beware that reprojection might be an irreversible process
so you'd better add a new geometry column to your table
with the target SRID and put transformed geometries there.
Eg:
	SELECT AddGeometryColumn('mytable', 'reprojected_geom',
		<newSRID>, <type>, <dimensions>);
	UPDATE mytable SET reprojected_geom = transform(the_geom, <newSRID>);

The constraint will help you being conformant to OpenGIS standards,
which require the geometry_columns to contain the type and srid for
the specific geometry of each spatial table. Removing the constraint
might open up discrepancies between what geometry_columns says and
what you can actually find in your table.

--strk;

> 
> At 03:45 PM 6/4/2004 +0200, you wrote:
> >On Fri, Jun 04, 2004 at 09:39:39AM -0400, Robert W. Burgholzer wrote:
> >> List members,
> >> I am using postgis 0.8.0, so if this is resolved in tthe latest version,
> >> please forgive my ignorance.  I am exploring a transform on geom columns,
> >> and find, as have some others, that it is a torturous process to reassign
> >> your geometry column SRID, i.e., it can only be done by dropping and
> >> re-adding the table.
> >
> >Not true.
> >You can drop the constraint, re-assign the SRID
> >and then add the constraint again (or leave it out if you prefer).
> >
> >--strk;
> >
> >> I guess I would inquire as to the use of this constraint, is it truly
> >> necessary? Is it part of an openGIS specification, or just something used
> >> in the Postgis system as a check and balance? Does anyone have any 
> >feelings
> >> about whether or not a simple "Warning" rather than a constraint would be
> >> enough?
> >>
> >> I realize of course, that I should just get off my rump and import my
> >> tables with the proper SRID identified at the time of import, but just
> >> thought I would inquire, I have a lot of data that would have to be
> >> re-imported now that I am dealing with projections.
> >>
> >> Thanks for your thoughts,
> >>
> >> r.b.
> >>
> >>
> >> Robert Burgholzer
> >> Environmental Engineer
> >> MapTech Inc.
> >> http://www.maptech-inc.com/
> >>
> >> _______________________________________________
> >> postgis-users mailing list
> >> postgis-users at postgis.refractions.net
> >> http://postgis.refractions.net/mailman/listinfo/postgis-users
> >_______________________________________________
> >postgis-users mailing list
> >postgis-users at postgis.refractions.net
> >http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> Robert Burgholzer
> Environmental Engineer
> MapTech Inc.
> http://www.maptech-inc.com/ 
> 
> _______________________________________________
> 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