Loading...
Searching...
No Matches
com.navigine.idl.java.internal.GeometryUtilsBinding Class Reference
+ Inheritance diagram for com.navigine.idl.java.internal.GeometryUtilsBinding:

Public Member Functions

native boolean isValid ()
 

Static Public Member Functions

static native float distanceBetweenGlobalPoints (GlobalPoint from, GlobalPoint to)
 Get distance between GPS points.
 
static native float distanceBetweenPoints (Point from, Point to)
 Get distance between points.
 
static native float segmentLength (Segment segment)
 Get length of segment.
 
static native float polygonArea (Polygon polygon)
 Get polygon area.
 
static native Point polygonCenter (Polygon polygon)
 Get polygon geometric center.
 
static native boolean polygonContainsPoint (Polygon polygon, Point point)
 Checks that polygon contains point.
 
static native float segmentPointDistance (Segment segment, Point point)
 Get distance from segment to point.
 
static native boolean segmentIntersectsSegment (Segment segment1, Segment segment2)
 Checks the intersection of two segments.
 
static native Point segmentIntersectionSegment (Segment segment1, Segment segment2)
 Calculate the intersection point of two segments.
 
static native float divisionRatioBySegment (Segment segment1, Segment segment2)
 Calculate the division ratio of a segment by a given segment(if intersects)
 
static native Point getRatioPoint (Segment segment, double r)
 Calculate projection point on a segment.
 
static native double getProjectionRatio (Segment segment, Point point)
 Calculate the division ratio of a segment by a given point Calculate projection point on a segment.
 

Detailed Description

Definition at line 14 of file GeometryUtilsBinding.java.

Member Function Documentation

◆ distanceBetweenGlobalPoints()

static native float com.navigine.idl.java.internal.GeometryUtilsBinding.distanceBetweenGlobalPoints ( GlobalPoint from,
GlobalPoint to )
static

Get distance between GPS points.

Parameters
fromstart point of calculation GlobalPoint
toend point of calculation GlobalPoint
Returns
distance in meters

Java code snippet:

// Calculate distance between global points
double globalDistance = GeometryUtils.distanceBetweenGlobalPoints(globalPoint1, globalPoint2);
System.out.printf("Distance between Moscow and St. Petersburg: %.2f meters%n", globalDistance);

Kotlin code snippet:

// Calculate distance between global points
val globalDistance = GeometryUtils.distanceBetweenGlobalPoints(globalPoint1, globalPoint2)
println("Distance between Moscow and St. Petersburg: ${"%.2f".format(globalDistance)} meters")

Reimplemented from com.navigine.idl.java.GeometryUtils.

◆ distanceBetweenPoints()

static native float com.navigine.idl.java.internal.GeometryUtilsBinding.distanceBetweenPoints ( Point from,
Point to )
static

Get distance between points.

Parameters
fromstart point of calculation Point
toend point of calculation Point
Returns
distance in meters

Java code snippet:

// Calculate distance between points
double distance = GeometryUtils.distanceBetweenPoints(point1, point2);
System.out.printf("Distance between P1 and P2: %.2f meters%n", distance);

Kotlin code snippet:

// Calculate distance between points
val distance = GeometryUtils.distanceBetweenPoints(point1, point2)
println("Distance between P1 and P2: ${"%.2f".format(distance)} meters")

Reimplemented from com.navigine.idl.java.GeometryUtils.

◆ divisionRatioBySegment()

static native float com.navigine.idl.java.internal.GeometryUtilsBinding.divisionRatioBySegment ( Segment segment1,
Segment segment2 )
static

Calculate the division ratio of a segment by a given segment(if intersects)

Parameters
segment1first segment of calculation Segment
segment2second segment of calculation Segment
Returns
division ratio

Java code snippet:

// Calculate division ratio
double divisionRatio = GeometryUtils.divisionRatioBySegment(segment1, segment2);
System.out.printf("Division ratio: %.2f%n", divisionRatio);

Kotlin code snippet:

// Calculate division ratio
val divisionRatio = GeometryUtils.divisionRatioBySegment(segment1, segment2)
println("Division ratio: ${"%.2f".format(divisionRatio)}")

