PostGIS  2.4.9dev-r@@SVN_REVISION@@
measures.c File Reference
#include <string.h>
#include <stdlib.h>
#include "measures.h"
#include "lwgeom_log.h"
Include dependency graph for measures.c:

Go to the source code of this file.

Functions

LWGEOMlwgeom_closest_line (const LWGEOM *lw1, const LWGEOM *lw2)
 
LWGEOMlwgeom_furthest_line (const LWGEOM *lw1, const LWGEOM *lw2)
 
LWGEOMlwgeom_closest_point (const LWGEOM *lw1, const LWGEOM *lw2)
 
LWGEOMlwgeom_furthest_point (const LWGEOM *lw1, const LWGEOM *lw2)
 
void lw_dist2d_distpts_init (DISTPTS *dl, int mode)
 
LWGEOMlw_dist2d_distanceline (const LWGEOM *lw1, const LWGEOM *lw2, int srid, int mode)
 Function initializing shortestline and longestline calculations. More...
 
LWGEOMlw_dist2d_distancepoint (const LWGEOM *lw1, const LWGEOM *lw2, int srid, int mode)
 Function initializing closestpoint calculations. More...
 
double lwgeom_maxdistance2d (const LWGEOM *lw1, const LWGEOM *lw2)
 Function initialazing max distance calculation. More...
 
double lwgeom_maxdistance2d_tolerance (const LWGEOM *lw1, const LWGEOM *lw2, double tolerance)
 Function handling max distance calculations and dfyllywithin calculations. More...
 
double lwgeom_mindistance2d (const LWGEOM *lw1, const LWGEOM *lw2)
 Function initialazing min distance calculation. More...
 
double lwgeom_mindistance2d_tolerance (const LWGEOM *lw1, const LWGEOM *lw2, double tolerance)
 Function handling min distance calculations and dwithin calculations. More...
 
int lw_dist2d_comp (const LWGEOM *lw1, const LWGEOM *lw2, DISTPTS *dl)
 This function just deserializes geometries Bboxes is not checked here since it is the subgeometries bboxes we will use anyway. More...
 
static int lw_dist2d_is_collection (const LWGEOM *g)
 
int lw_dist2d_recursive (const LWGEOM *lwg1, const LWGEOM *lwg2, DISTPTS *dl)
 This is a recursive function delivering every possible combinatin of subgeometries. More...
 
int lw_dist2d_distribute_bruteforce (const LWGEOM *lwg1, const LWGEOM *lwg2, DISTPTS *dl)
 
int lw_dist2d_check_overlap (LWGEOM *lwg1, LWGEOM *lwg2)
 We have to check for overlapping bboxes. More...
 
int lw_dist2d_distribute_fast (LWGEOM *lwg1, LWGEOM *lwg2, DISTPTS *dl)
 Here the geometries are distributed for the new faster distance-calculations. More...
 
int lw_dist2d_point_point (LWPOINT *point1, LWPOINT *point2, DISTPTS *dl)
 point to point calculation More...
 
int lw_dist2d_point_line (LWPOINT *point, LWLINE *line, DISTPTS *dl)
 point to line calculation More...
 
int lw_dist2d_point_circstring (LWPOINT *point, LWCIRCSTRING *circ, DISTPTS *dl)
 
int lw_dist2d_point_poly (LWPOINT *point, LWPOLY *poly, DISTPTS *dl)
 
int lw_dist2d_point_curvepoly (LWPOINT *point, LWCURVEPOLY *poly, DISTPTS *dl)
 
int lw_dist2d_line_line (LWLINE *line1, LWLINE *line2, DISTPTS *dl)
 line to line calculation More...
 
int lw_dist2d_line_circstring (LWLINE *line1, LWCIRCSTRING *line2, DISTPTS *dl)
 
int lw_dist2d_line_poly (LWLINE *line, LWPOLY *poly, DISTPTS *dl)
 line to polygon calculation Brute force. More...
 
int lw_dist2d_line_curvepoly (LWLINE *line, LWCURVEPOLY *poly, DISTPTS *dl)
 
int lw_dist2d_poly_poly (LWPOLY *poly1, LWPOLY *poly2, DISTPTS *dl)
 Function handling polygon to polygon calculation 1 if we are looking for maxdistance, just check the outer rings. More...
 
int lw_dist2d_poly_curvepoly (LWPOLY *poly1, LWCURVEPOLY *curvepoly2, DISTPTS *dl)
 
int lw_dist2d_circstring_poly (LWCIRCSTRING *circ, LWPOLY *poly, DISTPTS *dl)
 
int lw_dist2d_circstring_curvepoly (LWCIRCSTRING *circ, LWCURVEPOLY *poly, DISTPTS *dl)
 
