[postgis-users] Getting a NOTICE into a query output

Paragon Corporation lr at pcorp.us
Mon May 4 19:34:45 PDT 2009


Ben,
There is a function available in PostGIS 1.4 called ST_IsValidReason() which
does what you want.  Its in trunk and requires GEOS 3.1.0.  Unfortunately
this does not exist in PostGIS 1.3 and also requires GEOS 3.1 and above.
 
Hope that helps,
Regin
 
 

  _____  

From: postgis-users-bounces at postgis.refractions.net
[mailto:postgis-users-bounces at postgis.refractions.net] On Behalf Of Ben
Madin
Sent: Monday, May 04, 2009 10:03 PM
To: postgis-users at postgis.refractions.net
Subject: [postgis-users] Getting a NOTICE into a query output


G'day all, 

I have some bad geometries (Self-intersections) that I need to fix:

when I run :

australia=# select gid, tailtag, area_name, st_astext(st_centroid(the_geom))
as centroid from tailtagarea where st_isValid(the_geom) is false order by
st_centroid(the_geom);;

 to make myself a nice list to work with I get :

NOTICE:  Self-intersection at or near point 146.646 -41.1121
NOTICE:  Self-intersection at or near point 147.787 -42.288
NOTICE:  Self-intersection at or near point 115.999 -32.7807
NOTICE:  Self-intersection at or near point 136.002 -33.3412
NOTICE:  Self-intersection at or near point 151.385 -27.7379
NOTICE:  Self-intersection at or near point 142.163 -26.2079
NOTICE:  Self-intersection at or near point 151.385 -27.7379
NOTICE:  Self-intersection at or near point 142.163 -26.2079
NOTICE:  Self-intersection at or near point 115.999 -32.7807
NOTICE:  Self-intersection at or near point 130.528 -12.7086
NOTICE:  Self-intersection at or near point 115.556 -21.4113
NOTICE:  Self-intersection at or near point 113.653 -24.8917
NOTICE:  Self-intersection at or near point 115.142 -30.6844

then :



 gid | tailtag |    area_name    |                 centroid

-----+---------+-----------------+------------------------------------------
-
 276 | WCN     | Carnarvon       | POINT(114.382000002796 -24.3219058101861)
 291 | WDN     | Dandaragan      | POINT(115.504407697781 -30.5410130360183)
 380 | WWA     | Waroona         | POINT(115.91620760142 -32.8588263644047)
 343 | WMY     | Murray          | POINT(115.966965752586 -32.6237045619179)
 362 | WRO     | Roebourne       | POINT(117.03170469097 -21.0526004441269)
  60 | TDG     | Darwin And Gulf | POINT(133.897365573887 -14.2140172548334)
 247 | S71     | S71             | POINT(136.913166015303 -32.9332738397356)
  70 | QBC     | Barcoo          | POINT(142.269579925576 -25.1377197205728)
 170 | QQP     | Quilpie         | POINT(143.889867295296 -26.354593975264)
 498 | MLA     | Latrobe         | POINT(146.544098538635 -41.2417387155427)
 510 | MRS     | Ross            | POINT(147.556140609695 -42.1118612308958)
 147 | QMM     | Millmerran      | POINT(151.11832129932 -27.8551116855016)
 169 | QPW     | Pittsworth      | POINT(151.538916320118 -27.7014266930915)
(13 rows)



It would be excellent if I could get the Notice to display in the query
results, so I could print it out and work with it to quickly locate the
problems (in QGIS)

... so can I do that? or am I best to just copy and paste the notices

Unfortunately as I write this "Safari could not open the page
"http://postgis.refractions.net/documentation/" because the server is not
responding."

cheers

Ben



-- 

Ben Madin
REMOTE INFORMATION

t : +61 8 9192 5455
f : +61 8 9192 5535
m : 0448 887 220
Broome   WA   6725

ben at remoteinformation.com.au



Out here, it pays to know...


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090504/b518f85e/attachment.html>


More information about the postgis-users mailing list