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

public class GISPoint
extends GISNode
See Also:
Serialized Form

Constructor Summary

Constructors 
GISPoint​(ShapeGISMap map, boolean isPermanent, double latitude, double longitude)  
GISPoint​(ShapeGISMap map, boolean isPermanent, double latitude, double longitude, double radius, java.awt.Paint fillColor, java.awt.Paint lineColor, double linewidth, LineStyle lineStyle, java.lang.String title)  
GISPoint​(ShapeGISMap map, double latitude, double longitude)  
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods 
boolean contains​(double lat, double lon)
Check this element contains a point with given coordinates.
com.bbn.openmap.omGraphics.OMGraphic createOMGraphicObject()
Deprecated.
double distance​(double latitude, double longitude)
Calculates distance from this point to another.
double distance​(double latitude, double longitude, LengthUnits units)
Calculates distance from this point to another.
double distance​(GISPoint givenPoint)
Calculates distance from this point to another.
double distance​(GISPoint givenPoint, LengthUnits units)
Calculates distance from this point to another.
double getLatitude()
Returns the latitude of this gis point
Point getLocation()
Returns the (latitude, longidute) of this GIS point
Point getLocation​(Point out)
Returns the (latitude, longidute) of this GIS point, uses the given out instance, if not null
double getLongitude()
Returns the longitude of this gis point
double getNearestPoint​(double lat, double lon, Point out)  
double getNearestPoint​(Point givenPoint, Point out)
Calculates (using the output object) the point in this space markup element nearest to the given point.
Position getPosition​(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).
double getRadius()
Returns radius of the circle of this GIS point
Point randomPointInside​(java.util.Random rng, Point out)
Returns the randomly chosen point inside/along the given space markup element.
void setRadius​(double radius)
Dynamically changes radius of GISPoint
java.lang.String toString()  
Modifier and Type Method Description

Methods inherited from class com.anylogic.engine.markup.GISNode

addConnection, getCompatibleAgentExtensionClass, getConnection, getConnectionsCount, getFillColor, getFillTexture, getTitle, getTransferDistance, getTransferPositionByPercent, setFillColor, setTitle

Methods inherited from class com.anylogic.engine.markup.GISMarkupElement

discardOwner, error, getFromOMGraphic, getLineColor, getLineStyle, getLineTexture, getLineWidth, getNetwork, getOmGraphic, getSpace, initialize, onAggregatorVisibilityChanged, remove, setLineColor, setLineStyle, setLineWidth, setOwner, setVisible

Methods inherited from class com.anylogic.engine.markup.AbstractMarkup

executeUserAction, findSVGElement, getDrawMode, getName, getSVGId, initializeInternal, isPublic, isVisible, onAggregatorInitialized, removeSVGFromOwner, resetSVGState, updateDynamicProperties, updateDynamicPropertiesStructural, updateSVGProperties

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 Detail

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,
                java.awt.Paint fillColor,
                java.awt.Paint lineColor,
                double linewidth,
                LineStyle lineStyle,
                java.lang.String title)

Method Detail

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​(java.util.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 java.lang.String toString()
Overrides:
toString in class java.lang.Object
How can we improve this article?