[Gvsig_english] thiessen code

Alvaro Zabala azabala at gmail.com
Thu Sep 27 17:37:07 CEST 2007


See the org.openjump.core.graph.DTriangulationForJTS.java file, from
OpenJUMP.

It has a routine to get Voronoy polygons from Delaunay Triangles.

This is the main method for your requirements:

 /**
     * Draw all the Voronoi edges.
     * @return Arraylist with LineString geometries.
     */
    public ArrayList drawAllVoronoi () {
        GeometryFactory gf = new GeometryFactory();
        ArrayList lines = new ArrayList();
        // Loop through all the edges of the DT (each is done twice)
        for (Iterator it = dt.iterator(); it.hasNext();) {
            Simplex triangle = (Simplex) it.next();
            for (Iterator otherIt = dt.neighbors(triangle).iterator();
otherIt.hasNext();) {
                Simplex other = (Simplex) otherIt.next();
                Pnt p = Pnt.circumcenter((Pnt[]) triangle.toArray(new
Pnt[0]));
                Pnt q = Pnt.circumcenter((Pnt[]) other.toArray(new Pnt[0]));
                Coordinate[] coords = new Coordinate[2];
                coords[0] = new Coordinate(p.coord(0), p.coord(1));
                coords[1] = new Coordinate(q.coord(0), q.coord(1));
                LineString ls = gf.createLineString(coords);
                lines.add(ls);
            }
        }
        return lines;
    }






Best regards.





2007/9/27, Francisco José Peñarrubia <fpenarru at gmail.com>:
>
> Hola Mike.
>
> In this web maybe you can find a lot of information:
>
> http://voronoi.com/
>
> Voronoi Diagram == Thiessen polygons (I think)
>
> You can find also some interesting code from Politécnica de Madrid:
>
>
> http://www.dma.fi.upm.es/mabellanas/voronoi/voronoi-fuente/voronoi-fuente.html
>
> and even watch it running:
>
>
> http://www.dma.fi.upm.es/docencia/trabajosfindecarrera/programas/geometriacomputacional/Fortune/voronoi-jar.html
>
> http://www.dma.fi.upm.es/mabellanas/voronoi/inicio/
>
> and maybe you'll like this one:
>
> http://oddlabs.com/procedurality.php
>
> (GPL license)
>
> Have fun!!
>
> Fran.
>
>
> michael gould escribió:
> > A bit off-topic:  we are looking for Thiessen polygon code, preferably
> Java.
> > Thanks for any hints.
> >
> > -------
> > Michael Gould
> > Centro de Visualización Interactiva  www.cevi.uji.es
> > Dept. Information Systems (LSI), Universitat Jaume I, 12071 Castellón,
> Spain
> > email: gould (at) lsi.uji.es  //  email2: mgould (at) opengeospatial.org
> > research group  www.geoinfo.uji.es  //  personal  www.mgould.com
> > AGILE www.agile-online.org
> > Vespucci Summer Institute www.vespucci.org
> > Erasmus Mundus: Master in Geospatial Technologies www.mastergeotech.info
> >
> >
> >
> >
> >
> >
> >
> > -----Original Message-----
> > From: gvsig_internacional-bounces at runas.cap.gva.es
> > [mailto:gvsig_internacional-bounces at runas.cap.gva.es] On Behalf Of Enzo
> Viti
> > Sent: jueves, 27 de septiembre de 2007 9:50
> > To: Users and Developers mailing list
> > Subject: Re: [Gvsig_english] Problems using gvSIG with GeoNetwork
> >
> > Thank you Jorge for your info; I used the z39.50 protocol and it works.
> > Best regards
> > Vincenzo Viti
> >
> > ----- Original Message -----
> > From: "Jorge Piera" <jorge.piera at iver.es>
> > To: "Users and Developers mailing list"
> > <gvsig_internacional at runas.cap.gva.es>
> > Sent: Wednesday, September 26, 2007 11:46 AM
> > Subject: Re: [Gvsig_english] Problems using gvSIG with GeoNetwork
> >
> >
> > Hi Vincenzo.
> >
> > We have detected some problems connecting with Geonetwork using the CSW
> > protocol and we are fixing it at this moment. If you want, you can use
> > the z39.50 protocol to retrieve the metadata.
> >
> > Regards.
> >
> > Enzo Viti wrote:
> >
> >> Hi All,
> >> Has anyone tried to use gvSIG (ver 1.1) as a CSW client for Geonetwork
> >> 2.1.0 ?
> >> The connection between client and server seems to be ok, but when I
> >> try to visualize metadata from Geonetwork, I get the following error:
> >> "Error with the getRecords operation".
> >> I am a new Geonetwork user and I would appreciate any help.
> >> Thanks
> >>
> >> Vincenzo Viti
> >>
> >> Lucana Sistemi srl
> >> Via Cicerone,13 - 75100 Matera (MT) Italy
> >> Tel +39 0835 381935 Pbx - Fax +39 0835 381937
> >>
> >> Web : www.lucanasistemi.com
> >> enzo.viti at lucanasistemi.com
> >>
> ------------------------------------------------------------------------
> >>
> >> _______________________________________________
> >> Gvsig_internacional mailing list
> >> Gvsig_internacional at runas.cap.gva.es
> >> http://runas.cap.gva.es/mailman/listinfo/gvsig_internacional
> >>
> >>
> >
> >
> >
> _______________________________________________
> Gvsig_internacional mailing list
> Gvsig_internacional at runas.cap.gva.es
> http://runas.cap.gva.es/mailman/listinfo/gvsig_internacional
>



-- 
Alvaro Zabala Ordóñez
Tlf: 657235082
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://runas.cap.gva.es/pipermail/gvsig_internacional/attachments/20070927/b5c63242/attachment-0001.htm


More information about the Gvsig_internacional mailing list