Package org.openstreetmap.josm.io
Class OsmServerLocationReader
- java.lang.Object
-
- org.openstreetmap.josm.io.OsmConnection
-
- org.openstreetmap.josm.io.OsmServerReader
-
- org.openstreetmap.josm.io.OsmServerLocationReader
-
- Direct Known Subclasses:
GeoJSONServerReader
public class OsmServerLocationReader extends OsmServerReader
Read content from OSM server for a given URL- Since:
- 1146
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
OsmServerLocationReader.GpxParser
protected class
OsmServerLocationReader.NoteParser
protected class
OsmServerLocationReader.OsmChangeParser
protected class
OsmServerLocationReader.OsmParser
protected static class
OsmServerLocationReader.Parser<T>
-
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
Fields Modifier and Type Field Description protected java.lang.String
url
-
Fields inherited from class org.openstreetmap.josm.io.OsmServerReader
contentType, gpxParsedProperly
-
Fields inherited from class org.openstreetmap.josm.io.OsmConnection
activeConnection, cancel, fetcher, oAuth20Parameters
-
-
Constructor Summary
Constructors Constructor Description OsmServerLocationReader(java.lang.String url)
Constructs a newOsmServerLocationReader
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T> T
doParse(OsmServerLocationReader.Parser<T> parser, ProgressMonitor progressMonitor)
java.lang.String
getUrl()
Returns the URL to fetchDataSet
parseOsm(ProgressMonitor progressMonitor)
Download OSM files from somewhereDataSet
parseOsm(ProgressMonitor progressMonitor, Compression compression)
Download compressed OSM files from somewhereDataSet
parseOsmChange(ProgressMonitor progressMonitor)
Download OSM Change uncompressed files from somewhereDataSet
parseOsmChange(ProgressMonitor progressMonitor, Compression compression)
Download OSM Change compressed files from somewhereGpxData
parseRawGps(ProgressMonitor progressMonitor)
Retrieve raw gps waypoints from the server API.GpxData
parseRawGps(ProgressMonitor progressMonitor, Compression compression)
Retrieve compressed GPX files from somewhere.java.util.List<Note>
parseRawNotes(ProgressMonitor progressMonitor)
Downloads notes from a given raw URL.java.util.List<Note>
parseRawNotes(ProgressMonitor progressMonitor, Compression compression)
Download notes from a URL that contains a compressed notes dump file-
Methods inherited from class org.openstreetmap.josm.io.OsmServerReader
adaptRequest, fetchData, getAttribute, getBaseUrl, getInputStream, getInputStream, getInputStreamRaw, getInputStreamRaw, getInputStreamRaw, getInputStreamRaw, isDoAuthenticate, isGpxParsedProperly, parseNotes, setDoAuthenticate
-
Methods inherited from class org.openstreetmap.josm.io.OsmConnection
addAuth, addBasicAuthorizationHeader, addOAuth20AuthorizationHeader, cancel, isCanceled, retrieveBasicAuthorizationLogin, setOAuthAccessTokenFetcher
-
-
-
-
Field Detail
-
url
protected final java.lang.String url
-
-
Constructor Detail
-
OsmServerLocationReader
public OsmServerLocationReader(java.lang.String url)
Constructs a newOsmServerLocationReader
.- Parameters:
url
- The URL to fetch
-
-
Method Detail
-
getUrl
public final java.lang.String getUrl()
Returns the URL to fetch- Returns:
- the URL to fetch
- Since:
- 15247
-
doParse
protected final <T> T doParse(OsmServerLocationReader.Parser<T> parser, ProgressMonitor progressMonitor) throws OsmTransferException
- Throws:
OsmTransferException
-
parseOsm
public DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferException
Description copied from class:OsmServerReader
Download OSM files from somewhere- Specified by:
parseOsm
in classOsmServerReader
- Parameters:
progressMonitor
- The progress monitor- Returns:
- The corresponding dataset
- Throws:
OsmTransferException
- if any error occurs
-
parseOsm
public DataSet parseOsm(ProgressMonitor progressMonitor, Compression compression) throws OsmTransferException
Description copied from class:OsmServerReader
Download compressed OSM files from somewhere- Overrides:
parseOsm
in classOsmServerReader
- Parameters:
progressMonitor
- The progress monitorcompression
- compression to use- Returns:
- The corresponding dataset
- Throws:
OsmTransferException
- if any error occurs
-
parseOsmChange
public DataSet parseOsmChange(ProgressMonitor progressMonitor) throws OsmTransferException
Description copied from class:OsmServerReader
Download OSM Change uncompressed files from somewhere- Overrides:
parseOsmChange
in classOsmServerReader
- Parameters:
progressMonitor
- The progress monitor- Returns:
- The corresponding dataset
- Throws:
OsmTransferException
- if any error occurs
-
parseOsmChange
public DataSet parseOsmChange(ProgressMonitor progressMonitor, Compression compression) throws OsmTransferException
Description copied from class:OsmServerReader
Download OSM Change compressed files from somewhere- Overrides:
parseOsmChange
in classOsmServerReader
- Parameters:
progressMonitor
- The progress monitorcompression
- compression to use- Returns:
- The corresponding dataset
- Throws:
OsmTransferException
- if any error occurs
-
parseRawGps
public GpxData parseRawGps(ProgressMonitor progressMonitor) throws OsmTransferException
Description copied from class:OsmServerReader
Retrieve raw gps waypoints from the server API.- Overrides:
parseRawGps
in classOsmServerReader
- Parameters:
progressMonitor
- The progress monitor- Returns:
- The corresponding GPX tracks
- Throws:
OsmTransferException
- if any error occurs
-
parseRawGps
public GpxData parseRawGps(ProgressMonitor progressMonitor, Compression compression) throws OsmTransferException
Description copied from class:OsmServerReader
Retrieve compressed GPX files from somewhere.- Overrides:
parseRawGps
in classOsmServerReader
- Parameters:
progressMonitor
- The progress monitorcompression
- compression to use- Returns:
- The corresponding GPX tracks
- Throws:
OsmTransferException
- if any error occurs
-
parseRawNotes
public java.util.List<Note> parseRawNotes(ProgressMonitor progressMonitor) throws OsmTransferException
Description copied from class:OsmServerReader
Downloads notes from a given raw URL. The URL is assumed to be complete and no API limits are added- Overrides:
parseRawNotes
in classOsmServerReader
- Parameters:
progressMonitor
- progress monitor- Returns:
- A list of notes parsed from the URL
- Throws:
OsmTransferException
- if any error occurs during dialog with OSM API
-
parseRawNotes
public java.util.List<Note> parseRawNotes(ProgressMonitor progressMonitor, Compression compression) throws OsmTransferException
Description copied from class:OsmServerReader
Download notes from a URL that contains a compressed notes dump file- Overrides:
parseRawNotes
in classOsmServerReader
- Parameters:
progressMonitor
- progress monitorcompression
- compression to use- Returns:
- A list of notes parsed from the URL
- Throws:
OsmTransferException
- if any error occurs during dialog with OSM API
-
-