Hi im new to neo4j and trying to figure out how everything works atm
I importet a OSM file and now im working on a function which you can input a point in WGS84 format and a POI and then the function finds the shortest path to the POI.
So for finding the nearest Geometries to my WGS84 Point I use
Coordinate co = new Coordinate(12.9639158,56.070904);
List<SpatialDatabaseRecord> results2 = GeoPipeline
.startNearestNeighborLatLonSearch(layer, co, 1)
.toSpatialDatabaseRecordList();
but then my problems start because i don't really understand how the OSM file is built up
Is there a function so that i can get my POI Node by name? I get an index from the OSM file
SpatialDatabaseService spatialService = new SpatialDatabaseService(database);
Layer layer = spatialService.getLayer(osm);
LayerIndexReader spatialIndex = layer.getIndex();
Can I use it to search Nodes by properties?
And for finding the shortest Way between the points I found a dijkstra Algorithm
PathFinder<WeightedPath> finder = GraphAlgoFactory.dijkstra(
Traversal.expanderForTypes( ExampleTypes.MY_TYPE, Direction.BOTH ), "cost" );
WeightedPath path = finder.findSinglePath( nodeA, nodeB );
The question now is what are my RelationshipTypes??? I think it shoud be NEXT but how do I include this in the code? Do I have to create an Enum with NEXT???
Can someone give me some feedback if im on the right way and give me some help please?
Okay finally found out how to find Nodes by id :D not too difficult but i searched for a long time :D
Thank you