Package org.neo4j.gis.spatial.osm.OSMDataset

Examples of org.neo4j.gis.spatial.osm.OSMDataset.Way


    HashMap<Long, Integer> waysFound = new HashMap<Long, Integer>();
    long mostCommon = 0;
    int mostCount = 0;
    OSMDataset osm = (OSMDataset) layer.getDataset();
    Node wayNode = osm.getAllWayNodes().iterator().next();
    Way way = osm.getWayFrom(wayNode);
    System.out.println("Got first way " + way);
    for (WayPoint n : way.getWayPoints()) {
      Way w = n.getWay();
      Long wayId = w.getNode().getId();
      if (!waysFound.containsKey(wayId)) {
        waysFound.put(wayId, 0);
      }
      waysFound.put(wayId, waysFound.get(wayId) + 1);
      if (waysFound.get(wayId) > mostCount) {
View Full Code Here


        }
    }

    public static void checkOSMSearch(OSMLayer layer) throws IOException {
        OSMDataset osm = (OSMDataset) layer.getDataset();
        Way way = null;
        int count = 0;
        for (Way wayNode : osm.getWays()) {
            way = wayNode;
            if (count++ > 100)
                break;
        }
        assertNotNull("Should be at least one way", way);
        Envelope bbox = way.getEnvelope();
        runSearches(layer, bbox, true);
        org.neo4j.gis.spatial.rtree.Envelope layerBBox = layer.getIndex().getBoundingBox();
        double[] centre = layerBBox.centre();
        double width = layerBBox.getWidth() / 100.0;
        double height = layerBBox.getHeight() / 100.0;
View Full Code Here

TOP

Related Classes of org.neo4j.gis.spatial.osm.OSMDataset.Way

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.