Quantcast

Polygonizer not symetric?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Polygonizer not symetric?

jdalecki

Hi,

I am surprised that the Polygonizer does not return Polygons in the same order every time I make a call to getPolygons method, although I am passing the same MultiLineString to the function add() – is this a feature or bug.

I am not sure whether this is correct forum for JTS questions.

Regards,

Janusz
 

_______________________________________________
jts-devel mailing list
[hidden email]
http://lists.refractions.net/mailman/listinfo/jts-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Polygonizer not symetric?

Martin Davis
Well, this was never a design constraint on the Polygonizer, so this is
neither a feature nor a bug. It is a bit surprising, however - I think
all the code in the Polygonizer is deterministic, so the output should
be identical for identical input.

If you want a consistent ordering you can always normalize the output
geometries and then sort them.

If you provide a test program exhibiting the behaviour I can try and see
what might be causing this behaviour.

Janusz Dalecki wrote:

>
> Hi,
>
> I am surprised that the Polygonizer does not return Polygons in the
> same order every time I make a call to getPolygons method, although I
> am passing the same MultiLineString to the function add() – is this a
> feature or bug.
>
> I am not sure whether this is correct forum for JTS questions.
>
> Regards,
>
> Janusz
> ------------------------------------------------------------------------
>
> _______________________________________________
> jts-devel mailing list
> [hidden email]
> http://lists.refractions.net/mailman/listinfo/jts-devel
>  

--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022

_______________________________________________
jts-devel mailing list
[hidden email]
http://lists.refractions.net/mailman/listinfo/jts-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Polygonizer not symetric?

jdalecki
Thanks Martin,
I have attached the test program and two results from two separate runs
of the program.
The output is different.
Thanks for your help.
Regards,
Janusz

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Martin
Davis
Sent: Friday, June 05, 2009 1:54 AM
To: JTS Topology Suite Development
Subject: Re: [jts-devel] Polygonizer not symetric?

Well, this was never a design constraint on the Polygonizer, so this is
neither a feature nor a bug. It is a bit surprising, however - I think
all the code in the Polygonizer is deterministic, so the output should
be identical for identical input.

If you want a consistent ordering you can always normalize the output
geometries and then sort them.

If you provide a test program exhibiting the behaviour I can try and see
what might be causing this behaviour.

Janusz Dalecki wrote:

>
> Hi,
>
> I am surprised that the Polygonizer does not return Polygons in the
> same order every time I make a call to getPolygons method, although I
> am passing the same MultiLineString to the function add() - is this a
> feature or bug.
>
> I am not sure whether this is correct forum for JTS questions.
>
> Regards,
>
> Janusz
> ----------------------------------------------------------------------
> --
>
> _______________________________________________
> jts-devel mailing list
> [hidden email]
> http://lists.refractions.net/mailman/listinfo/jts-devel
>  
--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022

_______________________________________________
jts-devel mailing list
[hidden email]
http://lists.refractions.net/mailman/listinfo/jts-devel

_______________________________________________
jts-devel mailing list
[hidden email]
http://lists.refractions.net/mailman/listinfo/jts-devel

PolygonizerTest.java (28K) Download Attachment
firstTestOutput.txt (28K) Download Attachment
secondTestOutput.txt (28K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Polygonizer not symetric?

jdalecki
In reply to this post by Martin Davis
Hi Martin,
Normalizing works fine - every time it generates exactly same output
(from the same input).
Thanks,
Janusz

-----Original Message-----
From: [hidden email]
[mailto:[hidden email]] On Behalf Of Martin
Davis
Sent: Friday, June 05, 2009 1:54 AM
To: JTS Topology Suite Development
Subject: Re: [jts-devel] Polygonizer not symetric?

Well, this was never a design constraint on the Polygonizer, so this is
neither a feature nor a bug. It is a bit surprising, however - I think
all the code in the Polygonizer is deterministic, so the output should
be identical for identical input.

If you want a consistent ordering you can always normalize the output
geometries and then sort them.

If you provide a test program exhibiting the behaviour I can try and see
what might be causing this behaviour.

Janusz Dalecki wrote:

>
> Hi,
>
> I am surprised that the Polygonizer does not return Polygons in the
> same order every time I make a call to getPolygons method, although I
> am passing the same MultiLineString to the function add() - is this a
> feature or bug.
>
> I am not sure whether this is correct forum for JTS questions.
>
> Regards,
>
> Janusz
> ----------------------------------------------------------------------
> --
>
> _______________________________________________
> jts-devel mailing list
> [hidden email]
> http://lists.refractions.net/mailman/listinfo/jts-devel
>  

--
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022

_______________________________________________
jts-devel mailing list
[hidden email]
http://lists.refractions.net/mailman/listinfo/jts-devel
_______________________________________________
jts-devel mailing list
[hidden email]
http://lists.refractions.net/mailman/listinfo/jts-devel
Loading...