Package org.geotools.graph.build.line

Examples of org.geotools.graph.build.line.BasicLineGraphGenerator


        // we have some line segments
        LineSegment[] lines = { ld1, ld2, ld3 };

        // create the graph generator
        BasicLineGraphGenerator graphGen = new BasicLineGraphGenerator();

        // add the lines to the graph
        for (int i = 0; i < lines.length; i++) {
            graphGen.add(lines[i]);
        }

        this.graph = graphGen.getGraph();

        System.out.println(graph);

    }
View Full Code Here


public class GraphExamples {
void graphExample() throws Exception {
    SimpleFeatureSource featureSource = null;
   
    // graphExample start
    final LineGraphGenerator generator = new BasicLineGraphGenerator();
    SimpleFeatureCollection fc = featureSource.getFeatures();
   
    fc.accepts(new FeatureVisitor() {
        public void visit(Feature feature) {
            generator.add(feature);
        }
    }, null);
    Graph graph = generator.getGraph();
    // graphExample end
   
    // visitor example start
    class OrphanVisitor implements GraphVisitor {
        private int count = 0;
View Full Code Here

      built.getNodesOfDegree(2).size() == built.getNodes().size()
    );
  }
  
  protected BasicLineGraphGenerator createGenerator() {
    return(new BasicLineGraphGenerator());
  }
View Full Code Here

TOP

Related Classes of org.geotools.graph.build.line.BasicLineGraphGenerator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.