[geos-devel] Request for Eyeballs

Martin Davis mtnclimb at gmail.com
Sat Jul 25 07:12:08 PDT 2020


Good observations, Sandro.  My thoughts are below.

On Fri, Jul 24, 2020 at 8:01 AM Sandro Santilli <strk at kbt.io> wrote:

>
> The methods defined for a Noder are:
>
>   virtual void computeNodes(std::vector<SegmentString*>* segStrings) = 0;
>   virtual std::vector<SegmentString*>* getNodedSubstrings() const = 0;
>
> What isn't clear is:
>
>   - Who owns the SegmentString passed to computeNodes ?
>   - Who owns the SegmentString returned by getNodedSubstrings ?
>   - Can the same SegmentString be present in both input and output
>     containers ?
>

- Noders are a process, not a container.  As such, they should not own
anything.
-- The caller owns the NodedSegmentStrings passed in to the Noder.
-- The caller owns the SegmentStrings returned by getNodedSubstrings

- getNodedSubstrings should always return new SegmentStrings, even if they
are just a copy of an input SegmentString (i.e. no nodes were found and
added to the original NodedSegmentString (This will make it easier to
handle the lifecycle of the inputs and outputs I think?)

I'm not sure if JTS/GEOS obeys these semantics. In JTS it doesn't matter
much, but GEOS should be fixed to have this contract.

Furthermore:

The fact that getNodedSubstrings returns NodedSegmentStrings is an mistake
caused by an unfortunate shortcut in JTS a long time ago.  In fact, almost
all usage of getNodedSubstrings only requires a BasicSegmentString to be
returned (which is a much simpler/smaller object).  Paul & I have discussed
fixing this in JTS and GEOS, and will likely do so during or after the
delivery of OverlayNG.  Also, the name of the method is then confusing, and
will be changed as well (perhaps to getSubstrings or splitSubstrings or
some such)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geos-devel/attachments/20200725/ddcf91cf/attachment.html>


More information about the geos-devel mailing list