Interface OSMContribution

    • Method Detail

      • getTimestamp

        OSHDBTimestamp getTimestamp()
        Returns the timestamp at which this data modification has happened.
        Returns:
        the modification timestamp as a OSHDBTimestamp object
      • getGeometryBefore

        org.locationtech.jts.geom.Geometry getGeometryBefore()
        Returns the geometry of the entity before this modification clipped to the requested area of interest. May be `null` if this is an entity creation.
        Returns:
        a JTS Geometry object representing the entity's state before the modification (clipped to the respective area of interest)
      • getGeometryUnclippedBefore

        org.locationtech.jts.geom.Geometry getGeometryUnclippedBefore()
        Returns the geometry of the entity before this modification. This is the full (unclipped) geometry of the entity. May be `null` if this is an entity creation.
        Returns:
        a JTS Geometry object representing the entity's state before the modification (not clipped to the respective area of interest)
      • getGeometryAfter

        org.locationtech.jts.geom.Geometry getGeometryAfter()
        Returns the geometry of the entity after this modification clipped to the requested area of interest. May be `null` if this is an entity deletion.
        Returns:
        a JTS Geometry object representing the entity's state after the modification (clipped to the respective area of interest)
      • getGeometryUnclippedAfter

        org.locationtech.jts.geom.Geometry getGeometryUnclippedAfter()
        Returns the geometry of the entity after this modification. This is the full (unclipped) geometry of the entity. May be `null` if this is an entity deletion.
        Returns:
        a JTS Geometry object representing the entity's state after the modification (not clipped to the respective area of interest)
      • getEntityBefore

        OSMEntity getEntityBefore()
        Returns the entity object in its state before this modification. Is `null` if this is a entity creation.
        Returns:
        the entity object as it was before this modification
      • getEntityAfter

        OSMEntity getEntityAfter()
        Returns the entity object in its state after this modification.

        If this is a entity deletion, the returned entity will have the visible flag set to false: `entity.getEntityAfter().isVisible == false`

        Returns:
        the entity object as it was after this modification
      • getOSHEntity

        OSHEntity getOSHEntity()
        The (parent) osh entity of the osm entities involved in this contribution.
        Returns:
        the OSHEntity object of this contribution
      • is

        boolean is​(ContributionType contributionType)
        Checks if this contribution is of the given contribution type.

        It can be one or more of:

        • CREATION
        • DELETION
        • TAG_CHANGE
        • GEOMETRY_CHANGE

        If this is a entity creation or deletion, the other flags are not set (even though one might argue that a just created object clearly has a different geometry than before, for example).

        Returns:
        a set of modification type this contribution made on the underlying data
      • getContributionTypes

        EnumSet<ContributionType> getContributionTypes()
        Determined the type of modification this contribution has made.

        Can be one or more of:

        • CREATION
        • DELETION
        • TAG_CHANGE
        • GEOMETRY_CHANGE

        If this is a entity creation or deletion, the other flags are not set (even though one might argue that a just created object clearly has a different geometry than before, for example).

        Returns:
        a set of modification type this contribution made on the underlying data
      • getContributorUserId

        int getContributorUserId()
        Returns the user id of the osm contributor responsible for this data modification.

        This user id can be different from what one gets by calling `.getEntityAfter().getUserId()` if the contribution is a pure geometry change (i.e. the entity itself has not ben modified, but one or more of its child entities):

        If the entity is a way or relation, and in a contribution *"only"* the geometry has been changed, we can't find out the respective contributor's user id only by looking at the entity alone – instead, we need to iterate over all the entity's children to find the actual contributor's user id.

        Returns:
        returns the user id of the contributor who made this modification
      • getChangesetId

        long getChangesetId()
        Returns the osm changeset id of the contribution.
        Returns:
        the id of the osm changeset represented by the current contribution object