Class OsmServerBackreferenceReader


  • public class OsmServerBackreferenceReader
    extends OsmServerReader
    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.
    Since:
    1806
    • Field Detail

      • id

        private final long id
        the id of the primitive whose referrers are to be read
      • readFull

        private boolean readFull
        true if this reader should complete incomplete primitives
      • allowIncompleteParentWays

        private boolean allowIncompleteParentWays
        true if this reader should allow incomplete parent ways
    • Constructor Detail

      • OsmServerBackreferenceReader

        public OsmServerBackreferenceReader​(OsmPrimitive primitive)
        constructor
        Parameters:
        primitive - the primitive to be read. Must not be null. primitive.id > 0 expected
        Throws:
        java.lang.IllegalArgumentException - if primitive is null
        java.lang.IllegalArgumentException - if primitive.id <= 0
      • OsmServerBackreferenceReader

        public OsmServerBackreferenceReader​(long id,
                                            OsmPrimitiveType type)
        constructor
        Parameters:
        id - the id of the primitive. > 0 expected
        type - the type of the primitive. Must not be null.
        Throws:
        java.lang.IllegalArgumentException - if id <= 0
        java.lang.IllegalArgumentException - if type is null
      • OsmServerBackreferenceReader

        public OsmServerBackreferenceReader​(OsmPrimitive primitive,
                                            boolean readFull)
        Creates a back reference reader for given primitive
        Parameters:
        primitive - the primitive
        readFull - true, if referrers should be read fully (i.e. including their immediate children)
      • OsmServerBackreferenceReader

        public OsmServerBackreferenceReader​(long id,
                                            OsmPrimitiveType type,
                                            boolean readFull)
        Creates a back reference reader for given primitive id
        Parameters:
        id - the id of the primitive whose referrers are to be read
        type - the type of the primitive
        readFull - true, if referrers should be read fully (i.e. including their immediate children)
        Throws:
        java.lang.IllegalArgumentException - if id <= 0
        java.lang.IllegalArgumentException - if type is null