Changeset 13572 in josm


Ignore:
Timestamp:
2018-03-26T03:54:50+02:00 (4 weeks ago)
Author:
Don-vip
Message:

fix #15798 - support direct download of GPX files from HOT Tasking Manager

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTask.java

    r12846 r13572  
    7878            return loadUrl(newLayer, mappedUrl.get(), progressMonitor);
    7979        }
    80         if (Stream.of(GpxUrlPattern.TRACE_ID, GpxUrlPattern.EXTERNAL_GPX_SCRIPT, GpxUrlPattern.EXTERNAL_GPX_FILE)
     80        if (Stream.of(GpxUrlPattern.TRACE_ID, GpxUrlPattern.EXTERNAL_GPX_SCRIPT,
     81                      GpxUrlPattern.EXTERNAL_GPX_FILE, GpxUrlPattern.TASKING_MANAGER)
    8182                .anyMatch(p -> url.matches(p.pattern()))) {
    8283            downloadTask = new DownloadTask(newLayer,
  • trunk/src/org/openstreetmap/josm/io/OsmServerLocationReader.java

    r13352 r13572  
    6060
    6161        TRACKPOINTS_BBOX("https?://.*/api/0.6/trackpoints\\?bbox=.*,.*,.*,.*"),
     62        TASKING_MANAGER("https?://.*/api/v\\p{Digit}+/project/\\p{Digit}+/tasks_as_gpx?.*"),
    6263
    6364        EXTERNAL_GPX_SCRIPT("https?://.*exportgpx.*"),
  • trunk/test/unit/org/openstreetmap/josm/actions/downloadtasks/DownloadGpsTaskTest.java

    r12558 r13572  
    3232        assertTrue(task.acceptsUrl("https://www.openstreetmap.org/edit?gpx=750057"));
    3333        assertTrue(task.acceptsUrl("http://www.openstreetmap.org/edit?gpx=2277313#map=14/-20.7321/-40.5328"));
     34        assertTrue(task.acceptsUrl("https://tasks.hotosm.org/api/v1/project/4019/tasks_as_gpx?tasks=125&as_file=true"));
    3435        assertTrue(task.acceptsUrl(getRemoteFileUrl()));
    3536    }
Note: See TracChangeset for help on using the changeset viewer.