Reimplemented from com.navigine.idl.java.GeometryUtils.

◆ getProjectionRatio()

static native double com.navigine.idl.java.internal.GeometryUtilsBinding.getProjectionRatio ( Segment segment,
Point point )
static

Calculate the division ratio of a segment by a given point Calculate projection point on a segment.

Parameters
segmentsegment of calculation Segment
pointpoint of calculation Point
Returns
division ratio

Java code snippet:

// Calculate projection ratio
double projectionRatio = GeometryUtils.getProjectionRatio(segment1, testPoint);
System.out.printf("Projection ratio: %.2f%n", projectionRatio);

Kotlin code snippet:

// Calculate projection ratio
val projectionRatio = GeometryUtils.getProjectionRatio(segment1, testPoint)
println("Projection ratio: ${"%.2f".format(projectionRatio)}")

Reimplemented from com.navigine.idl.java.GeometryUtils.

◆ getRatioPoint()

static native Point com.navigine.idl.java.internal.GeometryUtilsBinding.getRatioPoint ( Segment segment,
double r )
static

Calculate projection point on a segment.

Parameters
segmentsegment of calculation Segment
rdivision ratio
Returns
ratio point Point

Java code snippet:

// Get point at specific ratio
double ratio = 0.5;
Point ratioPoint = GeometryUtils.getRatioPoint(segment1, ratio);
System.out.printf("Point at ratio %.1f: (%.2f, %.2f)%n", ratio, ratioPoint.getX(), ratioPoint.getY());

Kotlin code snippet:

// Get point at specific ratio
val ratio = 0.5
val ratioPoint = GeometryUtils.getRatioPoint(segment1, ratio)
println("Point at ratio $ratio: (${"%.2f".format(ratioPoint.x)}, ${"%.2f".format(ratioPoint.y)})")

Reimplemented from com.navigine.idl.java.GeometryUtils.

◆ isValid()

native boolean com.navigine.idl.java.internal.GeometryUtilsBinding.isValid ( )

Tells if this GeometryUtils is valid or not. Any other method (except for this one) called on an invalid GeometryUtils will throw java.lang.RuntimeException.

Reimplemented from com.navigine.idl.java.GeometryUtils.

◆ polygonArea()

static native float com.navigine.idl.java.internal.GeometryUtilsBinding.polygonArea ( Polygon polygon)
static

Get polygon area.

Parameters
polygonpolygon object for calculation Polygon
Returns
area in meters

Java code snippet:

// Calculate polygon area
double area = GeometryUtils.polygonArea(polygon);
System.out.printf("Polygon area: %.2f square meters%n", area);

Kotlin code snippet:

// Calculate polygon area
val area = GeometryUtils.polygonArea(polygon)
println("Polygon area: ${"%.2f".format(area)} square meters")

Reimplemented from com.navigine.idl.java.GeometryUtils.

◆ polygonCenter()

static native Point com.navigine.idl.java.internal.GeometryUtilsBinding.polygonCenter ( Polygon polygon)
static

Get polygon geometric center.

Parameters
polygonpolygon object for calculation Polygon
Returns
center point Point

Java code snippet:

// Calculate polygon center
Point center = GeometryUtils.polygonCenter(polygon);
System.out.printf("Polygon center: (%.2f, %.2f)%n", center.getX(), center.getY());

Kotlin code snippet:

// Calculate polygon center
val center = GeometryUtils.polygonCenter(polygon)
println("Polygon center: (${"%.2f".format(center.x)}, ${"%.2f".format(center.y)})")

Reimplemented from com.navigine.idl.java.GeometryUtils.

◆ polygonContainsPoint()

static native boolean com.navigine.idl.java.internal.GeometryUtilsBinding.polygonContainsPoint ( Polygon polygon,
Point point )
static

Checks that polygon contains point.

Parameters
polygonpolygon object in which looking for contents Polygon
pointchecking point object Point
Returns
contains or not

Java code snippet:

// Check if polygon contains point
Point insidePoint = new Point(5.0, 5.0);
Point outsidePoint = new Point(15.0, 15.0);
boolean containsInside = GeometryUtils.polygonContainsPoint(polygon, insidePoint);
boolean containsOutside = GeometryUtils.polygonContainsPoint(polygon, outsidePoint);
System.out.println("Polygon contains inside point: " + containsInside);
System.out.println("Polygon contains outside point: " + containsOutside);

