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

public class GISRegion
extends GISNode
Geographic region in GIS space. Could be a part of a network.
Author:
AnyLogic North America, LLC https://anylogic.com
See Also:
Serialized Form

Constructor Summary

Constructors 
GISRegion​(ShapeGISMap map, boolean isPermanent, double[] latitudes, double[] longitudes, java.awt.Paint fillColor, java.awt.Paint lineColor, double lineWidth, LineStyle linestyle, java.lang.String title, double realArea)  
GISRegion​(ShapeGISMap map, boolean isPermanent, double[] latLonPairs, java.awt.Paint fillColor, java.awt.Paint lineColor, double lineWidth, LineStyle linestyle, java.lang.String title, double realArea)  
GISRegion​(ShapeGISMap map, double[] latLonPairs)
Geographical region defined by a list of latitude-longitude coordinate pairs.
Constructor Description

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods 
double area()
Returns the area of this region (measured in m2)
double area​(AreaUnits units)
Returns the area of this region (measured in @units)
boolean contains​(double lat, double lon)
Check this element contains a point with given coordinates.
com.bbn.openmap.omGraphics.OMGraphic createOMGraphicObject()
Deprecated.
void doInitialize()  
double getNearestPoint​(double lat, double lon, Point out)
Calculates (using the output object) the point in this space markup element nearest to the given point.
double getNearestPoint​(Point givenPoint, Point out)
Calculates (using the output object) the point in this space markup element nearest to the given point.
double[] getPoints()
Returns an array of decimal degree values in format [lat1, lon1, lat2, lon2, ... , latN, lonN] where N is amount of points in this region.
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).
Point randomPointInside​(java.util.Random rng, Point out)
Returns the randomly chosen point inside/along the given space markup element.
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, toString, 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

GISRegion

public GISRegion​(ShapeGISMap map,
                 double[] latLonPairs)
Geographical region defined by a list of latitude-longitude coordinate pairs.
Parameters:
map - ShapeGISMap object for drawing element
latLonPairs - array of latitude-longitude coordinate pairs [latitude1, longitude1, latitude2, longitude2, ...]

GISRegion

public GISRegion​(ShapeGISMap map,
                 boolean isPermanent,
                 double[] latitudes,
                 double[] longitudes,
                 java.awt.Paint fillColor,
                 java.awt.Paint lineColor,
                 double lineWidth,
                 LineStyle linestyle,
                 java.lang.String title,
                 double realArea)

GISRegion

public GISRegion​(ShapeGISMap map,
                 boolean isPermanent,
                 double[] latLonPairs,
                 java.awt.Paint fillColor,
                 java.awt.Paint lineColor,
                 double lineWidth,
                 LineStyle linestyle,
                 java.lang.String title,
                 double realArea)

Method Detail

doInitialize

public void doInitialize()

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:

getNearestPoint

public double getNearestPoint​(double lat,
                              double lon,
                              Point out)
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:
lat - latitude measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)
lon - longitude measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)
out - nearest point to given point in GIS region
Returns:
the square of distance in meters to the nearest point

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

createOMGraphicObject

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

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

area

public double area()
Returns the area of this region (measured in m2)
Returns:
the area of this region

area

public double area​(AreaUnits units)
Returns the area of this region (measured in @units)
Returns:
the area of this region

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

getPoints

public double[] getPoints()
Returns an array of decimal degree values in format [lat1, lon1, lat2, lon2, ... , latN, lonN] where N is amount of points in this region.
Returns:
lat,lon array representing decimal degrees of points.
How can we improve this article?