[GraphHopper] How to find all the roads leading around a point

Jan Soelter jan.soelter at graphhopper.com
Tue Mar 3 08:20:41 UTC 2015


Hi g,

high level API:

GraphHopper hopper = new GraphHopper();
hopper.forDesktop();
hopper.setOSMFile("path/to/file.osm");
hopper.setGraphHopperLocation("xxx");
hopper.setEncodingManager(new EncodingManager("car"));
hopper.importOrLoad();

or more low level:

FlagEncoder carEncoder = new CarFlagEncoder();
EncodingManager encodingManager = new EncodingManager(carEncoder);
GHDirectory dir = new GHDirectory("dir/for/graph", DAType.RAM);
graph = new GraphHopperStorage(dir, encodingManager, false);
OSMReader osmReader = new OSMReader(graph);
osmReader.setOSMFile(new File(osmFile));
osmReader.setEncodingManager(encodingManager);
osmReader.setWayPointMaxDistance(1);
try {osmReader.readGraph();}
catch (IOException e) {e.printStackTrace();}



Am 03.03.2015 um 07:39 schrieb Gp P:
> Hi dos ,
>
> Thanks for your quick response , I went through the documentation ...I am
> using OSM data ...any idea how do i load it into graph
>
>
> Thanks ,
> G
>
> On Fri, Feb 13, 2015 at 11:03 AM, dos65 <qtankle at gmail.com> wrote:
>
>>  It possible, you should use low level api.
>> 1) create graph
>> 2) find closestNode by your lat, lon
>> 3) create edgeExplorer from graph, edge iterator and iterating by them in
>> your distance limit
>>
>> Look to docs/core/low-level-api.md and any routing algorithm's sources.
>>
>> 13.02.2015 04:38, Gp P пишет:
>>
>> Hi List ,
>>
>>  I am bit new to Graphhopper , was earlier using lucene + sptial4j , but
>> doesn't seem relevant to my problems below
>>
>>  My requirment is pretty simple (hopefully with grashopper as its graph
>> based)
>>
>>    1. I want to find list all roads (connecting to or leading) from a
>>    point  on the road within 2 km
>>     2. Exact Points/Coordinates  on all connecting roads after 2 km from
>>    give point on the road
>>
>> Is it possible with grasshopper ? I have use java or low level api as I
>> will using it embedded with java program
>>
>>  I tried to find to documentation regarding it but days of googling did
>> find the relevant info , also trying look at github code but i guess its
>> pretty much for a new guy
>>
>>
>>  Thanks ,
>> G
>>
>>
>>  --
>>
>> B*e * the *Ch*ange
>>
>>
>> _______________________________________________
>> GraphHopper mailing listGraphHopper at openstreetmap.orghttps://lists.openstreetmap.org/listinfo/graphhopper
>>
>>
>>
>> _______________________________________________
>> GraphHopper mailing list
>> GraphHopper at openstreetmap.org
>> https://lists.openstreetmap.org/listinfo/graphhopper
>>
>>
>
>
>
> _______________________________________________
> GraphHopper mailing list
> GraphHopper at openstreetmap.org
> https://lists.openstreetmap.org/listinfo/graphhopper

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/graphhopper/attachments/20150303/0fe0306e/attachment.html>


More information about the GraphHopper mailing list