mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-23 00:22:38 +00:00
parent
ab07f273d3
commit
b4f0beefdc
|
@ -234,7 +234,7 @@ size_t gserialized_from_lwgeom_size(const LWGEOM *geom)
|
|||
|
||||
/**
|
||||
* Allocate a new #LWGEOM from a #GSERIALIZED. The resulting #LWGEOM will have coordinates
|
||||
* that are double aligned and suitable for direct reading using getPoint2d_p_ro
|
||||
* that are double aligned and suitable for direct reading using getPoint2d_cp
|
||||
*/
|
||||
LWGEOM* lwgeom_from_gserialized(const GSERIALIZED *g)
|
||||
{
|
||||
|
|
|
@ -149,7 +149,7 @@ size_t gserialized_from_lwgeom_size(const LWGEOM *geom);
|
|||
|
||||
/**
|
||||
* Allocate a new #LWGEOM from a #GSERIALIZED. The resulting #LWGEOM will have coordinates
|
||||
* that are double aligned and suitable for direct reading using getPoint2d_p_ro
|
||||
* that are double aligned and suitable for direct reading using getPoint2d_cp
|
||||
*/
|
||||
LWGEOM *lwgeom_from_gserialized(const GSERIALIZED *g);
|
||||
|
||||
|
|
|
@ -149,7 +149,7 @@ size_t gserialized1_from_lwgeom_size(const LWGEOM *geom);
|
|||
|
||||
/**
|
||||
* Allocate a new #LWGEOM from a #GSERIALIZED. The resulting #LWGEOM will have coordinates
|
||||
* that are double aligned and suitable for direct reading using getPoint2d_p_ro
|
||||
* that are double aligned and suitable for direct reading using getPoint2d_cp
|
||||
*/
|
||||
LWGEOM* lwgeom_from_gserialized1(const GSERIALIZED *g);
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@ size_t gserialized2_from_lwgeom_size(const LWGEOM *geom);
|
|||
|
||||
/**
|
||||
* Allocate a new #LWGEOM from a #GSERIALIZED. The resulting #LWGEOM will have coordinates
|
||||
* that are double aligned and suitable for direct reading using getPoint2d_p_ro
|
||||
* that are double aligned and suitable for direct reading using getPoint2d_cp
|
||||
*/
|
||||
LWGEOM* lwgeom_from_gserialized2(const GSERIALIZED *g);
|
||||
|
||||
|
|
|
@ -830,7 +830,7 @@ extern GSERIALIZED* gserialized_from_lwgeom(LWGEOM *geom, size_t *size);
|
|||
|
||||
/**
|
||||
* Allocate a new #LWGEOM from a #GSERIALIZED. The resulting #LWGEOM will have coordinates
|
||||
* that are double aligned and suitable for direct reading using getPoint2d_p_ro
|
||||
* that are double aligned and suitable for direct reading using getPoint2d_cp
|
||||
*/
|
||||
extern LWGEOM* lwgeom_from_gserialized(const GSERIALIZED *g);
|
||||
|
||||
|
@ -1929,12 +1929,6 @@ extern int lwgeom_calculate_gbox_cartesian(const LWGEOM *lwgeom, GBOX *gbox);
|
|||
*/
|
||||
extern int lwgeom_calculate_gbox(const LWGEOM *lwgeom, GBOX *gbox);
|
||||
|
||||
/**
|
||||
* New function to read doubles directly from the double* coordinate array
|
||||
* of an aligned lwgeom #POINTARRAY (built by de-serializing a #GSERIALIZED).
|
||||
*/
|
||||
extern int getPoint2d_p_ro(const POINTARRAY *pa, uint32_t n, POINT2D **point);
|
||||
|
||||
/**
|
||||
* Calculate geodetic (x/y/z) box and add values to gbox. Return #LW_SUCCESS on success.
|
||||
*/
|
||||
|
|
|
@ -2873,24 +2873,6 @@ int lwline_covers_lwline(const LWLINE* lwline1, const LWLINE* lwline2)
|
|||
return LW_TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* This function can only be used on LWGEOM that is built on top of
|
||||
* GSERIALIZED, otherwise alignment errors will ensue.
|
||||
*/
|
||||
int getPoint2d_p_ro(const POINTARRAY *pa, uint32_t n, POINT2D **point)
|
||||
{
|
||||
uint8_t *pa_ptr = NULL;
|
||||
assert(pa);
|
||||
assert(n < pa->npoints);
|
||||
|
||||
pa_ptr = getPoint_internal(pa, n);
|
||||
/* printf( "pa_ptr[0]: %g\n", *((double*)pa_ptr)); */
|
||||
*point = (POINT2D*)pa_ptr;
|
||||
|
||||
return LW_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
int ptarray_calculate_gbox_geodetic(const POINTARRAY *pa, GBOX *gbox)
|
||||
{
|
||||
uint32_t i;
|
||||
|
|
|
@ -1332,14 +1332,14 @@ int
|
|||
ptarray_closest_vertex_2d(const POINTARRAY *pa, const POINT2D *qp, double *dist)
|
||||
{
|
||||
uint32_t t, pn=0;
|
||||
POINT2D *p;
|
||||
const POINT2D *p;
|
||||
double mindist = DBL_MAX;
|
||||
|
||||
/* Loop through pointarray looking for nearest segment */
|
||||
for (t=0; t<pa->npoints; t++)
|
||||
{
|
||||
double dist_sqr;
|
||||
getPoint2d_p_ro(pa, t, &p);
|
||||
p = getPoint2d_cp(pa, t);
|
||||
dist_sqr = distance2d_sqr_pt_pt(p, qp);
|
||||
|
||||
if (dist_sqr < mindist)
|
||||
|
|
Loading…
Reference in a new issue