int setValue = 0;
GEOSCoordSequence *sequence1 = GEOSCoordSeq_create(1, 2);
setValue = GEOSCoordSeq_setX(sequence1, 0, currentPosition.lon);
setValue = GEOSCoordSeq_setY(sequence1, 0, currentPosition.lat);
GEOSGeometry *point1 = GEOSGeom_createPoint(sequence1);
NSArray *points = [currentSegment positions];
int size = [points count];
GEOSCoordSequence *sequence2 = GEOSCoordSeq_create(size, 2);
for (int i = 0; i < [points count]; i++) {
Position *position = [points objectAtIndex:i];
setValue = GEOSCoordSeq_setX(sequence2, i, position.lon);
setValue = GEOSCoordSeq_setY(sequence2, i, position.lat);
}
GEOSGeometry *line1 = GEOSGeom_createLineString(sequence2);
double dist = 0.0f;
int result = GEOSDistance(point1, line1, &dist);
GEOSGeom_destroy(line1);
GEOSGeom_destroy(point1);
Any info would be great.
Thanks!
Chris
--
You received this message because you are subscribed to the Google Groups "SpatiaLite Users" group.To post to this group, send email to spatialite-users@googlegroups.com.
To unsubscribe from this group, send email to spatialite-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spatialite-users?hl=en.