Kotlin code snippet:

// Check if polygon contains point
val insidePoint = Point(5.0, 5.0)
val outsidePoint = Point(15.0, 15.0)
val containsInside = GeometryUtils.polygonContainsPoint(polygon, insidePoint)
val containsOutside = GeometryUtils.polygonContainsPoint(polygon, outsidePoint)
println("Polygon contains inside point: $containsInside")
println("Polygon contains outside point: $containsOutside")

Reimplemented from com.navigine.idl.java.GeometryUtils.

◆ segmentIntersectionSegment()

static native Point com.navigine.idl.java.internal.GeometryUtilsBinding.segmentIntersectionSegment ( Segment segment1,
Segment segment2 )
static

Calculate the intersection point of two segments.

Parameters
segment1first segment of calculation Segment
segment2second segment of calculation Segment
Returns
intersection point Point

Java code snippet:

// Calculate intersection point
Point intersection = GeometryUtils.segmentIntersectionSegment(segment1, segment2);
System.out.printf("Intersection point: (%.2f, %.2f)%n", intersection.getX(), intersection.getY());

Kotlin code snippet:

// Calculate intersection point
val intersection = GeometryUtils.segmentIntersectionSegment(segment1, segment2)
println("Intersection point: (${"%.2f".format(intersection.x)}, ${"%.2f".format(intersection.y)})")

Reimplemented from com.navigine.idl.java.GeometryUtils.

◆ segmentIntersectsSegment()

static native boolean com.navigine.idl.java.internal.GeometryUtilsBinding.segmentIntersectsSegment ( Segment segment1,
Segment segment2 )
static

Checks the intersection of two segments.

Parameters
segment1first segment of calculation Segment
segment2second segment of calculation Segment
Returns
intersects or not

Java code snippet:

// Check if segments intersect
boolean intersects = GeometryUtils.segmentIntersectsSegment(segment1, segment2);
System.out.println("Segments intersect: " + intersects);

Kotlin code snippet:

// Check if segments intersect
val intersects = GeometryUtils.segmentIntersectsSegment(segment1, segment2)
println("Segments intersect: $intersects")

Reimplemented from com.navigine.idl.java.GeometryUtils.

◆ segmentLength()

static native float com.navigine.idl.java.internal.GeometryUtilsBinding.segmentLength ( Segment segment)
static

Get length of segment.

Parameters
segmentsegment object for calculation Segment
Returns
length in meters

Java code snippet:

// Calculate segment length
double length1 = GeometryUtils.segmentLength(segment1);
double length2 = GeometryUtils.segmentLength(segment2);
System.out.printf("Segment1 length: %.2f meters%n", length1);
System.out.printf("Segment2 length: %.2f meters%n", length2);

Kotlin code snippet:

// Calculate segment length
val length1 = GeometryUtils.segmentLength(segment1)
val length2 = GeometryUtils.segmentLength(segment2)
println("Segment1 length: ${"%.2f".format(length1)} meters")
println("Segment2 length: ${"%.2f".format(length2)} meters")

Reimplemented from com.navigine.idl.java.GeometryUtils.

◆ segmentPointDistance()

static native float com.navigine.idl.java.internal.GeometryUtilsBinding.segmentPointDistance ( Segment segment,
Point point )
static

Get distance from segment to point.

Parameters
segmentstart segment of calculation Segment
pointend point of calculation Point
Returns
distance in meters

Java code snippet:

// Calculate distance from segment to point
double distanceToPoint = GeometryUtils.segmentPointDistance(segment1, testPoint);
System.out.printf("Distance from segment1 to test point: %.2f meters%n", distanceToPoint);

Kotlin code snippet:

// Calculate distance from segment to point
val distanceToPoint = GeometryUtils.segmentPointDistance(segment1, testPoint)
println("Distance from segment1 to test point: ${"%.2f".format(distanceToPoint)} meters")

Reimplemented from com.navigine.idl.java.GeometryUtils.


The documentation for this class was generated from the following file: