# Geometry :

Subject: [ggl] Snapping
From: Mateusz Loskot (mateusz)
Date: 2009-12-03 19:24:20

Stephen Leary wrote:
> On Tue, Dec 1, 2009 at 7:05 PM, Mateusz Loskot <mateusz_at_[hidden]>
> wrote:
>> Stephen Leary wrote:
>>
>> On Tue, Dec 1, 2009 at 9:34 AM, Barend Gehrels wrote:
>>>> 3) I don't understand this: "Line to Vertex (LV). It is rare to
>>>> want to do this. But occasionally this is the right answer when
>>>> a Vertex has a higher positional accuracy.", what do you mean
>>>> by higher positional accuracy? You mean that the vertex is more
>>>> precise, that you know that before, and therefore want to snap
>>>> the line to that? So there probably must be a parameter (or
>>>> more) to influence the behaviour of the algorithm?
>>>
>>> Imagine i have people out capturing data. One captures a point
>>> where he thinks it is on a map, the other captures the point
>>> using GPS. The capture method will generally get stored with the
>>> data in a database and the positional accuracy will be estimated.
>>> Some points are never allowed to move so the algorithms have to
>>> be able to snap lines to points as well as points to lines.
>>
>> Let's say I'm developing UML drawing software, with SVG as data
>> format and GGL for geometry. I want to have configurable snapping.
>> What would be the positional accuracy?
>
> There wouldnt be positional accuracy. You would simply make a choice
> on which object would snap to which. In UML you are unlikely to need
> to correct the same kind of errors that GIS needs. You would probably
> not need L-L snapping at all.

Yes, good point.

> Let me be clear. The algorithm will not take a positional accuracy
> parameter but it may be that you decide to do that kind of snap
> because a decision is made in your own application.

Yes, it's clearer now and makes sense to me.

>> IOW, I'd suggest to increase the altitude of this analysis to more
>> generic level, than the domain-specific about GIS. Or we are
>> talking about extensions::gis::snap, then I'm fine & well with what
>> Stephen is proposing.
>
> For non-GIS needs V-V and L-V are sufficient for 99.999% of snapping.

OK, the point taken.

>> I think there is a confusion here. Both, exterior ring and interior
>> ring, according to OGC, define polygon boundaries. Given that,
>> snapping works as "snap-to-boundary", thus it does not matter if
>> point is snapped to vertex/segment of exterior ring or interior
>> ring, in both cases it's snapped to polygon boundary and never
>> crosses polygon interior.
>>
>> Correct me if I'm wrong.
>
> Again its a usage thing. You may not want to snap a polygon to
> another polygon's interior and exterior rings at the same time (or
> maybe you do).
>
> Lots of things to think about anyway.

Yes, understood, though it does not answer my question if it is correct
to consider snapping as "snap-to-boundary" only and never intersects
interior, polygon interior [1]
Not interior ring, or as it is sometimes called internal or inter ring,
but polygon interior.

[1] 4.2.6.1. Theory
http://postgis.org/documentation/manual-svn/ch04.html#DE-9IM

Best regards,

```--
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
```

Geometry list run by mateusz at loskot.net