[Qgis-developer] Labels on topologically wrong polygons

Andrea Peri aperi2007 at gmail.com
Wed Jul 24 12:10:14 PDT 2013


2013/7/24 Larry Shaffer <larrys at dakotacarto.com>

> Hi,
>
> On Wed, Jul 24, 2013 at 11:04 AM, aperi2007 <aperi2007 at gmail.com> wrote:
>
>> On 24/07/2013 17:55, Larry Shaffer wrote:
>>
>>> I think QGIS should offer the option to on-the-fly try to fix those
>>> geometries. This was discussed previously [0]
>>>
>>
>> The MakeValid is not a fast process.
>> Try to apply it on-the-fly will slow again the labelling flow.
>>
>
> Yes, but only for those features that are tested to be invalid (already
> done). Also, as I noted, this should be optional, and probably disabled by
> default.
>
>
Agree.


>
>> Another problem is tht it could change little , but not less important,
>> part of a geometry.
>> so if the user will decide to edit it .
>> Instead of editing the original geometry it will edit a changed geometry.
>> And save in the shapefile (o r other container) another more changed
>> geometry.
>>
>
> The labeling engine sends to the backend PAL library *copies* of the
> feature geometries. So, the original geometry is never edited, i.e. the
> copy would be what is run through ST_MakeValid. Once the labels are
> created, those copied geometries are dumped and never rendered on the
> canvas.
>
> There should probably be some logging somewhere, if the geometry is
> invalid, but usually the copied geometry has been clipped to the extent
> rectangle. In other words, invalid geometries of the copies at that point
> have nothing to do with the original features, which may be valid. So,
> logging invalids at that point doesn't make sense.
>

ok, your idea is more sophisticated.



>
>>
>> Don't forgot that the original ST_MakeValid of postgis (and also
>> spatialite) will return also the
>> removed parts of original geometry. (point , arc or other it was)
>>
>
> This could be an issue, where a multi-geometry is return for a single
> input. It seems this could be overcome with some checks, and eventually
> fallback to rejecting the geometry, if necessary.
>
>
The MakeValid is capable to resolve very complex situations, the main goal
is never lost any vertex. So the MakeValid in the Postgs often could return
a geometrycollection with one, two or three parts (polygons, linea and
points).

As example when the invalidity is a line inside a polygon (this is quite
normal when the geometries came from cad systems), the MakeValid will
create a collection with the polygon and a line. In Spatialite instead the
collection are not so flexible so the solution was to wrap the MakeValid on
two distinct functions:
MakeValid() and MakeValidDiscarded.



> To not lost of view the original geometry.
>>
>
> Sorry. I don't understand your meaning here.
>
>
>
Sorry, I was unable to explain.

Simply I want say that the main goal of the MakeValid was to resolve an
invalidity withoun lost any vertex of the original geometry.

In spatialite where the collection are no so flexible.
The solution was to support two functions one to return the higher level
geometry (usually the more interesting to see) and another function
(MakeValidDiscarded) to return the lower level geometries.

But this mean that using only the ST_MakeValid() in spatialite without see
what return the MakeValidDiscarded Function could mean to lost something.

Regards,

Andrea.



> Regards,
>
> Larry
>
>
>
>> ______________________________**_________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/**mailman/listinfo/qgis-**developer<http://lists.osgeo.org/mailman/listinfo/qgis-developer>
>>
>
>


-- 
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20130724/940912ee/attachment.html>


More information about the Qgis-developer mailing list