Skip to content

Commit

Permalink
MapWithAIDataUtils: Add minimum dimensions (effectively 1 km).
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Smock <[email protected]>
  • Loading branch information
tsmock committed Nov 12, 2020
1 parent 95e797e commit 6f6a2e9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
*
*/
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
// timeouts
private static final int TOO_MANY_BBOXES = 4;
Expand Down Expand Up @@ -209,7 +209,8 @@ public static DataSet getData(List<BBox> bbox, int maximumDimensions) {
}
} catch (OsmTransferException e) {
if (e.getCause() instanceof SocketTimeoutException
&& maximumDimensions > MAXIMUM_SIDE_DIMENSIONS / 10) {
&& maximumDimensions > MAXIMUM_SIDE_DIMENSIONS / 10
&& maximumDimensions / 2f > 0.5) {
dataSet.mergeFrom(getData(bound.toBBox(), maximumDimensions / 2));
} else if (e.getCause() instanceof IllegalDataException) {
Logging.error(e);
Expand Down

0 comments on commit 6f6a2e9

Please sign in to comment.