@@ -112,7 +112,7 @@ public class GraphHopper {
112
112
private double residentialAreaSensitivity = 60 ;
113
113
private double cityAreaRadius = 2000 ;
114
114
private double cityAreaSensitivity = 30 ;
115
- private int developmentCalculationThreads = 0 ;
115
+ private int urbanDensityCalculationThreads = 0 ;
116
116
117
117
// preparation handlers
118
118
private final LMPreparationHandler lmPreparationHandler = new LMPreparationHandler ();
@@ -195,7 +195,7 @@ public GraphHopper setMinNetworkSize(int minNetworkSize) {
195
195
}
196
196
197
197
/**
198
- * Configures the development classification. Each edge will be classified as 'rural','residential' or 'city', {@link Development }
198
+ * Configures the urban density classification. Each edge will be classified as 'rural','residential' or 'city', {@link UrbanDensity }
199
199
*
200
200
* @param residentialAreaRadius in meters. The higher this value the longer the calculation will take and the bigger the area for
201
201
* which the road density used to identify residential areas is calculated.
@@ -206,17 +206,17 @@ public GraphHopper setMinNetworkSize(int minNetworkSize) {
206
206
* to skip the city classification.
207
207
* @param cityAreaSensitivity Use this to find a trade-off between too many roads being classified as city (too high values)
208
208
* and not enough roads being classified as city (too small values)
209
- * @param threads the number of threads used for the calculation. If this is zero the development
210
- * classification is skipped entirely
209
+ * @param threads the number of threads used for the calculation. If this is zero the urban density
210
+ * calculation is skipped entirely
211
211
*/
212
- public GraphHopper setDevelopmentClassification (double residentialAreaRadius , double residentialAreaSensitivity ,
213
- double cityAreaRadius , double cityAreaSensitivity , int threads ) {
212
+ public GraphHopper setUrbanDensityCalculation (double residentialAreaRadius , double residentialAreaSensitivity ,
213
+ double cityAreaRadius , double cityAreaSensitivity , int threads ) {
214
214
ensureNotLoaded ();
215
215
this .residentialAreaRadius = residentialAreaRadius ;
216
216
this .residentialAreaSensitivity = residentialAreaSensitivity ;
217
217
this .cityAreaRadius = cityAreaRadius ;
218
218
this .cityAreaSensitivity = cityAreaSensitivity ;
219
- this .developmentCalculationThreads = threads ;
219
+ this .urbanDensityCalculationThreads = threads ;
220
220
return this ;
221
221
}
222
222
@@ -571,12 +571,12 @@ public GraphHopper init(GraphHopperConfig ghConfig) {
571
571
preciseIndexResolution = ghConfig .getInt ("index.high_resolution" , preciseIndexResolution );
572
572
maxRegionSearch = ghConfig .getInt ("index.max_region_search" , maxRegionSearch );
573
573
574
- // development calculation
575
- residentialAreaRadius = ghConfig .getDouble ("graph.development .residential_radius" , residentialAreaRadius );
576
- residentialAreaSensitivity = ghConfig .getDouble ("graph.development .residential_sensitivity" , residentialAreaSensitivity );
577
- cityAreaRadius = ghConfig .getDouble ("graph.development .city_radius" , cityAreaRadius );
578
- cityAreaSensitivity = ghConfig .getDouble ("graph.development .city_sensitivity" , cityAreaSensitivity );
579
- developmentCalculationThreads = ghConfig .getInt ("graph.development .threads" , developmentCalculationThreads );
574
+ // urban density calculation
575
+ residentialAreaRadius = ghConfig .getDouble ("graph.urban_density .residential_radius" , residentialAreaRadius );
576
+ residentialAreaSensitivity = ghConfig .getDouble ("graph.urban_density .residential_sensitivity" , residentialAreaSensitivity );
577
+ cityAreaRadius = ghConfig .getDouble ("graph.urban_density .city_radius" , cityAreaRadius );
578
+ cityAreaSensitivity = ghConfig .getDouble ("graph.urban_density .city_sensitivity" , cityAreaSensitivity );
579
+ urbanDensityCalculationThreads = ghConfig .getInt ("graph.urban_density .threads" , urbanDensityCalculationThreads );
580
580
581
581
// routing
582
582
routerConfig .setMaxVisitedNodes (ghConfig .getInt (Routing .INIT_MAX_VISITED_NODES , routerConfig .getMaxVisitedNodes ()));
@@ -592,7 +592,7 @@ public GraphHopper init(GraphHopperConfig ghConfig) {
592
592
return this ;
593
593
}
594
594
595
- private void buildEncodingManagerAndOSMParsers (String flagEncodersStr , String encodedValuesStr , String dateRangeParserString , boolean withDevelopment , Collection <Profile > profiles ) {
595
+ private void buildEncodingManagerAndOSMParsers (String flagEncodersStr , String encodedValuesStr , String dateRangeParserString , boolean withUrbanDensity , Collection <Profile > profiles ) {
596
596
Map <String , String > flagEncodersMap = new LinkedHashMap <>();
597
597
for (String encoderStr : flagEncodersStr .split ("," )) {
598
598
String name = encoderStr .split ("\\ |" )[0 ].trim ();
@@ -620,8 +620,8 @@ private void buildEncodingManagerAndOSMParsers(String flagEncodersStr, String en
620
620
EncodingManager .Builder emBuilder = new EncodingManager .Builder ();
621
621
flagEncodersMap .forEach ((name , encoderStr ) -> emBuilder .add (vehicleEncodedValuesFactory .createVehicleEncodedValues (name , new PMap (encoderStr ))));
622
622
profiles .forEach (profile -> emBuilder .add (Subnetwork .create (profile .getName ())));
623
- if (withDevelopment )
624
- emBuilder .add (Development .create ());
623
+ if (withUrbanDensity )
624
+ emBuilder .add (UrbanDensity .create ());
625
625
encodedValueStrings .forEach (s -> emBuilder .add (encodedValueFactory .create (s )));
626
626
encodingManager = emBuilder .build ();
627
627
@@ -780,8 +780,8 @@ public void importAndClose() {
780
780
private void process (boolean closeEarly ) {
781
781
GHDirectory directory = new GHDirectory (ghLocation , dataAccessDefaultType );
782
782
directory .configure (dataAccessConfig );
783
- boolean withDevelopment = developmentCalculationThreads > 0 ;
784
- buildEncodingManagerAndOSMParsers (flagEncodersString , encodedValuesString , dateRangeParserString , withDevelopment , profilesByName .values ());
783
+ boolean withUrbanDensity = urbanDensityCalculationThreads > 0 ;
784
+ buildEncodingManagerAndOSMParsers (flagEncodersString , encodedValuesString , dateRangeParserString , withUrbanDensity , profilesByName .values ());
785
785
baseGraph = new BaseGraph .Builder (getEncodingManager ())
786
786
.setDir (directory )
787
787
.set3D (hasElevation ())
@@ -822,15 +822,15 @@ protected void postImport() {
822
822
if (hasElevation ())
823
823
interpolateBridgesTunnelsAndFerries ();
824
824
825
- if (encodingManager .hasEncodedValue (Development .KEY )) {
826
- EnumEncodedValue <Development > developmentEnc = encodingManager .getEnumEncodedValue (Development .KEY , Development .class );
825
+ if (encodingManager .hasEncodedValue (UrbanDensity .KEY )) {
826
+ EnumEncodedValue <UrbanDensity > urbanDensityEnc = encodingManager .getEnumEncodedValue (UrbanDensity .KEY , UrbanDensity .class );
827
827
if (!encodingManager .hasEncodedValue (RoadClass .KEY ))
828
- throw new IllegalArgumentException ("Development calculation requires " + RoadClass .KEY );
828
+ throw new IllegalArgumentException ("Urban density calculation requires " + RoadClass .KEY );
829
829
if (!encodingManager .hasEncodedValue (RoadClassLink .KEY ))
830
- throw new IllegalArgumentException ("Development calculation requires " + RoadClassLink .KEY );
830
+ throw new IllegalArgumentException ("Urban density calculation requires " + RoadClassLink .KEY );
831
831
EnumEncodedValue <RoadClass > roadClassEnc = encodingManager .getEnumEncodedValue (RoadClass .KEY , RoadClass .class );
832
832
BooleanEncodedValue roadClassLinkEnc = encodingManager .getBooleanEncodedValue (RoadClassLink .KEY );
833
- DevelopmentCalculator . calcDevelopment (baseGraph , developmentEnc , roadClassEnc , roadClassLinkEnc , residentialAreaRadius , residentialAreaSensitivity , cityAreaRadius , cityAreaSensitivity , developmentCalculationThreads );
833
+ UrbanDensityCalculator . calcUrbanDensity (baseGraph , urbanDensityEnc , roadClassEnc , roadClassLinkEnc , residentialAreaRadius , residentialAreaSensitivity , cityAreaRadius , cityAreaSensitivity , urbanDensityCalculationThreads );
834
834
}
835
835
}
836
836
0 commit comments