int lw_dist2d_circstring_circstring (LWCIRCSTRING *line1, LWCIRCSTRING *line2, DISTPTS *dl)
 
static const POINT2Dlw_curvering_getfirstpoint2d_cp (LWGEOM *geom)
 
int lw_dist2d_curvepoly_curvepoly (LWCURVEPOLY *poly1, LWCURVEPOLY *poly2, DISTPTS *dl)
 
int lw_dist2d_pt_ptarray (const POINT2D *p, POINTARRAY *pa, DISTPTS *dl)
 search all the segments of pointarray to see which one is closest to p1 Returns minimum distance between point and pointarray More...
 
int lw_dist2d_pt_ptarrayarc (const POINT2D *p, const POINTARRAY *pa, DISTPTS *dl)
 Search all the arcs of pointarray to see which one is closest to p1 Returns minimum distance between point and arc pointarray. More...
 
int lw_dist2d_ptarray_ptarray (POINTARRAY *l1, POINTARRAY *l2, DISTPTS *dl)
 test each segment of l1 against each segment of l2. More...
 
int lw_dist2d_ptarray_ptarrayarc (const POINTARRAY *pa, const POINTARRAY *pb, DISTPTS *dl)
 Test each segment of pa against each arc of pb for distance. More...
 
int lw_dist2d_ptarrayarc_ptarrayarc (const POINTARRAY *pa, const POINTARRAY *pb, DISTPTS *dl)
 Test each arc of pa against each arc of pb for distance. More...
 
int lw_dist2d_seg_arc (const POINT2D *A1, const POINT2D *A2, const POINT2D *B1, const POINT2D *B2, const POINT2D *B3, DISTPTS *dl)
 Calculate the shortest distance between an arc and an edge. More...
 
int lw_dist2d_pt_arc (const POINT2D *P, const POINT2D *A1, const POINT2D *A2, const POINT2D *A3, DISTPTS *dl)
 
int lw_dist2d_arc_arc_concentric (const POINT2D *A1, const POINT2D *A2, const POINT2D *A3, double radius_A, const POINT2D *B1, const POINT2D *B2, const POINT2D *B3, double radius_B, const POINT2D *CENTER, DISTPTS *dl)
 
int lw_dist2d_arc_arc (const POINT2D *A1, const POINT2D *A2, const POINT2D *A3, const POINT2D *B1, const POINT2D *B2, const POINT2D *B3, DISTPTS *dl)
 
int lw_dist2d_seg_seg (const POINT2D *A, const POINT2D *B, const POINT2D *C, const POINT2D *D, DISTPTS *dl)
 Finds the shortest distance between two segments. More...
 
int lw_dist2d_fast_ptarray_ptarray (POINTARRAY *l1, POINTARRAY *l2, DISTPTS *dl, GBOX *box1, GBOX *box2)
 The new faster calculation comparing pointarray to another pointarray the arrays can come from both polygons and linestrings. More...
 
int struct_cmp_by_measure (const void *a, const void *b)
 
int lw_dist2d_pre_seg_seg (POINTARRAY *l1, POINTARRAY *l2, LISTSTRUCT *list1, LISTSTRUCT *list2, double k, DISTPTS *dl)
 preparation before lw_dist2d_seg_seg. More...
 
int lw_dist2d_selected_seg_seg (const POINT2D *A, const POINT2D *B, const POINT2D *C, const POINT2D *D, DISTPTS *dl)
 This is the same function as lw_dist2d_seg_seg but without any calculations to determine intersection since we already know they do not intersect. More...
 
int lw_dist2d_pt_seg (const POINT2D *p, const POINT2D *A, const POINT2D *B, DISTPTS *dl)
 lw_dist2d_comp from p to line A->B This one is now sending every occation to lw_dist2d_pt_pt Before it was handling occations where r was between 0 and 1 internally and just returning the distance without identifying the points. More...
 
int lw_dist2d_pt_pt (const POINT2D *thep1, const POINT2D *thep2, DISTPTS *dl)
 Compares incomming points and stores the points closest to each other or most far away from each other depending on dl->mode (max or min) More...
 
double distance2d_pt_pt (const POINT2D *p1, const POINT2D *p2)
 The old function nessecary for ptarray_segmentize2d in ptarray.c. More...
 
double distance2d_sqr_pt_pt (const POINT2D *p1, const POINT2D *p2)
 
double distance2d_pt_seg (const POINT2D *p, const POINT2D *A, const POINT2D *B)
 The old function nessecary for ptarray_segmentize2d in ptarray.c. More...
 
double distance2d_sqr_pt_seg (const POINT2D *p, const POINT2D *A, const POINT2D *B)
 
int azimuth_pt_pt (const POINT2D *A, const POINT2D *B, double *d)
 Compute the azimuth of segment AB in radians. More...