Package com.anylogic.engine.markup
- java.lang.Object
- com.anylogic.engine.markup.AbstractMarkupSegment
- com.anylogic.engine.markup.GISMarkupSegment
- com.anylogic.engine.markup.GISMarkupSegmentLine
- All Implemented Interfaces:
IMarkupSegment
,Serializable
public class GISMarkupSegmentLine extends GISMarkupSegment
Straight markup segment for GIS space.
- Author:
- AnyLogic North America, LLC https://anylogic.com
- See Also:
- Serialized Form
Constructor | Description |
---|---|
GISMarkupSegmentLine() | |
GISMarkupSegmentLine | |
GISMarkupSegmentLine | |
GISMarkupSegmentLine | |
GISMarkupSegmentLine | |
GISMarkupSegmentLine | |
GISMarkupSegmentLine |
Modifier and Type | Method | Description |
---|---|---|
void | addTo |
Adds this segment to the given path assuming that path is currently positioned on
the start point of this segment
|
double | getDistanceSq |
Calculates and returns the square of distance to the given latitude and longitude
|
double | getDistanceSq |
Calculates and returns the square of distance to the given point.
|
Point | getEnd |
Gets end point of markup segment.
|
Position | getEnd |
Returns the location of the end position of the segment
|
double | getNearestPoint |
Calculates (using the
out object) the point in
this space markup element nearest to the given (lat, lon) point. |
double | getNearestPoint |
For horizontal segments, calculates (using the
output object) the point in
this space markup element nearest to the given (x, y) point. |
double | getNearestPointOnRay2D |
Calculates (and sets in the 'out' object) the point where this segment intersects
the given ray with the minimum distance from ray beginning (if there are several
intersection points like in arc segments).
|
double | getOffsetOfPoint |
Calculates distance by segment to the given point.
|
Point | getStart |
Gets start point of markup segment.
|
Position | getStart |
Returns the location of the start position of the segment
|
void | initialize() | |
void | setStart |
Sets start point of this segment.
|
public GISMarkupSegmentLine()
public GISMarkupSegmentLine(double slat, double slon, double elat, double elon)
public GISMarkupSegmentLine(double slat, double slon, double elat, double elon, boolean isGeodesic)
public GISMarkupSegmentLine(GISMarkupSegment s, double realLength)
public GISMarkupSegmentLine(GISMarkupSegment s, double realLength, boolean isGeodesic)
public GISMarkupSegmentLine(double slat, double slon, double elat, double elon, double realLength)
public GISMarkupSegmentLine(double slat, double slon, double elat, double elon, double realLength, boolean isGeodesic)
public void initialize()
public double getNearestPoint(double lat, double lon, Point out)
Calculates (using the
out
object) the point in
this space markup element nearest to the given (lat, lon) point.
Returns the square of distance to the given point.- Parameters:
lat
- the latitude of given point measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)lon
- the longitude of given point measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)out
- the output point to write result to. Note thatoutput.z
is left unchanged.- Returns:
- the square of distance to the nearest point
public double getNearestPoint(Point givenPoint, Point out)
Description copied from interface:
IMarkupSegment
For horizontal segments, calculates (using the
output
object) the point in
this space markup element nearest to the given (x, y) point.
Returns the square of distance to the point (in the XY-projection).
All the calculations are performed in the horizontal projection (z-coordinates aren't used,
as if all of the z coordinates were zero).out
- the output point to write result to. Note thatoutput.z
is left unchanged.- Returns:
- the square of distance to the nearest point in the horizontal (XY) projection
public double getOffsetOfPoint(double lat, double lon)
Description copied from interface:
IMarkupSegment
Calculates distance by segment to the given point. Point is specified by a pair of coordinates.
The given point should by on this segment.
- Parameters:
lat
- the x coordinate of the given point.
In case of GIS space this is the latitude of the given point, measured in degrees (-90 ... (South) ... 0 ... (North) ... +90)lon
- the y coordinate of the given point
In case of GIS space this is the longitude of the given point, measured in degrees (-180 ... (West) ... 0 ... (East) ... +180)- Returns:
- the distance by segment to the given point
public Point getStart(Point out)
Description copied from interface:
IMarkupSegment
Gets start point of markup segment.
- Parameters:
out
- the point to store the result of method's execution- Returns:
- the start point of this segment
public Point getEnd(Point out)
Description copied from interface:
IMarkupSegment
Gets end point of markup segment.
- Parameters:
out
- the point to store the result of method's execution- Returns:
- the start point of this segment
public double getNearestPointOnRay2D(double lat1, double lon1, double lat2, double lon2, Point out)
Description copied from interface:
IMarkupSegment
Calculates (and sets in the 'out' object) the point where this segment intersects
the given ray with the minimum distance from ray beginning (if there are several
intersection points like in arc segments). Returns the square of that distance.
Returns
Returns
+infinity
if there is no intersections.- Parameters:
lat1
- the X coordinate of the start point of the raylon1
- the Y coordinate of the start point of the raylat2
- the X coordinate of some point on the raylon2
- the Y coordinate of some point on the rayout
- the Point object to write result to- Returns:
- the square of the distance from ray beginning to the nearest intersection point
or
+infinity
if there is no intersections
public void addTo(Path2D path)
Description copied from interface:
IMarkupSegment
Adds this segment to the given path assuming that path is currently positioned on
the start point of this segment
- Parameters:
path
- the path to add this segment to
public void setStart(Point startPoint)
Description copied from interface:
IMarkupSegment
Sets start point of this segment.
- Specified by:
setStart
in interfaceIMarkupSegment
- Overrides:
setStart
in classGISMarkupSegment
- Parameters:
startPoint
- the point to set as start point of this segment
public double getDistanceSq(double lat, double lon)
Calculates and returns the square of distance to the given latitude and longitude
- Parameters:
lat
- latitudelon
- longitude- Returns:
- squared distance
public double getDistanceSq(Point givenPoint)
Description copied from interface:
IMarkupSegment
Calculates and returns the square of distance to the given point.
- Returns:
- the square of distance to the given point
public Position getStart(Position out)
Description copied from class:
AbstractMarkupSegment
Returns the location of the start position of the segment
- Specified by:
getStart
in classAbstractMarkupSegment
- Parameters:
out
- output object to write to, may benull
- Returns:
- the Position object with coordinates of the segment start
public Position getEnd(Position out)
Description copied from class:
AbstractMarkupSegment
Returns the location of the end position of the segment
- Specified by:
getEnd
in classAbstractMarkupSegment
- Parameters:
out
- output object to write to, may benull
- Returns:
- the Position object with coordinates of the segment end