AnyLogic
Expand
Font size
All Implemented Interfaces:
IGeographicSearchEntry, AggregatableAnimationElement, AnimationStaticLocationProvider, INetworkMarkupElement, INode<GISNode,GISRoute>, SVGElement, 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

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

Method Summary

Modifier and TypeMethodDescription
doublearea()
Returns the area of this region (measured in m2)
doublearea(AreaUnits units)
Returns the area of this region (measured in @units)
booleancontains(double lat, double lon)
Check this element contains a point with given coordinates.
com.bbn.openmap.omGraphics.OMGraphiccreateOMGraphicObject()
Deprecated.
voiddoInitialize() 
doublegetNearestPoint(double lat, double lon, Point out)
Calculates (using the output object) the point in this space markup element nearest to the given point.
doublegetNearestPoint(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, ...
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).
PointrandomPointInside(Random rng, Point out)
Returns the randomly chosen point inside/along the given space markup element.

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 Details

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,
 Paint fillColor,
 Paint lineColor,
 double lineWidth,
 LineStyle linestyle,
 String title,
 double realArea)

GISRegion

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

Method Details

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(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.