AnyLogic
Expand
Font size
All Implemented Interfaces:
IGeographicSearchEntry, AggregatableAnimationElement, AnimationStaticLocationProvider, INetworkMarkupElement, INode<GISNode,GISRoute>, SVGElement, Serializable

public class GISPoint
extends GISNode
See Also:
Serialized Form

Constructor Summary

ConstructorDescription
GISPoint(ShapeGISMap map, boolean isPermanent, double latitude, double longitude) 
GISPoint(ShapeGISMap map, boolean isPermanent, double latitude, double longitude, double radius, Paint fillColor, Paint lineColor, double linewidth, LineStyle lineStyle, String title) 
GISPoint(ShapeGISMap map, double latitude, double longitude) 

Method Summary

Modifier and TypeMethodDescription
booleancontains(double lat, double lon)
Check this element contains a point with given coordinates.
com.bbn.openmap.omGraphics.OMGraphiccreateOMGraphicObject()
Deprecated.
doubledistance(double latitude, double longitude)
Calculates distance from this point to another.
doubledistance(double latitude, double longitude, LengthUnits units)
Calculates distance from this point to another.
doubledistance(GISPoint givenPoint)
Calculates distance from this point to another.
doubledistance(GISPoint givenPoint, LengthUnits units)
Calculates distance from this point to another.
doublegetLatitude()
Returns the latitude of this gis point
PointgetLocation()
Returns the (latitude, longidute) of this GIS point
PointgetLocation(Point out)
Returns the (latitude, longidute) of this GIS point, uses the given out instance, if not null
doublegetLongitude()
Returns the longitude of this gis point
doublegetNearestPoint(double lat, double lon, Point out) 
doublegetNearestPoint(Point givenPoint, Point out)
Calculates (using the output object) the point in this space markup element nearest to the given point.
PositiongetPosition(int index, int totalNumber, Position out)
Returns the item position with the given index.
In case of any wrong argument returns zero-index position (position for index=0 with totalNumber=1).
doublegetRadius()
Returns radius of the circle of this GIS point
PointrandomPointInside(Random rng, Point out)
Returns the randomly chosen point inside/along the given space markup element.
voidsetRadius(double radius)
Dynamically changes radius of GISPoint
StringtoString() 

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Methods inherited from interface com.anylogic.engine.markup.AggregatableAnimationElement

postInitialize

Methods inherited from interface com.anylogic.engine.markup.AnimationStaticLocationProvider

getSpace

Methods inherited from interface com.anylogic.engine.markup.INetworkMarkupElement

getNetwork, getSpace, randomPointInside, randomPointInside, randomPointInside

Methods inherited from interface com.anylogic.engine.markup.INode

getLineColor, getLineTexture, getName, setLineColor

Constructor Details

GISPoint

public GISPoint(ShapeGISMap map,
 boolean isPermanent,
 double latitude,
 double longitude)

GISPoint

public GISPoint(ShapeGISMap map,
 double latitude,
 double longitude)

GISPoint

public GISPoint(ShapeGISMap map,
 boolean isPermanent,
 double latitude,
 double longitude,
 double radius,
 Paint fillColor,
 Paint lineColor,
 double linewidth,
 LineStyle lineStyle,
 String title)

Method Details

getLatitude

public double getLatitude()
Returns the latitude of this gis point
Returns:
point latitude

getLongitude

public double getLongitude()
Returns the longitude of this gis point
Returns:
point longitude

getNearestPoint

public double getNearestPoint(double lat,
 double lon,
 Point out)
Parameters:
latitude -
longitude -
out -
Returns:
distance, in meters.

getNearestPoint

public double getNearestPoint(Point givenPoint,
 Point out)
Description copied from interface: INetworkMarkupElement
Calculates (using the output object) the point in this space markup element nearest to the given point. Returns the square of distance to the point.
Parameters:
givenPoint - given point
out - the output point to write result to.
Returns:
the square of distance to the nearest point

contains

public boolean contains(double lat,
 double lon)
Description copied from interface: INetworkMarkupElement
Check this element contains a point with given coordinates. measured in degrees (-90 ... (South) ... 0 ... (North) ... +90), y coordinate is the longitude of the current location, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180),
Parameters:
lat - the x coordinate of the given point.
In case of GIS environment this is the longitude of the given point, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
Returns:

createOMGraphicObject

@AnyLogicInternalAPI
@Deprecated
public com.bbn.openmap.omGraphics.OMGraphic createOMGraphicObject()
Deprecated.
Specified by:
createOMGraphicObject in class GISMarkupElement

getLocation

public Point getLocation()
Returns the (latitude, longidute) of this GIS point
Returns:
the (latitude, longidute) of this GIS point

getLocation

public Point getLocation(Point out)
Returns the (latitude, longidute) of this GIS point, uses the given out instance, if not null
Parameters:
out - the Point object to write to, may be null
Returns:
the (latitude, longidute) of this GIS point

getPosition

public Position getPosition(int index,
 int totalNumber,
 Position out)
Description copied from interface: AnimationStaticLocationProvider
Returns the item position with the given index.
In case of any wrong argument returns zero-index position (position for index=0 with totalNumber=1).
Parameters:
index - the index of some item positions, should be not negative and less than totalNumber
totalNumber - the total number of item positions, should be positive
out - output object to write to, may be null
Returns:
the Position object with coordinates of the requested item position

setRadius

public void setRadius(double radius)
Dynamically changes radius of GISPoint
Parameters:
radius - measured in pixels

getRadius

public double getRadius()
Returns radius of the circle of this GIS point
Returns:
radius measured in pixels

randomPointInside

public Point randomPointInside(Random rng,
 Point out)
Description copied from interface: INetworkMarkupElement
Returns the randomly chosen point inside/along the given space markup element. This method utilises the given Random Number Generator.
Parameters:
rng - the random number generator.
out - output object to write to, may be null
Returns:
the randomly chosen point

distance

public double distance(double latitude,
 double longitude)
Calculates distance from this point to another.
Parameters:
latitude -
longitude -
Returns:
distance in meters

distance

public double distance(double latitude,
 double longitude,
 LengthUnits units)
Calculates distance from this point to another.
Parameters:
latitude -
longitude -
units - the units of length
Returns:
distance in given length units

distance

public double distance(GISPoint givenPoint)
Calculates distance from this point to another.
Parameters:
givenPoint -
Returns:
distance in meters

distance

public double distance(GISPoint givenPoint,
 LengthUnits units)
Calculates distance from this point to another.
Parameters:
givenPoint -
units - the units of length
Returns:
distance in given length units

toString

public String toString()
Overrides:
toString in class Object