Class DefaultSourceGeometry

All Implemented Interfaces:
Location, RoutingGeometry

@Entity public class DefaultSourceGeometry extends AbstractGeometry
Default implementation for storing source geometries. Basically a AbstractGeometry with TravelType, specialized to be used as a source.
Author:
gideon
  • Constructor Details

    • DefaultSourceGeometry

      public DefaultSourceGeometry(String id, String geojson, int crs, List<TravelType> travelTypes, boolean routeFromCentroid, LocationProperties locationProperties)
    • DefaultSourceGeometry

      public DefaultSourceGeometry(String id, String geojson, int crs, TravelType travelType, boolean routeFromCentroid, LocationProperties locationProperties)
      Generate Source geometry with a TravelType as well as ID, geojson and crs values.
      Parameters:
      id - ID to associate with the target coordinate
      geojson - String of the geojson of the object
      crs - CRS value used for the geometry
      travelType - TravelType to be associated with the coordinate
      locationProperties - properties for this source
    • DefaultSourceGeometry

      public DefaultSourceGeometry(String id, String geojson, int crs, TravelType travelType, LocationProperties locationProperties)
    • DefaultSourceGeometry

      public DefaultSourceGeometry(String id, String geojson, int crs, TravelType travelType)
      Generate Source geometry with a TravelType as well as ID, geojson and crs values.
      Parameters:
      id - ID to associate with the target coordinate
      geojson - String of the geojson of the object
      crs - CRS value used for the geometry
      travelType - TravelType to be associated with the coordinate
    • DefaultSourceGeometry

      public DefaultSourceGeometry(String id, String geojson, int crs, TravelType travelType, boolean routeFromCentroid)
    • DefaultSourceGeometry

      public DefaultSourceGeometry(String id, String geojson, int crs)
      Generate Source geometry with ID, geojson and crs values with no travel type. Travel type will be set to null.
      Parameters:
      id - ID to associate with the target coordinate
      geojson - Geojson String of the source geometry
      crs - CRS value used for the geometry
    • DefaultSourceGeometry

      public DefaultSourceGeometry(String id, String geojson, int crs, boolean routeFromCentroid)
  • Method Details

    • getIdentifier

      public long getIdentifier()
      The main problem with this identifier is that we need it for hibernate since it's not able to work without an ID. But source geometries have per se no real identifier since the same geometry could come from multiple clients and have different lat/lng/traveltype.
      Returns:
      this database unique identifier of this source point
    • setIdentifier

      public void setIdentifier(long id)
    • toString

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

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

      public int hashCode()
      Overrides:
      hashCode in class AbstractGeometry