public class Relation extends GenericTaggedNode<Relation>
GenericTaggedNode.ExtendedGTNAttr
Modifier and Type | Field and Description |
---|---|
int |
id
OpenStreetMap database ID key for this Relation.
|
decodedtagArray, extraAmenities, FIXME, FIXME_OBJ, flags, flags2, FLAGS2_BOGUS, FLAGS2_BOGUS_OBJ, FLAGS2_FEE, FLAGS2_FEE_OBJ, FLAGS2_FLOOD_PRONE, FLAGS2_FLOOD_PRONE_OBJ, FLAGS2_HAS_POSTALADDR, FLAGS2_INTERMITTENT, FLAGS2_INTERMITTENT_OBJ, FLAGS2_IS_LIT, FLAGS2_IS_LIT_OBJ, FLAGS2_UNDERGROUND, FLAGS2_WHEELCHAIR_ACCESSIBLE, FLAGS2_WHEELCHAIR_ACCESSIBLE_OBJ, HAS_COLOR, HAS_ID, HAS_ID64, HAS_INTERNET_ACCESS, HAS_INTERNET_ACCESS_OBJ, HAS_TOLL, HAS_TOLL_OBJ, IS_AREA, IS_AREA_OBJ, IS_BRIDGE, IS_BRIDGE_OBJ, IS_BUILDING, IS_BUILDING_OBJ, IS_DISUSED, IS_DISUSED_OBJ, IS_HOLE, IS_INCOMPLETE, IS_ISLAND, IS_ISLAND_OBJ, IS_ONEWAY, IS_ONEWAY_BACKWARDS, IS_ONEWAY_BACKWARDS_OBJ, IS_ONEWAY_OBJ, IS_TUNNEL, IS_TUNNEL_OBJ, IS_WATER, MARINE, RENDERABLE_FLAGS, segmentNum
Constructor and Description |
---|
Relation() |
Modifier and Type | Method and Description |
---|---|
Relation |
dup()
Create a deep copy of this Relation.
|
java.lang.Number |
getId()
Return the ID of this OSM record as a sub-class of Number.
|
boolean |
isOnlyWays()
Test if this Relation contains only Ways.
|
static void |
main(java.lang.String[] args)
for unit testing only of Relation class.
|
static Relation |
read(java.io.DataInput is)
Read a new Relation object from the specified input stream.
|
java.lang.String |
toString()
Returns a string representation of the Relation object.
|
void |
write(java.io.DataOutput dos)
Write this Relation to the specified stream in a compact binary format.
|
void |
writeGPX(java.io.PrintStream ps)
Write this Relation to the specified stream as the XML tags one element in GPX schema format.
|
protected void |
writeId(java.io.DataOutput dos)
Handle writing the ID field to the binary data stream (handles larger ID ranges in
varying subclasses).
|
addAmenityType, compareGTNAttributes, decodedTagArrayToString, ensureElementHasTagArray, hasDecodedTags, hasThisAmenity, putTag, readTags, readTags, removeRedundantAmenityTypes, replaceAmenityType, writeTags
protected void writeId(java.io.DataOutput dos) throws java.io.IOException
writeId
in class GenericTaggedNode<Relation>
dos
- DataOutput to use to append the binary ID valuejava.io.IOException
- if write fails for any reasonpublic java.lang.Number getId()
getId
in class GenericTaggedNode<Relation>
public void write(java.io.DataOutput dos) throws java.io.IOException
dos
- DataOutput to write tojava.io.IOException
- if write failed for any reasonpublic static Relation read(java.io.DataInput is) throws java.io.IOException
is
- DataInput to read the Relation fromjava.io.IOException
- if read failed for any reasonpublic java.lang.String toString()
toString
in class java.lang.Object
public Relation dup()
dup
in class GenericTaggedNode<Relation>
public void writeGPX(java.io.PrintStream ps)
writeGPX
in class GenericTaggedNode<Relation>
ps
- PrintStream to write topublic static void main(java.lang.String[] args) throws java.io.IOException
args
- String array of command-line parameters, [0]: Relation file to read,
[1]: numeric Relation ID to check for (-1 means all), [2]: optional "-short"
to reduce printed debug outputjava.io.IOException
- if file can't be read for some reasonpublic boolean isOnlyWays()