Package com.targomo.client.api.geo
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
-
Field Summary
Fields inherited from class com.targomo.client.api.geo.AbstractLocation
id, properties -
Constructor Summary
ConstructorsConstructorDescriptionAbstractGeometry(String id, Integer crs, String data, boolean routeFromCentroid, LocationProperties locationProperties) -
Method Summary
Modifier and TypeMethodDescriptionbooleangetCrs()getData()inthashCode()booleanvoidvoidvoidsetRouteFromCentroid(Boolean routeFromCentroid) voidsetTravelType(TravelType travelType) Set the travel type to use when routing.toString()Returns a JSON String representation of the LocationGeometry with ID, geojson and crs values.Methods 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
-
AbstractGeometry
public AbstractGeometry() -
AbstractGeometry
public AbstractGeometry(String id, Integer crs, String data, boolean routeFromCentroid, LocationProperties locationProperties)
-
-
Method Details
-
getData
- Specified by:
getDatain interfaceRoutingGeometry- Returns:
- the string representation of this geometry
-
getCrs
- Specified by:
getCrsin interfaceRoutingGeometry- Returns:
- the coordinate reference system for this geometry
-
isRouteFromCentroid
public boolean isRouteFromCentroid()- Returns:
- route from geometry centroid boolean
-
setData
- Specified by:
setDatain interfaceRoutingGeometry- Parameters:
data- the string representation of this geometry
-
setCrs
- Specified by:
setCrsin interfaceRoutingGeometry- Parameters:
crs- coordinate reference system for this geometry
-
setRouteFromCentroid
- Parameters:
routeFromCentroid- if true route from/to the centroid of this geometry when no intersections found
-
setTravelType
Set the travel type to use when routing.- Specified by:
setTravelTypein interfaceLocation- Parameters:
travelType- Travel type to be associated with the coordinate.
-
toString
Returns a JSON String representation of the LocationGeometry with ID, geojson and crs values. -
equals
-
hashCode
public int hashCode()
-