Class AbstractGeometry

java.lang.Object
com.targomo.client.api.geo.AbstractLocation
com.targomo.client.api.geo.AbstractGeometry
All Implemented Interfaces:
Location, RoutingGeometry
Direct Known Subclasses:
DefaultSourceGeometry

@MappedSuperclass public abstract class AbstractGeometry extends AbstractLocation implements RoutingGeometry
Simple abstract class to use for storing geometry data with IDs and travel types.
Author:
gideon
  • Constructor Details

    • AbstractGeometry

      public AbstractGeometry()
    • AbstractGeometry

      public AbstractGeometry(String id, Integer crs, String data, boolean routeFromCentroid, LocationProperties locationProperties)
  • Method Details

    • getData

      public String getData()
      Specified by:
      getData in interface RoutingGeometry
      Returns:
      the string representation of this geometry
    • getCrs

      public Integer getCrs()
      Specified by:
      getCrs in interface RoutingGeometry
      Returns:
      the coordinate reference system for this geometry
    • isRouteFromCentroid

      public boolean isRouteFromCentroid()
      Returns:
      route from geometry centroid boolean
    • setData

      public void setData(String data)
      Specified by:
      setData in interface RoutingGeometry
      Parameters:
      data - the string representation of this geometry
    • setCrs

      public void setCrs(Integer crs)
      Specified by:
      setCrs in interface RoutingGeometry
      Parameters:
      crs - coordinate reference system for this geometry
    • setRouteFromCentroid

      public void setRouteFromCentroid(Boolean routeFromCentroid)
      Parameters:
      routeFromCentroid - if true route from/to the centroid of this geometry when no intersections found
    • setTravelType

      public void setTravelType(TravelType travelType)
      Set the travel type to use when routing.
      Specified by:
      setTravelType in interface Location
      Parameters:
      travelType - Travel type to be associated with the coordinate.
    • toString

      public String toString()
      Returns a JSON String representation of the LocationGeometry with ID, geojson and crs values.
      Overrides:
      toString in class Object
      Returns:
      JSON representation of the geometry
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object