public class OsmServerBackreferenceReader extends OsmServerReader
Node
, ways and relations are retrieved
which refer to the node. For a Way
or a Relation
, only relations are read.
OsmServerBackreferenceReader uses the API calls [node|way|relation]/#id/relations
and node/#id/ways
to retrieve the referring primitives. The default behaviour
of these calls is to reply incomplete primitives only.
If you set setReadFull(boolean)
to true this reader uses a MultiFetchServerObjectReader
to complete incomplete primitives.Modifier and Type | Field and Description |
---|---|
private long |
id
the id of the primitive whose referrers are to be read
|
private OsmPrimitiveType |
primitiveType
the type of the primitive
|
private boolean |
readFull
true if this reader should complete incomplete primitives
|
gpxParsedProperly
activeConnection, cancel, oauthParameters
Constructor and Description |
---|
OsmServerBackreferenceReader(long id,
OsmPrimitiveType type)
constructor
|
OsmServerBackreferenceReader(long id,
OsmPrimitiveType type,
boolean readFull)
Creates a back reference reader for given primitive id
|
OsmServerBackreferenceReader(OsmPrimitive primitive)
constructor
|
OsmServerBackreferenceReader(OsmPrimitive primitive,
boolean readFull)
Creates a back reference reader for given primitive
|
Modifier and Type | Method and Description |
---|---|
private DataSet |
getReferringPrimitives(ProgressMonitor progressMonitor,
java.lang.String type,
java.lang.String message) |
protected DataSet |
getReferringRelations(ProgressMonitor progressMonitor)
Reads referring relations from the API server and replies them in a
DataSet |
protected DataSet |
getReferringWays(ProgressMonitor progressMonitor)
Reads referring ways from the API server and replies them in a
DataSet |
boolean |
isReadFull()
Replies true if this reader also reads immediate children of referring primitives
|
DataSet |
parseOsm(ProgressMonitor progressMonitor)
Reads the referring primitives from the OSM server, parses them and
replies them as
DataSet |
protected DataSet |
readIncompletePrimitives(DataSet ds,
ProgressMonitor progressMonitor)
Scans a dataset for incomplete primitives.
|
void |
setReadFull(boolean readFull)
Set true if this reader should reads immediate children of referring primitives too.
|
getBaseUrl, getInputStream, getInputStream, getInputStreamRaw, getInputStreamRaw, getInputStreamRaw, isDoAuthenticate, isGpxParsedProperly, parseNotes, parseOsmBzip2, parseOsmChange, parseOsmChangeBzip2, parseOsmChangeGzip, parseOsmGzip, parseOsmZip, parseRawGps, parseRawGpsBzip2, parseRawNotes, parseRawNotesBzip2, setDoAuthenticate
addAuth, addBasicAuthorizationHeader, addOAuthAuthorizationHeader, cancel, isCanceled
private long id
private OsmPrimitiveType primitiveType
private boolean readFull
public OsmServerBackreferenceReader(OsmPrimitive primitive) throws java.lang.IllegalArgumentException
primitive
- the primitive to be read. Must not be null. primitive.id > 0 expectedjava.lang.IllegalArgumentException
- thrown if primitive is nulljava.lang.IllegalArgumentException
- thrown if primitive.id <= 0public OsmServerBackreferenceReader(long id, OsmPrimitiveType type) throws java.lang.IllegalArgumentException
id
- the id of the primitive. > 0 expectedtype
- the type of the primitive. Must not be null.java.lang.IllegalArgumentException
- thrown if id <= 0java.lang.IllegalArgumentException
- thrown if type is nullpublic OsmServerBackreferenceReader(OsmPrimitive primitive, boolean readFull)
primitive
- the primitivereadFull
- true
, if referers should be read fully (i.e. including their immediate children)public OsmServerBackreferenceReader(long id, OsmPrimitiveType type, boolean readFull) throws java.lang.IllegalArgumentException
id
- the id of the primitive whose referers are to be readtype
- the type of the primitivereadFull
- true, if referers should be read fully (i.e. including their immediate children)java.lang.IllegalArgumentException
- thrown if id <= 0java.lang.IllegalArgumentException
- thrown if type is nullpublic boolean isReadFull()
public void setReadFull(boolean readFull)
readFull
- true if this reader should reads immediate children of referring primitives too. False, otherweise.private DataSet getReferringPrimitives(ProgressMonitor progressMonitor, java.lang.String type, java.lang.String message) throws OsmTransferException
OsmTransferException
protected DataSet getReferringWays(ProgressMonitor progressMonitor) throws OsmTransferException
DataSet
OsmTransferException
protected DataSet getReferringRelations(ProgressMonitor progressMonitor) throws OsmTransferException
DataSet
progressMonitor
- the progress monitorOsmTransferException
protected DataSet readIncompletePrimitives(DataSet ds, ProgressMonitor progressMonitor) throws OsmTransferException
Node
, referring ways are always
read individually from the serverWay
or a Relation
, referring relations
are only read fully if setReadFull(boolean)
is set to true.ds
- the original datasetprogressMonitor
- the progress monitorOsmTransferException
- thrown if an exception occurs.public DataSet parseOsm(ProgressMonitor progressMonitor) throws OsmTransferException
DataSet
parseOsm
in class OsmServerReader
progressMonitor
- the progress monitor. Set to NullProgressMonitor.INSTANCE
if null.OsmTransferException
- thrown if an error occurs while communicating with the server