diff --git a/brouter-routing-app/src/main/AndroidManifest.xml b/brouter-routing-app/src/main/AndroidManifest.xml index dc4a3fd..842b8d9 100644 --- a/brouter-routing-app/src/main/AndroidManifest.xml +++ b/brouter-routing-app/src/main/AndroidManifest.xml @@ -18,6 +18,7 @@ android:label="@string/app_name" android:preserveLegacyExternalStorage="true" android:hasFragileUserData="true" + android:largeHeap="true" android:roundIcon="@mipmap/ic_launcher_round" android:theme="@style/Theme.App"> appversion) { if (DEBUG) Log.d(LOG_TAG, "app version old " + appversion + " new " + newappversion); - errorCode = "error new app"; + errorCode = "Version new app"; return false; } if (changed && downloadAll == VALUE_SEGMENT_PARTS) { @@ -375,36 +375,42 @@ public class DownloadWorker extends Worker { connection.setConnectTimeout(5000); connection.setRequestMethod("HEAD"); connection.setDoInput(false); - connection.connect(); + try { + connection.connect(); + return connection.getResponseCode() == HttpURLConnection.HTTP_OK; + } finally { + connection.disconnect(); + } - return connection.getResponseCode() == HttpURLConnection.HTTP_OK; } private boolean downloadFile(URL downloadUrl, File outputFile, int fileSize, boolean limitDownloadSpeed, DownloadType type) throws IOException, InterruptedException { if (DEBUG) Log.d(LOG_TAG, "download " + outputFile.getAbsolutePath()); HttpURLConnection connection = (HttpURLConnection) downloadUrl.openConnection(); connection.setConnectTimeout(5000); - connection.connect(); + connection.setDefaultUseCaches(false); - if (connection.getResponseCode() != HttpURLConnection.HTTP_OK) { - throw new IOException("HTTP Request failed: " + downloadUrl + " returned " + connection.getResponseCode()); - } - int dataLength = connection.getContentLength(); - // no need of download when size equal - // file size not the best coice but easy to handle, date is not available - switch (type) { - case LOOKUP: - if (fileSize == dataLength) return false; - break; - case PROFILE: - if (fileSize == dataLength) return false; - break; - default: - break; - } InputStream input = null; OutputStream output = null; try { + connection.connect(); + + if (connection.getResponseCode() != HttpURLConnection.HTTP_OK) { + throw new IOException("HTTP Request failed: " + downloadUrl + " returned " + connection.getResponseCode()); + } + int dataLength = connection.getContentLength(); + // no need of download when size equal + // file size not the best coice but easy to handle, date is not available + switch (type) { + case LOOKUP: + if (fileSize == dataLength) return false; + break; + case PROFILE: + if (fileSize == dataLength) return false; + break; + default: + break; + } input = connection.getInputStream(); output = new FileOutputStream(outputFile); diff --git a/docs/features/elevation.md b/docs/features/elevation.md index 4d401a7..4d9aa0f 100644 --- a/docs/features/elevation.md +++ b/docs/features/elevation.md @@ -21,7 +21,7 @@ elevation-enabled routing tools. However, the routing algorithm is able to extract the information on real ascends and descends and ignores the noise. For latitudes above 60 degree in northern Europe, BRouter uses Lidar data, that -were [compiled and resampled by Sonny](https://data.opendataportal.at/dataset/dtm-europe) +were [compiled and resampled by Sonny](https://sonny.4lima.de/) On the reporting side, BRouter uses a similar concept to compute the *filtered ascend*, which is the ascend without the noise and the small hills and which diff --git a/misc/profiles2/hiking-mountain.brf b/misc/profiles2/hiking-mountain.brf index 01d3584..8ed13d9 100644 --- a/misc/profiles2/hiking-mountain.brf +++ b/misc/profiles2/hiking-mountain.brf @@ -10,14 +10,12 @@ ---context:global -assign consider_elevation 1 # 0 as default, otherwise less interesting flat roads are chosen. +assign consider_elevation true # %consider_elevation% | Set to false, otherwise less interesting flat roads are chosen | boolean + assign shortest_way 0 # 0 as default, duplicate shortest standard profile, SAC access limit ignored for now -assign turnInstructionMode = 1 # %turnInstructionMode% | Mode for the generated turn instructions | [0=none, 1=auto-choose, 2=locus-style, 3=osmand-style, 4=comment-style, 5=gpsies-style, 6=orux-style, 7=locus-old-style] -assign turnInstructionCatchingRange 20 # V1.8.5 / default=40, but foot paths may be more distingushed, especially in cities. - -assign iswet 0 # 0 as default, 1 tries to prevent muddy boots and wet buttocks -assign hiking_routes_preference 0.20 # 0.10 as default, Increases cost of non hiking routes by multiplier 1 + hiking_routes_preference +assign iswet 0 # %iswet% | tries to prevent muddy boots and wet buttocks | boolean +assign hiking_routes_preference 0.20 # %hiking_routes_preference% | Increases cost of non hiking routes by multiplier 1 + hiking_routes_preference (0.10 to 2.0) | number assign Offroad_factor 0.0 # default 0.0, see ****), see also https://github.com/poutnikl/Brouter-profiles/wiki/Trekking-MTB-Profiles---legend @@ -25,9 +23,9 @@ assign path_preference 0.0 # 0.0 as default, try 20.0 to penalize non #SAC - mountain hiking - see http://wiki.openstreetmap.org/wiki/Key:sac_scale -assign SAC_scale_limit 3 # 0..6, 0 to avoid any SAC paths, 1 for T1 as maximum, 6 for T6 as maximum - # all paths with sac_scale higher than SAC_scale_limit are forbidden. -assign SAC_scale_preferred 1 # The same, but the preferred SAC scale level. Level below are slightly, above strongly penalized +assign SAC_scale_limit 3 # %SAC_scale_limit% | all paths with sac_scale higher than SAC_scale_limit are forbidden | [0=avoid any SAC paths, 1=SAC T1, 2=SAC T2, 3=SAC T3, 4=SAC T4, 5=SAC T5, 6=SAC T6] +assign SAC_scale_preferred 1 # %SAC_scale_preferred% | The same, but the preferred SAC scale level. Level below are slightly, above strongly penalized | [0=avoid any SAC paths, 1=SAC T1, 2=SAC T2, 3=SAC T3, 4=SAC T4, 5=SAC T5, 6=SAC T6] + assign SAC_access_penalty 9000 # costfactor 9999 means the most horrible but allowed road., # 100000=forbidden. This makes difference if forbidden way is the only option. assign SAC_K1 0.05 # Penalizing of SAC levels below preferred @@ -38,14 +36,20 @@ assign turncost_value 0 # not used now assign initialcost_value 0 # not used now #less frequently changed flags -assign allow_steps 1 # 1 as default -assign allow_ferries 1 # 1 as default +assign allow_steps true # %allow_steps% | Set to false to disallow steps | boolean +assign allow_ferries true # %allow_ferries% | set to false to disallow ferries | boolean + assign cost_of_unknown 2 # 2 as default + # assign elevationpenaltybuffer 5 # 5 as default assign elevationmaxbuffer 10 # 10 as default assign elevationbufferreduce 1.0 # 0.0 as default +assign turnInstructionMode = 1 # %turnInstructionMode% | Mode for the generated turn instructions | [0=none, 1=auto-choose, 2=locus-style, 3=osmand-style, 4=comment-style, 5=gpsies-style, 6=orux-style, 7=locus-old-style] +assign turnInstructionCatchingRange 20 # V1.8.5 / default=40, but foot paths may be more distingushed, especially in cities. + + # as initial point, considered flat speed 4 km/h, climbing speed 600 m /h assign uphillcostvalue 7 assign uphillcutoffvalue 3