Class FlaggedRelation

  • All Implemented Interfaces:
    java.io.Serializable, org.openstreetmap.atlas.geography.Located

    public class FlaggedRelation
    extends FlaggedObject
    A flag for a Relation
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      FlaggedRelation​(org.openstreetmap.atlas.geography.atlas.items.Relation relation)  
      FlaggedRelation​(org.openstreetmap.atlas.geography.atlas.items.Relation relation, org.openstreetmap.atlas.geography.MultiPolygon geoJsonGeometry)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.google.gson.JsonObject asGeoJsonFeature​(java.lang.String flagIdentifier)
      A GeoJSON representation of the flagged object.
      org.openstreetmap.atlas.geography.Rectangle bounds()  
      boolean equals​(java.lang.Object other)  
      FlaggedObject getAsCompleteFlaggedObject()
      Return either itself or a copy of itself where there is no memory reference to an Atlas.
      java.lang.String getCountry()  
      java.lang.Iterable<org.openstreetmap.atlas.geography.Location> getGeometry()
      As relations itself do not have a geometry, the geometry of FlaggedRelation is set to null.
      protected java.util.Optional<org.openstreetmap.atlas.geography.atlas.items.AtlasObject> getObject()  
      java.util.Map<java.lang.String,​java.lang.String> getProperties()  
      int hashCode()  
      boolean isMultipolygonRelation()
      Helper method to check FlaggedRelation is of multipolygon type
      org.openstreetmap.atlas.geography.atlas.items.RelationMemberList members()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.openstreetmap.atlas.geography.Located

        within
    • Constructor Detail

      • FlaggedRelation

        public FlaggedRelation​(org.openstreetmap.atlas.geography.atlas.items.Relation relation)
      • FlaggedRelation

        public FlaggedRelation​(org.openstreetmap.atlas.geography.atlas.items.Relation relation,
                               org.openstreetmap.atlas.geography.MultiPolygon geoJsonGeometry)
    • Method Detail

      • asGeoJsonFeature

        public com.google.gson.JsonObject asGeoJsonFeature​(java.lang.String flagIdentifier)
        A GeoJSON representation of the flagged object.
        Specified by:
        asGeoJsonFeature in class FlaggedObject
        Parameters:
        flagIdentifier - We always will want to know the id of the flag associated with this flag object.
        Returns:
        GeoJSON representation of the flagged object.
      • bounds

        public org.openstreetmap.atlas.geography.Rectangle bounds()
        Returns:
        The bounds of the object.
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class FlaggedObject
      • getAsCompleteFlaggedObject

        public FlaggedObject getAsCompleteFlaggedObject()
        Description copied from class: FlaggedObject
        Return either itself or a copy of itself where there is no memory reference to an Atlas.
        Specified by:
        getAsCompleteFlaggedObject in class FlaggedObject
        Returns:
        Flagged Object with no memory reference to an Atlas
      • getCountry

        public java.lang.String getCountry()
        Overrides:
        getCountry in class FlaggedObject
        Returns:
        ISO country code of the country
      • getGeometry

        public java.lang.Iterable<org.openstreetmap.atlas.geography.Location> getGeometry()
        As relations itself do not have a geometry, the geometry of FlaggedRelation is set to null.
        Specified by:
        getGeometry in class FlaggedObject
        Returns:
        flagged geometry
      • getProperties

        public java.util.Map<java.lang.String,​java.lang.String> getProperties()
        Specified by:
        getProperties in class FlaggedObject
        Returns:
        flag key-value property map
      • isMultipolygonRelation

        public boolean isMultipolygonRelation()
        Helper method to check FlaggedRelation is of multipolygon type
        Returns:
        true if the flagged relation is a multipolygon
      • members

        public org.openstreetmap.atlas.geography.atlas.items.RelationMemberList members()
        Returns:
        list of all members of the relation
      • getObject

        protected java.util.Optional<org.openstreetmap.atlas.geography.atlas.items.AtlasObject> getObject()
        Specified by:
        getObject in class FlaggedObject