Obtain rings.

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

Obtain rings.

Aritz Dávila
Hi list,

I would like to know, if there is any way to do the next:
I got a list of Coordinates. Those coordinates form a closed lineString like
it is shown on Image1.png
I want to obtain the rings that are formed by this lineString (Image2.png). Is
there any way to get it, for example using PlanarGraph or other object?

Thx in advance,
--
Aritz Dávila
www.axios.es




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

Image1.png (1K) Download Attachment
Image2.png (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Obtain rings.

azabala
Hi Aritz,

you can check http://subversion.gvsig.org/gvSIG/trunk/libraries/libTopology/src/org/gvsig/jts/LineStringSelfIntersectionChecker.java

To do what you want, you must:

LIneStringSelfIntersectionChecker checker = new LineStringSelfIntersectionChecker(linestring, snapTolerance);

Geometry[] rings = checker.clean();


Best regards

2009/10/8 Aritz Dávila <[hidden email]>
Hi list,

I would like to know, if there is any way to do the next:
I got a list of Coordinates. Those coordinates form a closed lineString like
it is shown on Image1.png
I want to obtain the rings that are formed by this lineString (Image2.png). Is
there any way to get it, for example using PlanarGraph or other object?

Thx in advance,
--
Aritz Dávila
www.axios.es




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




--
Alvaro Zabala Ordóñez
azabala[en]gmail[punto]com
alvaro.zabala[en]juntadeandalucia[punto]es
Tlf: 954 995 572
Gabinete de Normalización y Calidad
Servicio de Coordinación y Desarrollo de Sistemas Horizontales.
D.G. de Innovación y Administraciones Públicas.
Consejería de Innovación, Ciencia y Empresa, Junta de Andalucía



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

Re: Obtain rings.

Martin Davis
In reply to this post by Aritz Dávila
One way to do this is:

- create a LineString from the Coordinates
- run union() on the LineString
- Polygonize the result (using Polygonizer)
- extract the shells from the resulting polygons

Aritz Dávila wrote:

> Hi list,
>
> I would like to know, if there is any way to do the next:
> I got a list of Coordinates. Those coordinates form a closed lineString like
> it is shown on Image1.png
> I want to obtain the rings that are formed by this lineString (Image2.png). Is
> there any way to get it, for example using PlanarGraph or other object?
>
>  
>

--
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
|

Re: Obtain rings.

Aritz Dávila
Thanks to both of you for the info.

Greetings,
--
Aritz Dávila
www.axios.es


On Thursday 08 October 2009 06:03:32 pm Martin Davis wrote:

> One way to do this is:
>
> - create a LineString from the Coordinates
> - run union() on the LineString
> - Polygonize the result (using Polygonizer)
> - extract the shells from the resulting polygons
>
> Aritz Dávila wrote:
> > Hi list,
> >
> > I would like to know, if there is any way to do the next:
> > I got a list of Coordinates. Those coordinates form a closed lineString
> > like it is shown on Image1.png
> > I want to obtain the rings that are formed by this lineString
> > (Image2.png). Is there any way to get it, for example using PlanarGraph
> > or other object?


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