<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Matej Serc</b> <span dir="ltr"><<a href="mailto:mailing@tam.si">mailing@tam.si</a>></span><br>Date: 2011/7/22<br>
Subject: Re: [Qgis-user] Table with empty wkb_geometry<br>To: Andreas Neumann <<a href="mailto:a.neumann@carto.net">a.neumann@carto.net</a>><br><br><br>Hello Andreas, you were right! There are some self-intersections in those parcels that are not returned correctly in intersections query. <br>
<br>Is there any method to "correct" this issue as much automatically as possible?<br>
<br>Thanks,<br><font color="#888888">Matej</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">2011/7/21 Andreas Neumann <span dir="ltr"><<a href="mailto:a.neumann@carto.net" target="_blank">a.neumann@carto.net</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Matej,<br>
<br>
I would assume that the geometries are not empty to begin with. Some software (like pgadmin) does not show you a WKB geometry if the geometry is too big. But this does not mean that the geometry is empty.<br>
<br>
There are methods in Postgis to see if the geometry is empty:<br>
<a href="http://postgis.refractions.net/documentation/manual-1.5/ST_IsEmpty.html" target="_blank">http://postgis.refractions.<u></u>net/documentation/manual-1.5/<u></u>ST_IsEmpty.html</a><br>
<br>
SELECT gid FROM your_schema.your_table WHERE ST_IsEmpty(the_geom);<br>
<br>
There is also a method to see if a geometry is valid (contains errors):<br>
see <a href="http://postgis.refractions.net/documentation/manual-1.5/ST_IsValidReason.html" target="_blank">http://postgis.refractions.<u></u>net/documentation/manual-1.5/<u></u>ST_IsValidReason.html</a><br>
<br>
SELECT gid, ST_IsValidReason(the_geom) FROM your_schema.your_table WHERE ST_IsValid(the_geom) = FALSE;<br>
<br>
Often, data imported from Shapefiles, contains errors, such as self intersections, too few points, etc. - ST_IsValidReason() helps to find the geometries. If you use the node tool in QGIS while in an editing session, such errors are marked in green (no idea why they aren't marked in red - red would be the color for errors in my opinion).<br>


<br>
Hope this helps.<br>
<br>
Andreas<div><div></div><div><br>
<br>
On Thu, 21 Jul 2011 00:33:29 +0200, Matej Serc wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
this is just partially connected with QGIS, but since I experience<br>
some behaviour which I can't understand, I will ask here.<br>
<br>
We have some parcel data which were imported to PostGIS DB from SHP<br>
files. I have just found out that there is a small percentage of the<br>
rows that have wkb_geometry field empty, but the parcel is visible in<br>
the QGIS, so I can click on it and Identify results etc.<br>
<br>
Basically I started looking at it more deeply when using some<br>
intersection functions from PostGIS that did not list some parcels<br>
which should by no means be listed. Now after looking at the SELECT<br>
query output in the pgAdmin, I see empty field for such parcels.<br>
<br>
What bothers me, is: how can these parcels be visible in QGIS? I think<br>
that there was some problem when I was importing the data from SHP -<br>
but no errors were shown in ogr2ogr at that time. Did anyone already<br>
experienced something like this?<br>
<br>
Thank you very much for any ideas and pointers in advance :-)<br>
BR, Matej<br>
</blockquote>
<br></div></div>
-- <br>
--<br><font color="#888888">
Andreas Neumann<br>
Böschacherstrasse 10A<br>
8624 Grüt (Gossau ZH)<br>
Switzerland<br>
______________________________<u></u>_________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org" target="_blank">Qgis-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/qgis-user</a><br>
</font></blockquote></div><br>
</div></div></div><br>