Package com.graphhopper.routing.util
Class UrbanDensityCalculator
java.lang.Object
com.graphhopper.routing.util.UrbanDensityCalculator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
calcUrbanDensity
(Graph graph, EnumEncodedValue<UrbanDensity> urbanDensityEnc, EnumEncodedValue<RoadClass> roadClassEnc, BooleanEncodedValue roadClassLinkEnc, double residentialAreaRadius, double residentialAreaSensitivity, double cityAreaRadius, double cityAreaSensitivity, int threads) Calculates the urban density (rural/residential/city) for all edges of the graph.
-
Constructor Details
-
UrbanDensityCalculator
public UrbanDensityCalculator()
-
-
Method Details
-
calcUrbanDensity
public static void calcUrbanDensity(Graph graph, EnumEncodedValue<UrbanDensity> urbanDensityEnc, EnumEncodedValue<RoadClass> roadClassEnc, BooleanEncodedValue roadClassLinkEnc, double residentialAreaRadius, double residentialAreaSensitivity, double cityAreaRadius, double cityAreaSensitivity, int threads) Calculates the urban density (rural/residential/city) for all edges of the graph. First a weighted road density is calculated for every edge to determine whether it belongs to a residential area. In a second step very dense residential areas are classified as 'city'.- Parameters:
residentialAreaRadius
- radius used for residential area calculation in metersresidentialAreaSensitivity
- Use higher values if there are too many residential areas that are not recognized. Use smaller values if there are too many non-residential areas that are classified as residential.cityAreaRadius
- in meters, see residentialAreaRadiuscityAreaSensitivity
- similar to residentialAreaSensitivity, but for the city classificationthreads
- number of threads used to calculate the road densities
-