|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.io.OsmConnection
org.openstreetmap.josm.io.OsmServerReader
org.openstreetmap.josm.io.OsmServerBackreferenceReader
public class OsmServerBackreferenceReader
OsmServerBackreferenceReader fetches the primitives from the OSM server which
refer to a specific primitive. For a 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.
Field Summary | |
---|---|
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 |
Fields inherited from class org.openstreetmap.josm.io.OsmConnection |
---|
activeConnection, cancel, oauthParameters |
Constructor Summary | |
---|---|
OsmServerBackreferenceReader(long id,
OsmPrimitiveType type)
constructor |
|
OsmServerBackreferenceReader(long id,
OsmPrimitiveType type,
boolean readFull)
constructor |
|
OsmServerBackreferenceReader(OsmPrimitive primitive)
constructor |
|
OsmServerBackreferenceReader(OsmPrimitive primitive,
boolean readFull)
constructor |
Method Summary | |
---|---|
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. |
Methods inherited from class org.openstreetmap.josm.io.OsmServerReader |
---|
getBaseUrl, getInputStream, getInputStreamRaw, isDoAuthenticate, parseOsmBzip2, parseOsmChange, parseOsmChangeBzip2, parseOsmChangeGzip, parseOsmGzip, parseRawGps, setDoAuthenticate |
Methods inherited from class org.openstreetmap.josm.io.OsmConnection |
---|
addAuth, addBasicAuthorizationHeader, addOAuthAuthorizationHeader, cancel, isCanceled |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private long id
private OsmPrimitiveType primitiveType
private boolean readFull
Constructor Detail |
---|
public OsmServerBackreferenceReader(OsmPrimitive primitive) throws java.lang.IllegalArgumentException
primitive
- the primitive to be read. Must not be null. primitive.id > 0 expected
java.lang.IllegalArgumentException
- thrown if primitive is null
java.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 <= 0
java.lang.IllegalArgumentException
- thrown if type is nullpublic OsmServerBackreferenceReader(OsmPrimitive primitive, boolean readFull)
id
- the id of the primitive. > 0 expectedreadFull
- 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
primitive
- the primitive whose referers are to be readreadFull
- true, if referers should be read fully (i.e. including their immediate children)
java.lang.IllegalArgumentException
- thrown if id <= 0
java.lang.IllegalArgumentException
- thrown if type is nullMethod Detail |
---|
public boolean isReadFull()
public void setReadFull(boolean readFull)
readFull
- true if this reader should reads immediate children of referring primitives too. False, otherweise.protected DataSet getReferringWays(ProgressMonitor progressMonitor) throws OsmTransferException
DataSet
OsmTransferException
protected DataSet getReferringRelations(ProgressMonitor progressMonitor) throws OsmTransferException
DataSet
progressMonitor
- the progress monitor
OsmTransferException
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 monitor
OsmTransferException
- 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |