Hello,

I've been trying to read and generate a graph from a shape file, with some
troubles though because linestrings intersections are not recognized so i
had to manually process the data. The way i am doing it now is a bit
complicated and it takes more than one minute to provide results because
its a union of 2 geometries with plenty elements..
Do you happen to know a faster method that could help me ?
Here is a part of the code that unifies the geometries of the lines and
points based on which i am creating

    List<LineString> lines =  polys2lines(networkFC);

    GeometryFactory geomFactory = new GeometryFactory();

    Geometry grandMls = geomFactory.buildGeometry(lines);
    Point mlsPt = geomFactory.createPoint(grandMls.getCoordinate());
    Geometry nodedLines = grandMls.union(mlsPt);

    lines.clear();

    for (int k = 0, n = nodedLines.getNumGeometries(); k < n; k++) {
        Geometry g = nodedLines.getGeometryN(k);
        if (g instanceof LineString) {
            lines.add((LineString)g);
         }
    }
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to