bstrdn
#1
Please, tell me how to skip unnecessary tags when loading an OSM file?
GraphHopper hopper = new GraphHopper();
hopper.setOSMFile(ghLoc);
hopper.setGraphHopperLocation("target/routing-graph-cache");
hopper.setProfiles(new Profile("car").setVehicle("car").setWeighting("fastest").setTurnCosts(false));
hopper.getCHPreparationHandler().setCHProfiles(new CHProfile("car"));
hopper.importOrLoad();
return hopper;
The OSM file is read once and converted into a custom data (“routing graph”) and only data necessary for the routing is stored.
bstrdn
#3
Okay, I understand. What should I do if I only need one tag ‘railway=rail’ when loading the OSM data?
easbar
#4
You mean you only want to keep OSM ways that are tagged as railway=rail
? Which OSM ways are kept during the import is defined by this function: graphhopper/OSMReader.java at 78fe44aa758e9847ef95f71d18ffa70d125a14a3 · graphhopper/graphhopper · GitHub