public class OverpassDownloadReader extends BoundingBoxDownloader
BoundingBoxDownloader.MoreNotesException| Modifier and Type | Field and Description |
|---|---|
(package private) String |
overpassQuery |
(package private) String |
overpassServer |
crosses180th, lat1, lat2, lon1, lon2gpxParsedProperlyactiveConnection, cancel, oauthParameters| Constructor and Description |
|---|
OverpassDownloadReader(Bounds downloadArea,
String overpassServer,
String overpassQuery)
Constructs a new
OverpassDownloadReader. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
adaptRequest(HttpClient request)
Allows subclasses to modify the request.
|
private static String |
completeOverpassQuery(String query) |
protected String |
getBaseUrl()
Return the base URL for relative URL requests
|
protected InputStream |
getInputStreamRaw(String urlStr,
ProgressMonitor progressMonitor,
String reason,
boolean uncompressAccordingToContentDisposition)
Open a connection to the given url and return a reader on the input stream
from that connection.
|
protected String |
getRequestForBbox(double lon1,
double lat1,
double lon2,
double lat2)
Builds the request part for the bounding box.
|
protected String |
getTaskName()
Returns the name of the download task to be displayed in the
ProgressMonitor. |
protected DataSet |
parseDataSet(InputStream source,
ProgressMonitor progressMonitor)
Parse the given input source and return the dataset.
|
DataSet |
parseOsm(ProgressMonitor progressMonitor)
Download OSM files from somewhere
|
parseNotes, parseRawGpsgetInputStream, getInputStream, getInputStreamRaw, getInputStreamRaw, isDoAuthenticate, isGpxParsedProperly, parseOsmBzip2, parseOsmChange, parseOsmChangeBzip2, parseOsmChangeGzip, parseOsmGzip, parseOsmZip, parseRawGpsBzip2, parseRawNotes, parseRawNotesBzip2, setDoAuthenticateaddAuth, addBasicAuthorizationHeader, addOAuthAuthorizationHeader, cancel, isCanceledfinal String overpassServer
final String overpassQuery
public OverpassDownloadReader(Bounds downloadArea, String overpassServer, String overpassQuery)
OverpassDownloadReader.downloadArea - The area to downloadoverpassServer - The Overpass server to useoverpassQuery - The Overpass queryprotected String getBaseUrl()
OsmServerReadergetBaseUrl in class OsmServerReaderprotected String getRequestForBbox(double lon1, double lat1, double lon2, double lat2)
BoundingBoxDownloadergetRequestForBbox in class BoundingBoxDownloaderlon1 - leftlat1 - bottomlon2 - rightlat2 - topprivate static String completeOverpassQuery(String query)
protected InputStream getInputStreamRaw(String urlStr, ProgressMonitor progressMonitor, String reason, boolean uncompressAccordingToContentDisposition) throws OsmTransferException
OsmServerReadernull.getInputStreamRaw in class OsmServerReaderurlStr - The exact url to connect to.progressMonitor - progress monitoring and abort handlerreason - The reason to show on console. Can be null if no reason is givenuncompressAccordingToContentDisposition - Whether to inspect the HTTP header Content-Disposition
for filename and uncompress a gzip/bzip2 stream.null.OsmTransferException - if data transfer errors occurprotected void adaptRequest(HttpClient request)
OsmServerReaderadaptRequest in class OsmServerReaderrequest - the prepared requestprotected String getTaskName()
BoundingBoxDownloaderProgressMonitor.getTaskName in class BoundingBoxDownloaderprotected DataSet parseDataSet(InputStream source, ProgressMonitor progressMonitor) throws IllegalDataException
BoundingBoxDownloaderparseDataSet in class BoundingBoxDownloadersource - input streamprogressMonitor - progress monitorIllegalDataException - if an error was found while parsing the OSM dataOsmReader.parseDataSet(InputStream, ProgressMonitor)public DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferException
OsmServerReaderparseOsm in class BoundingBoxDownloaderprogressMonitor - The progress monitorOsmTransferException - if any error occurs