Package com.anylogic.engine.gis
- java.lang.Object
- com.anylogic.engine.gis.BasicGISUtils
public class BasicGISUtils extends Object
Modifier and Type | Class | Description |
---|---|---|
static interface | BasicGISUtils.DistanceFunction |
Modifier and Type | Method | Description |
---|---|---|
static double | getDistanceGIS |
Returns the distance measured in meters between two given points
|
static double | getGISRegionArea | |
static double[] | getSimplifiedRoute |
Generalizes the given curve.
|
static double | getSphericalAzimuth | |
static double | getSphericalDistance |
Distance from one geographic point to another in radians
|
static com.bbn.openmap.proj.Projection | makeProjection |
Create a Mercator projection.
|
static void | readShapeFile |
Reads the given shapefile (with optional filtering, e.g.
|
static String | shapeFileNameToSVGFileName |
public static double getDistanceGIS(double latitude1, double longitude1, double latitude2, double longitude2)
Returns the distance measured in meters between two given points
- Parameters:
latitude1
- the latitude of first point measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)longitude1
- the longitude of first point measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)latitude2
- the latitude of second point measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)longitude2
- the longitude of second point measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)- Returns:
- distance between two points measured in meters
public static double getGISRegionArea(double[] latlondeg)
public static double getSphericalDistance(double latitude1, double longitude1, double latitude2, double longitude2)
Distance from one geographic point to another in radians
- Parameters:
latitude1
- the latitude of first point measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)longitude1
- the longitude of first point measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)latitude2
- the latitude of second point measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)longitude2
- the longitude of second point measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)- Returns:
- distance measured in radians
public static double getSphericalAzimuth(double latitude1, double longitude1, double latitude2, double longitude2)
public static double[] getSimplifiedRoute(double[] latLonPoints, double generalizationPrecision, BasicGISUtils.DistanceFunction distanceFunction)
Generalizes the given curve.
Note the different format of returned result.
- Parameters:
latLonPoints
- (lat, lon) pairs representing, the start, then optional intermediate, and the end points, followed by a single number with the total distance. Array length is 2*N+1, where N is number of points.generalizationPrecision
-distanceFunction
-- Returns:
- array comprising the array of N (lat, lon) pairs, then array of N-1 segment lengths, then a single number with the total distance.
Given ther
result of this method call, the first segment would start atr[0], r[1]
, end atr[2], r[3]
and will have 'real' distance length ofr[r.length / 3 * 2 + 0]
.
@AnyLogicInternalAPI public static com.bbn.openmap.proj.Projection makeProjection(double centerLatitude, double centerLongitude, double projectionScale, int width, int height)
Create a Mercator projection.
- Parameters:
centerLatitude
- the latitude of projection's centercenterLongitude
- the longitude of projection's centerprojectionScale
- the scale for projection within the range from 0 to 1width
- the width of new projection measured in pixelsheight
- the height of new projection measured in pixels- Returns:
- projection, or null if the projection can't be created.
public static String shapeFileNameToSVGFileName(String shapefilename)
public static void readShapeFile(String shapefilePath, BiFunction<org.geotools.api.filter.FilterFactory, org.geotools.api.feature.type.FeatureType, org.geotools.api.filter.Filter> filterProvider, BiConsumer<org.locationtech.jts.geom.Geometry, org.geotools.api.feature.simple.SimpleFeature> action)
Reads the given shapefile (with optional filtering, e.g. by clipping or by name) and executes the given
action for each element found (which could be a geometry of polyline, polygon, point, or a collection of those)
- Parameters:
shapefilePath
- path to shapefilefilterProvider
- details and example are inShapeGISMap.Layer#forAllObjects(java.util.function.BiFunction, java.util.function.BiConsumer)
action
- details and example are inShapeGISMap.Layer#forAllObjects(java.util.function.BiConsumer)