35 double hside = p2->
x - p1->
x;
36 double vside = p2->
y - p1->
y;
38 return hside * hside + vside * vside;
44 double hside = p2->
x - p1->
x;
45 double vside = p2->
y - p1->
y;
46 double zside = p2->
z - p1->
z;
48 return hside * hside + vside * vside + zside * zside;
74 static inline uint8_t *
81 assert(n <= pa->npoints);
82 assert(n <= pa->maxpoints);
140 static inline uint32_t
186 for (i = 0; i < col->
ngeoms; i++)
236 inline static uint64_t
239 x = (
x | (
x << 16)) & 0x0000FFFF0000FFFFULL;
240 x = (
x | (
x << 8)) & 0x00FF00FF00FF00FFULL;
241 x = (
x | (
x << 4)) & 0x0F0F0F0F0F0F0F0FULL;
242 x = (
x | (
x << 2)) & 0x3333333333333333ULL;
243 x = (
x | (
x << 1)) & 0x5555555555555555ULL;
245 y = (
y | (
y << 16)) & 0x0000FFFF0000FFFFULL;
246 y = (
y | (
y << 8)) & 0x00FF00FF00FF00FFULL;
247 y = (
y | (
y << 4)) & 0x0F0F0F0F0F0F0F0FULL;
248 y = (
y | (
y << 2)) & 0x3333333333333333ULL;
249 y = (
y | (
y << 1)) & 0x5555555555555555ULL;
255 inline static uint64_t
268 b = 0xFFFFFFFFULL ^ a;
269 c = 0xFFFFFFFFULL ^ (
x |
y);
270 d =
x & (
y ^ 0xFFFFFFFFULL);
274 C = ((c >> 1) ^ (b & (d >> 1))) ^ c;
275 D = ((a & (c >> 1)) ^ (d >> 1)) ^ d;
284 A = ((a & (a >> 2)) ^ (b & (b >> 2)));
285 B = ((a & (b >> 2)) ^ (b & ((a ^ b) >> 2)));
286 C ^= ((a & (c >> 2)) ^ (b & (d >> 2)));
287 D ^= ((b & (c >> 2)) ^ ((a ^ b) & (d >> 2)));
296 A = ((a & (a >> 4)) ^ (b & (b >> 4)));
297 B = ((a & (b >> 4)) ^ (b & ((a ^ b) >> 4)));
298 C ^= ((a & (c >> 4)) ^ (b & (d >> 4)));
299 D ^= ((b & (c >> 4)) ^ ((a ^ b) & (d >> 4)));
308 A = ((a & (a >> 8)) ^ (b & (b >> 8)));
309 B = ((a & (b >> 8)) ^ (b & ((a ^ b) >> 8)));
310 C ^= ((a & (c >> 8)) ^ (b & (d >> 8)));
311 D ^= ((b & (c >> 8)) ^ ((a ^ b) & (d >> 8)));
320 C ^= ((a & (c >> 16)) ^ (b & (d >> 16)));
321 D ^= ((b & (c >> 16)) ^ ((a ^ b) & (d >> 16)));
330 i1 = b | (0xFFFFFFFFULL ^ (i0 | a));
340 #define POSTGIS_FREE_IF_COPY_P(ptrsrc, ptrori) \
343 if ((Pointer)(ptrsrc) != (Pointer)(ptrori)) \
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
#define FLAGS_NDIMS(flags)
#define POLYHEDRALSURFACETYPE
#define LW_TRUE
Return types for functions with status returns.
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
static const POINT3D * getPoint3d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT3D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
static const POINT4D * getPoint4d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT4D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
static double distance2d_sqr_pt_pt(const POINT2D *p1, const POINT2D *p2)
static uint64_t uint32_hilbert(uint32_t px, uint32_t py)
static uint32_t lwgeom_get_type(const LWGEOM *geom)
Return LWTYPE number.
static int lwcircstring_is_empty(const LWCIRCSTRING *circ)
static int lwpoly_is_empty(const LWPOLY *poly)
static size_t ptarray_point_size(const POINTARRAY *pa)
static uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
static int lwcollection_is_empty(const LWCOLLECTION *col)
static uint64_t uint64_interleave_2(uint64_t x, uint64_t y)
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
static int lwline_is_empty(const LWLINE *line)
static int lwtriangle_is_empty(const LWTRIANGLE *triangle)
static LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)
static double distance3d_sqr_pt_pt(const POINT3D *p1, const POINT3D *p2)
static int lwpoint_is_empty(const LWPOINT *point)
uint8_t * serialized_pointlist