kopia lustrzana https://github.com/JOSM/MapWithAI
MapWithAIDataUtils: Add minimum dimensions (effectively 1 km).
Signed-off-by: Taylor Smock <tsmock@fb.com>pull/1/head v1.7.1
rodzic
b77508554a
commit
7d64a84062
|
@ -48,7 +48,7 @@ import org.openstreetmap.josm.tools.Utils;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public final class MapWithAIDataUtils {
|
public final class MapWithAIDataUtils {
|
||||||
/** THe maximum dimensions for MapWithAI data (in kilometers) */
|
/** The maximum dimensions for MapWithAI data (in kilometers) */
|
||||||
public static final int MAXIMUM_SIDE_DIMENSIONS = 10_000; // RapiD is about 1km, max is 10km, but 10km causes
|
public static final int MAXIMUM_SIDE_DIMENSIONS = 10_000; // RapiD is about 1km, max is 10km, but 10km causes
|
||||||
// timeouts
|
// timeouts
|
||||||
private static final int TOO_MANY_BBOXES = 4;
|
private static final int TOO_MANY_BBOXES = 4;
|
||||||
|
@ -158,7 +158,8 @@ public final class MapWithAIDataUtils {
|
||||||
}
|
}
|
||||||
} catch (OsmTransferException e) {
|
} catch (OsmTransferException e) {
|
||||||
if (e.getCause() instanceof SocketTimeoutException
|
if (e.getCause() instanceof SocketTimeoutException
|
||||||
&& maximumDimensions > MAXIMUM_SIDE_DIMENSIONS / 10) {
|
&& maximumDimensions > MAXIMUM_SIDE_DIMENSIONS / 10
|
||||||
|
&& maximumDimensions / 2f > 0.5) {
|
||||||
dataSet.mergeFrom(getData(bound, maximumDimensions / 2));
|
dataSet.mergeFrom(getData(bound, maximumDimensions / 2));
|
||||||
} else if (e.getCause() instanceof IllegalDataException) {
|
} else if (e.getCause() instanceof IllegalDataException) {
|
||||||
Logging.error(e);
|
Logging.error(e);
|
||||||
|
|
Ładowanie…
Reference in New Issue