Friday, 6 April 2018

java - Get road type (clazz) in osm2po


Can I get clazz of a segment in Java? For example,


RoutingResultSegment rrs = graph.lookupSegment(path[j])

How can I get rrs's clazz?



Answer




rrs.getFlags()

returns a user defined 32 Bit Integer which contains the configured road type by default. You can override this beavior if needed. In order to save memory it always returns 0. To activate it open the graph with e.g.


Graph graph = new Graph(graphFile, new Log(), Graph.SUPPORT_EDGEFLAGS);

No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...