With the help of the GIS route, you can draw routes on the map to define a road, a railroad, a river, or any other kind of line on the map. Each point of the route has the latitude and longitude coordinates, defined in degrees.
You can add
GIS Route
element only onto the GIS map. Add the
GIS map
shape to your model before you use GIS markup elements.
Name - The name of the route. The name is used to identify and access the route from code.
Ignore - If selected, the route is excluded from the model.
Visible - Here you specify route is visible on the animation at the model runtime, or not. Using the control, choose yes or no if you want to specify the visibility just once. Otherwise, if you expect visibility to change dynamically or to depend on some other conditions, you may specify here the expression defining the route's visibility. This expression will be dynamically re-evaluated at the model runtime. It should return boolean value. The route is visible when the specified expression evaluates to true, and not visible otherwise.
Lock the position - If this option is selected, the shape's position on the map is fixed. The shape cannot be moved, but you can select it to change other properties.
Bidirectional - If this option is selected, the route is bidirectional. Deselect it, if you want the route to have one specific direction.
Line color - The line color. Click the control and choose a color using the Colors dialog box. Choose No Color, if you do not want the line to be drawn.
Line width - Choose line width from the drop-down list, or enter the value in pixels in the field to the right. You can specify the dynamic expression, it should return int value.
Line style - The line style of the route. Choose from the drop-down list, whether you want solid, dashed, or dotted line to be drawn.
You
can edit a route appearance by editing its points. When you then edit
the GIS map itself, for instance, if you pan the map or zoom it in or
out, the route's points will remain in their positions defined by
longitude and latitude.
You can dynamically modify the GIS route's properties at model runtime using the following API.
Function |
Description |
double length() |
Returns the length of the GIS route (in meters), used e.g. for desired speed calculation. |
double length(LengthUnits units) |
Returns the length of the GIS route (in specified units), used e.g. for desired speed calculation. |
boolean isBidirectional() |
Returns the 'bidirectional' property value (true by default).
Returns: |
void setBidirectional(boolean bidirectional) |
Sets the 'bidirectional' property value (true by default).
Parameter: |
void setOwner(ShapeGISMap map) |
Sets the GIS map this route belongs to. |
void setVisible(boolean v) |
Sets the visibility of the markup element.
Parameter: |
boolean isVisible() |
Returns true if the element is currently visible; returns false otherwise. |
INetwork getNetwork() |
Returns the network this markup element belongs to or null if this element is not a part of a network. |
boolean contains(double lat, |
Checks if the shape contains the point with the given coordinates.
Parameters:
Returns:
|
boolean contains(double lat, double lon, double distance) |
Checks if the shape contains the point with the given coordinates using the given tolerance.
Parameters:
Returns: |
boolean containsSq(double lat, double lon, double squareDistance) |
Checks if the shape contains the point with the given coordinates using the given tolerance.
Parameters: Returns: true if the shape contains the point with the given coordinates. |
Point randomPointInside(Random rng, Point out) |
Returns a randomly chosen point inside/along the given space markup element. This method utilises the given Random Number Generator.
Parameters: |
Function |
Description |
double getNearestPoint(double lat,
|
Calculates (using the out object) the point in this space markup element nearest to the point with the given latitude and longitude. Returns the square of distance to the point.
Parameters: Returns: the square of distance to the nearest point. |
double getNearestPoint(Point givenPoint, Point out) |
Calculates (using the out object) the point in this space markup element nearest to the given point. Returns the square of distance to the point.
Parameters: Returns: the square of distance to the nearest point. |
Position getPositionAtOffset(double offset, Position out) |
Returns the position located on the markup element with the given offset distance calculated from start point.
Parameters: Returns: the Position object with coordinates of the point with the given offset and orientation along markup element line at this point. |
Position getPositionAtOffset(double offset, LengthUnits units, Position out) |
Returns the position located on the markup element with the given offset distance calculated from start point.
Parameters: Returns: the Position object with coordinates of the point with the given offset and orientation along markup element line at this point. |
Function |
Description |
GISNode getSource() |
Returns the location of the route's source node. |
GISNode getTarget() |
Returns the location of the route's target node. |
Point getStartPoint() |
Returns the Point object with the coordinates of the starting point. |
Point getStartPoint(Point out) |
Returns the Point object with the coordinates of the starting point.
Parameter: |
Point getEndPoint() |
Returns the Point object with coordinates of the end point. |
Point getEndPoint(Point out) |
Returns the Point object with coordinates of the end point.
Parameter: |
GISNode getOtherNode(GISNode n) |
If the given node is the source of this route, returns the route's target node. Otherwise, returns the source node. Note that this function does not check whether the provided GIS node is the source or the target.
Parameter: Returns: the node of the opposite end of this route. |
Position getStartPosition(Position position) |
Returns the Position object with the coordinates of the route's starting position. |
Position getEndPosition(Position position) |
Returns the Position object with coordinates of the route's ending position. |
Function |
Description |
int getSegmentCount() |
Returns the number of segments. |
GISMarkupSegment getSegment(int index) |
Returns the segment by its index.
Parameter: |
Function |
Description |
Color getLineColor() |
Returns the line color of the markup element, or null if markup element has no line color or has textured line (in this case getLineTexture() should be used instead). |
|
Sets the line color (or Texture) of the markup element.
Parameter: |
LineStyle getLineStyle() |
Returns the line style of the markup element. Possible values: LINE_STYLE_SOLID, LINE_STYLE_DOTTED or LINE_STYLE_DASHED |
void setLineStyle(LineStyle lineStyle) |
Sets the line style of the markup element. Possible values: LINE_STYLE_SOLID, LINE_STYLE_DOTTED or LINE_STYLE_DASHED
Parameter: |
double getLineWidth() |
Returns the line width of the markup element. |
void setLineWidth(double width) |
Sets the line width of the markup element:
Parameter: |
Texture getLineTexture() |
Returns the line texture of the markup element, if the markup element has line texture. |
Function |
Description |
void remove() |
Removes the GIS route from the presentation. If the GIS route is not a part of presentation, the function does nothing. |