public void createPreparations ( GraphHopperStorage ghStorage , LocationIndex locationIndex ) { if ( ! isEnabled ( ) || ! preparations . isEmpty ( ) ) return ; if ( weightings . isEmpty ( ) ) throw new IllegalStateException ( "No landmark weightings found" ) ; List < LandmarkSuggestion > lmSuggestions = new ArrayList <> ( lmSuggestionsLocations . size ( ) ) ; if ( ! lmSuggestionsLocations . isEmpty ( ) ) { try { for ( String loc : lmSuggestionsLocations ) { lmSuggestions . add ( LandmarkSuggestion . readLandmarks ( loc , locationIndex ) ) ; } } catch ( IOException ex ) { throw new RuntimeException ( ex ) ; } } for ( Weighting weighting : getWeightings ( ) ) { Double maximumWeight = maximumWeights . get ( weighting . getName ( ) ) ; if ( maximumWeight == null ) throw new IllegalStateException ( "maximumWeight cannot be null. Default should be just negative. " + "Couldn't find " + weighting . getName ( ) + " in " + maximumWeights ) ; PrepareLandmarks tmpPrepareLM = new PrepareLandmarks ( ghStorage . getDirectory ( ) , ghStorage , weighting , landmarkCount , activeLandmarkCount ) . setLandmarkSuggestions ( lmSuggestions ) . setMaximumWeight ( maximumWeight ) . setLogDetails ( logDetails ) ; if ( minNodes > 1 ) tmpPrepareLM . setMinimumNodes ( minNodes ) ; addPreparation ( tmpPrepareLM ) ; } }
This method creates the landmark storages ready for landmark creation .