[postgis-users] How to populate a column with results of isvalid
Obe, Regina
robe.dnd at cityofboston.gov
Wed Dec 31 07:54:47 PST 2008
You wouldn't use that for tagging. That is used if you want to prevent
people from adding invalid geometries into your table. If you have
already got invalid geometries it will just fail since you have already
violated the rule you are trying to establish.
To add a field
ALTER TABLE mytable ADD COLUMN the_geom_is_valid boolean ;
UPDATE mytable SET the_geom_is_valid = ST_IsValid(the_geom); //will
update existing
Unfortunately you can't put in a default value that references another
column which I think you may be looking for if you want to continually
add new data and have that field automatically fill. For that you'll
need a (preferably BEFORE TRIGGER).
Hope that helps,
Regina
-----Original Message-----
From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of
Intengu Technologies
Sent: Wednesday, December 31, 2008 10:25 AM
To: PostGIS Users Discussion
Subject: [postgis-users] How to populate a column with results of
isvalid
I have loaded a polygon shapefile into postgis and would like to tag
each row with the results of st_isvalid in a new field. I found this
query in the postgis manual "ALTER TABLE mytable ADD CONSTRAINT
geometry_valid_check CHECK (isvalid((the_geom));" when I run the query
it picks an invalid geometry and stops
--
Sent from my mobile device
Sindile Bidla
_______________________________________________
postgis-users mailing list
postgis-users at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users
-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.
More information about the postgis-users
mailing list