Yes, it reads like the code was intended to remove duplicate points, but
wasn't fully implemented. Whether this was the actual intention for
normalize is lost in the mists of time, unfortunately. It's also possible
this code was simply copied and modified from other code which *did* remove
duplicates.
But the real question is: should normalize removed duplicate vertices? My
first reaction is yes - but the fact that this hasn't caused any apparent
problems so far makes me pause a bit. In JTS normalize was really intended
to make exact comparisons between geometries easier, and in particular in
unit tests where one geometry is read from WKT and one is the result of a
computation. In this case, there are rarely or never duplicate points in
the computed output, so it's not an issue if they aren't removed.
Perhaps I'll try making the change and see if anything breaks. Other
comments welcome.
On Mon, Sep 15, 2014 at 6:46 AM, Sandro Santilli <[email protected]> wrote:
> Reading the code for Polygon#normalize, it feels like duplicated
> coordinates wanted to be removed (due to variable naming):
>
> Coordinate[] uniqueCoordinates = new
> Coordinate[ring.getCoordinates().length - 1];
> System.arraycopy(ring.getCoordinates(), 0, uniqueCoordinates, 0,
> uniqueCoordinates.length);
>
> But the code doesn't really remove duplicated coordinates, does it ?
>
> --strk;
>
> () Free GIS & Flash consultant/developer
> /\ http://strk.keybit.net/services.html
>
> --
>
> what comes below this line is just spam, dont bother scrolling...
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> still here ?
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Jts-topo-suite-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jts-topo-suite-user