From f4c7761d33f0db999135896ef6a9a1211b1e2295 Mon Sep 17 00:00:00 2001 From: Taylor Smock Date: Tue, 3 Jan 2023 07:32:45 -0700 Subject: [PATCH] Fix #22624: Improperly added resultOffset to URLs sent to MapWithAI servers Signed-off-by: Taylor Smock --- .../backend/BoundingBoxMapWithAIDownloader.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/BoundingBoxMapWithAIDownloader.java b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/BoundingBoxMapWithAIDownloader.java index d9c66aab..a4eb05b4 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/BoundingBoxMapWithAIDownloader.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapwithai/backend/BoundingBoxMapWithAIDownloader.java @@ -110,7 +110,9 @@ protected String getRequestForBbox(double lon1, double lat1, double lon2, double .replace("{xmax}", Double.toString(lon2)).replace("{ymax}", Double.toString(lat2)) + (crop ? "&crop_bbox=" + DetectTaskingManagerUtils.getTaskingManagerBounds().toBBox().toStringCSV(",") : "") - + (this.info.getSourceType() == MapWithAIType.ESRI_FEATURE_SERVER ? "&resultOffset=" + this.start : ""); + + (this.info.getSourceType() == MapWithAIType.ESRI_FEATURE_SERVER && !this.info.isConflated() + ? "&resultOffset=" + this.start + : ""); } @Override @@ -118,9 +120,8 @@ public DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferExcep long startTime = System.nanoTime(); try { DataSet externalData = super.parseOsm(progressMonitor); - if ((this.info.getSourceType() != MapWithAIType.ESRI_FEATURE_SERVER || this.start == 0) // Don't call - // conflate code - // unnecessarily + // Don't call conflate code unnecessarily + if ((this.info.getSourceType() != MapWithAIType.ESRI_FEATURE_SERVER || this.start == 0) && Boolean.TRUE.equals(MapWithAIInfo.THIRD_PARTY_CONFLATE.get()) && !this.info.isConflated() && !MapWithAIConflationCategory.conflationUrlFor(this.info.getCategory()).isEmpty()) { if (externalData.getDataSourceBounds().isEmpty()) {