Package com.targomo.client.api.geo
Class DefaultSourceGeometry
java.lang.Object
com.targomo.client.api.geo.AbstractLocation
com.targomo.client.api.geo.AbstractGeometry
com.targomo.client.api.geo.DefaultSourceGeometry
- All Implemented Interfaces:
Location,RoutingGeometry
Default implementation for storing source geometries.
Basically a
AbstractGeometry with TravelType, specialized to be used as a source.- Author:
- gideon
-
Field Summary
Fields inherited from class com.targomo.client.api.geo.AbstractLocation
id, properties -
Constructor Summary
ConstructorsConstructorDescriptionDefaultSourceGeometry(String id, String geojson, int crs) Generate Source geometry with ID, geojson and crs values with no travel type.DefaultSourceGeometry(String id, String geojson, int crs, boolean routeFromCentroid) DefaultSourceGeometry(String id, String geojson, int crs, TravelType travelType) Generate Source geometry with a TravelType as well as ID, geojson and crs values.DefaultSourceGeometry(String id, String geojson, int crs, TravelType travelType, boolean routeFromCentroid) 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.DefaultSourceGeometry(String id, String geojson, int crs, TravelType travelType, LocationProperties locationProperties) DefaultSourceGeometry(String id, String geojson, int crs, List<TravelType> travelTypes, boolean routeFromCentroid, LocationProperties locationProperties) -
Method Summary
Modifier and TypeMethodDescriptionbooleanlongThe main problem with this identifier is that we need it for hibernate since it's not able to work without an ID.inthashCode()voidsetIdentifier(long id) toString()Returns a JSON String representation of the LocationGeometry with ID, geojson and crs values.Methods inherited from class com.targomo.client.api.geo.AbstractGeometry
getCrs, getData, isRouteFromCentroid, setCrs, setData, setRouteFromCentroid, setTravelTypeMethods inherited from class com.targomo.client.api.geo.AbstractLocation
getId, getProperties, setId, setPropertiesMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.targomo.client.api.geo.Location
getId, getProperties, getTravelTypes, setId, setProperties, setTravelTypes
-
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 coordinategeojson- String of the geojson of the objectcrs- CRS value used for the geometrytravelType- TravelType to be associated with the coordinatelocationProperties- properties for this source
-
DefaultSourceGeometry
public DefaultSourceGeometry(String id, String geojson, int crs, TravelType travelType, LocationProperties locationProperties) -
DefaultSourceGeometry
Generate Source geometry with a TravelType as well as ID, geojson and crs values.- Parameters:
id- ID to associate with the target coordinategeojson- String of the geojson of the objectcrs- CRS value used for the geometrytravelType- TravelType to be associated with the coordinate
-
DefaultSourceGeometry
public DefaultSourceGeometry(String id, String geojson, int crs, TravelType travelType, boolean routeFromCentroid) -
DefaultSourceGeometry
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 coordinategeojson- Geojson String of the source geometrycrs- CRS value used for the geometry
-
DefaultSourceGeometry
-
-
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
Description copied from class:AbstractGeometryReturns a JSON String representation of the LocationGeometry with ID, geojson and crs values.- Overrides:
toStringin classAbstractGeometry- Returns:
- JSON representation of the geometry
-
equals
- Overrides:
equalsin classAbstractGeometry
-
hashCode
public int hashCode()- Overrides:
hashCodein classAbstractGeometry
-