Directories | |
| dart | |
| java | |
| kotlin | |
| objc | |
| swift | |
This directory contains comprehensive examples demonstrating the usage of the Navigine SDK's GeometryUtils across all supported platforms.
The GeometryUtils provides a comprehensive set of geometric calculation functions for working with points, segments, polygons, and lines. It offers functionality for:
The main utility class providing geometric calculation methods:
distanceBetweenGlobalPoints() - Calculate distance between WGS84 coordinatesdistanceBetweenPoints() - Calculate distance between metric coordinatessegmentLength() - Calculate segment lengthpolygonArea() - Calculate polygon areapolygonCenter() - Calculate polygon geometric centerpolygonContainsPoint() - Check if polygon contains a pointsegmentPointDistance() - Calculate distance from segment to pointsegmentIntersectsSegment() - Check if segments intersectsegmentIntersectionSegment() - Calculate intersection pointdivisionRatioBySegment() - Calculate division ratio between segmentsgetRatioPoint() - Get point at specific ratio on segmentgetProjectionRatio() - Calculate projection ratio of point on segmentRepresents a point in metric coordinates:
x, y - Coordinates in metersRepresents a point in WGS84 coordinates:
latitude, longitude - Geographic coordinatesRepresents a line segment between two points:
start, end - Start and end pointsRepresents a polygon defined by a list of points:
points - List of points forming the polygon boundaryRepresents a polyline composed of multiple segments:
segments - List of segments forming the linedart/geometry_utils_example.dart - Complete example with all GeometryUtils featuresjava/GeometryUtilsExample.java - Java implementation with comprehensive API coveragekotlin/GeometryUtilsExample.kt - Kotlin implementation using coroutines for async operationsobjc/GeometryUtilsExample.h - Header file with interface declarationsobjc/GeometryUtilsExample.m - Implementation with all GeometryUtils methodsswift/GeometryUtilsExample.swift - Swift implementation with modern syntax[platform_GeometryUtils_distanceBetweenGlobalPoints] - Distance between global coordinates[platform_GeometryUtils_distanceBetweenPoints] - Distance between metric points[platform_GeometryUtils_segmentLength] - Segment length calculation[platform_GeometryUtils_polygonArea] - Polygon area calculation[platform_GeometryUtils_polygonCenter] - Polygon center calculation[platform_GeometryUtils_polygonContainsPoint] - Point containment check[platform_GeometryUtils_segmentPointDistance] - Distance from segment to point[platform_GeometryUtils_segmentIntersectsSegment] - Segment intersection check[platform_GeometryUtils_segmentIntersectionSegment] - Intersection point calculation[platform_GeometryUtils_divisionRatioBySegment] - Division ratio calculation[platform_GeometryUtils_getRatioPoint] - Ratio point calculation[platform_GeometryUtils_getProjectionRatio] - Projection ratio calculation[platform_Point_constructor] - Creating points[platform_Point_getX] - Getting X coordinate[platform_Point_getY] - Getting Y coordinate[platform_GlobalPoint_constructor] - Creating global points[platform_GlobalPoint_getLatitude] - Getting latitude[platform_GlobalPoint_getLongitude] - Getting longitude[platform_Segment_constructor] - Creating segments[platform_Segment_getStart] - Getting start point[platform_Segment_getEnd] - Getting end point[platform_Polygon_constructor] - Creating polygons[platform_Polygon_getPoints] - Getting polygon points[platform_Line_constructor] - Creating lines[platform_Line_getSegments] - Getting line segmentsThe examples demonstrate various distance calculation scenarios:
Comprehensive intersection testing:
Testing different polygon shapes and properties:
Advanced geometric transformations: