public class GenericLocation extends Object implements Cloneable, Serializable
Modifier and Type | Field and Description |
---|---|
Integer |
edgeId
The ID of the edge this location is on if any.
|
Double |
heading
Observed heading if any.
|
Double |
lat
Coordinates of the place, if provided.
|
Double |
lng |
String |
name
The name of the place, if provided.
|
String |
place
The identifier of the place, if provided.
|
Constructor and Description |
---|
GenericLocation()
Constructs an empty GenericLocation.
|
GenericLocation(org.locationtech.jts.geom.Coordinate coord)
Constructs a GenericLocation with coordinates only.
|
GenericLocation(double lat,
double lng)
Constructs a GenericLocation with coordinates only.
|
GenericLocation(double lat,
double lng,
double heading)
Constructs a GenericLocation with coordinates and heading.
|
GenericLocation(NamedPlace np)
Same as above, but draws name and place string from a NamedPlace object.
|
GenericLocation(String name,
String place)
Construct from a name, place pair.
|
Modifier and Type | Method and Description |
---|---|
GenericLocation |
clone() |
static GenericLocation |
fromOldStyleString(String input)
Creates the GenericLocation by parsing a "name::place" string, where "place" is a latitude,longitude string or a vertex ID.
|
org.locationtech.jts.geom.Coordinate |
getCoordinate()
Returns this as a Coordinate object.
|
NamedPlace |
getNamedPlace() |
boolean |
hasCoordinate()
Returns true if getCoordinate() will not return null.
|
boolean |
hasEdgeId()
Returns true if getEdgeId would not return null.
|
boolean |
hasHeading()
Returns true if this.heading is not null.
|
boolean |
hasName()
Returns true if this.name is set.
|
boolean |
hasPlace()
Returns true if this.place is set.
|
String |
toDescriptiveString()
Returns a descriptive string that has the information that I wish toString() returned.
|
String |
toString()
Represents the location as an old-style string for clients that relied on that behavior.
|
public final String name
public final String place
public Integer edgeId
public Double lat
public Double lng
public Double heading
public GenericLocation()
public GenericLocation(double lat, double lng)
public GenericLocation(org.locationtech.jts.geom.Coordinate coord)
public GenericLocation(double lat, double lng, double heading)
public GenericLocation(String name, String place)
public GenericLocation(NamedPlace np)
np
- public static GenericLocation fromOldStyleString(String input)
input
- public boolean hasHeading()
public boolean hasName()
public boolean hasPlace()
public boolean hasCoordinate()
public boolean hasEdgeId()
public NamedPlace getNamedPlace()
public org.locationtech.jts.geom.Coordinate getCoordinate()
public String toString()
public String toDescriptiveString()
public GenericLocation clone()
Copyright © 2019. All rights reserved.