Package org.openstreetmap.josm.io
Class BoundingBoxDownloader
java.lang.Object
org.openstreetmap.josm.io.OsmConnection
org.openstreetmap.josm.io.OsmServerReader
org.openstreetmap.josm.io.BoundingBoxDownloader
- Direct Known Subclasses:
OverpassDownloadReader
Read content from OSM server for a given bounding box
- Since:
- 627
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classIndicates that the number of fetched notes equals the specified limit.Nested classes/interfaces inherited from class org.openstreetmap.josm.io.OsmServerReader
OsmServerReader.DomParser<R>Nested classes/interfaces inherited from class org.openstreetmap.josm.io.OsmConnection
OsmConnection.OAuthAccessTokenFetcher -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected final doubleThe boundings of the desired map data.protected final doubleprotected final doubleprotected final doubleFields inherited from class org.openstreetmap.josm.io.OsmServerReader
contentType, gpxParsedProperlyFields inherited from class org.openstreetmap.josm.io.OsmConnection
activeConnection, cancel, fetcher, oAuth20Parameters -
Constructor Summary
ConstructorsConstructorDescriptionBoundingBoxDownloader(Bounds downloadArea) Constructs a newBoundingBoxDownloader. -
Method Summary
Modifier and TypeMethodDescriptionbooleanDetermines if download is complete for the given bounding box.private GpxDatadownloadRawGps(Bounds b, ProgressMonitor progressMonitor) protected Collection<Bounds>Get the bounds for this downloaderprotected StringgetRequestForBbox(double lon1, double lat1, double lon2, double lat2) Builds the request part for the bounding box.protected StringReturns the name of the download task to be displayed in theProgressMonitor.protected DataSetparseDataSet(InputStream source, ProgressMonitor progressMonitor) Parse the given input source and return the dataset.parseNotes(int noteLimit, int daysClosed, ProgressMonitor progressMonitor) Downloads notes from the API, given API limit parametersparseOsm(ProgressMonitor progressMonitor) Download OSM files from somewhereparseRawGps(ProgressMonitor progressMonitor) Retrieve raw gps waypoints from the server API.Methods inherited from class org.openstreetmap.josm.io.OsmServerReader
adaptRequest, fetchData, getAttribute, getBaseUrl, getInputStream, getInputStream, getInputStreamRaw, getInputStreamRaw, getInputStreamRaw, getInputStreamRaw, isDoAuthenticate, isGpxParsedProperly, parseOsm, parseOsmChange, parseOsmChange, parseRawGps, parseRawNotes, parseRawNotes, setDoAuthenticateMethods inherited from class org.openstreetmap.josm.io.OsmConnection
addAuth, addBasicAuthorizationHeader, addOAuth20AuthorizationHeader, cancel, isCanceled, retrieveBasicAuthorizationLogin, setOAuthAccessTokenFetcher
-
Field Details
-
lat1
The boundings of the desired map data. -
lon1
-
lat2
-
lon2
-
crosses180th
-
-
Constructor Details
-
BoundingBoxDownloader
Constructs a newBoundingBoxDownloader.- Parameters:
downloadArea- The area to download
-
-
Method Details
-
downloadRawGps
private GpxData downloadRawGps(Bounds b, ProgressMonitor progressMonitor) throws IOException, OsmTransferException, SAXException -
parseRawGps
Description copied from class:OsmServerReaderRetrieve raw gps waypoints from the server API.- Overrides:
parseRawGpsin classOsmServerReader- Parameters:
progressMonitor- The progress monitor- Returns:
- The corresponding GPX tracks
- Throws:
OsmTransferException- if any error occurs
-
getTaskName
Returns the name of the download task to be displayed in theProgressMonitor.- Returns:
- task name
-
getRequestForBbox
Builds the request part for the bounding box.- Parameters:
lon1- leftlat1- bottomlon2- rightlat2- top- Returns:
- "map?bbox=left,bottom,right,top"
-
parseDataSet
protected DataSet parseDataSet(InputStream source, ProgressMonitor progressMonitor) throws IllegalDataException Parse the given input source and return the dataset.- Parameters:
source- input streamprogressMonitor- progress monitor- Returns:
- dataset
- Throws:
IllegalDataException- if an error was found while parsing the OSM data- See Also:
-
parseOsm
Description copied from class:OsmServerReaderDownload OSM files from somewhere- Specified by:
parseOsmin classOsmServerReader- Parameters:
progressMonitor- The progress monitor- Returns:
- The corresponding dataset
- Throws:
OsmTransferException- if any error occurs
-
parseNotes
public List<Note> parseNotes(int noteLimit, int daysClosed, ProgressMonitor progressMonitor) throws OsmTransferException Description copied from class:OsmServerReaderDownloads notes from the API, given API limit parameters- Overrides:
parseNotesin classOsmServerReader- Parameters:
noteLimit- How many notes to download.daysClosed- Return notes closed this many days in the past. -1 means all notes, ever. 0 means only unresolved notes.progressMonitor- Progress monitor for user feedback- Returns:
- List of notes returned by the API
- Throws:
OsmTransferException- if any errors happen
-
considerAsFullDownload
Determines if download is complete for the given bounding box.- Returns:
- true if download is complete for the given bounding box (not filtered)
-
getBounds
Get the bounds for this downloader- Returns:
- The bounds for this downloader
- Since:
- 19078
-