So far I’ve got a Java application to load in dependencies so that Graphhopper can route points using PBF file, calculate distance and time. This is built from GEOM points from national address databases.
I use JXMapviewer2 to paint the map background (offline and online) and currently it is drawing waypoints and lines between those points, but I’m really needing those lines to follow the road.
Can someone please point me in the right direction to either have JXMapviewer2 to paint to the road between points or another method to get this to work?
@karussell Hi Peter, hopefully a quick question.
I’ve added tools, ui, dependencies but get the following when running MiniGraphUI,java;
If no graph.location is provided you need to specify an OSM file.
at com.graphhopper.GraphHopper.init(GraphHopper.java:503)
at com.graphhopper.ui.MiniGraphUI.main(MiniGraphUI.java:383)
Where do I specify the pbf file to use and I’m presuming I declare from and to coords within
public MiniGraphUI(GraphHopper hopper, boolean debug) {
Things I’ve tried
I’ve looked within CHMeasurement.java and updated
String osmFile = cmdArgs.get(“map”, “C:/Program Files/ETL Data Load Processes/new-zealand-latest.osm.pbf”);
Within measurement.java
final String graphLocation = args.get(“graph.location”, “C:/Program Files/ETL Data Load Processes/new-zealand-latest.osm.pbf”);
*Measurement has nothing to do with painting things in swing UI.
Why not use the new MVT debug via instead of the MiniGraphUI? It will directly visualize roads in the browser and MiniGraphUI might be removed in later versions.