29 #include "../postgis_config.h"
68 lwerror(
"lwpoint_get_x called with empty geometry");
81 lwerror(
"lwpoint_get_y called with empty geometry");
94 lwerror(
"lwpoint_get_z called with empty geometry");
99 lwerror(
"lwpoint_get_z called without z dimension");
112 lwerror(
"lwpoint_get_m called with empty geometry");
117 lwerror(
"lwpoint_get_m called without m dimension");
243 LWDEBUG(2,
"lwpoint_clone called");
245 memcpy(ret, g,
sizeof(
LWPOINT));
char result[OUT_DOUBLE_BUFFER_SIZE]
GBOX * gbox_copy(const GBOX *box)
Return a copy of the GBOX, based on dimensionality of flags.
int32_t lwgeom_get_srid(const LWGEOM *geom)
Return SRID number.
#define FLAGS_GET_BBOX(flags)
#define FLAGS_SET_BBOX(flags, value)
void printPA(POINTARRAY *pa)
int getPoint2d_p(const POINTARRAY *pa, uint32_t n, POINT2D *point)
POINTARRAY * ptarray_construct(char hasz, char hasm, uint32_t npoints)
Construct an empty pointarray, allocating storage and setting the npoints, but not filling in any inf...
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
#define FLAGS_GET_Z(flags)
int getPoint3dz_p(const POINTARRAY *pa, uint32_t n, POINT3DZ *point)
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
#define FLAGS_NDIMS(flags)
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
#define FLAGS_GET_M(flags)
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
void ptarray_free(POINTARRAY *pa)
int ptarray_append_point(POINTARRAY *pa, const POINT4D *pt, int allow_duplicates)
Append a point to the end of an existing POINTARRAY If allow_duplicate is LW_FALSE,...
void * lwalloc(size_t size)
lwflags_t lwflags(int hasz, int hasm, int geodetic)
Construct a new flags bitmask.
#define LW_TRUE
Return types for functions with status returns.
int getPoint3dm_p(const POINTARRAY *pa, uint32_t n, POINT3DM *point)
#define FLAGS_SET_M(flags, value)
void lwgeom_release(LWGEOM *lwgeom)
Free the containing LWGEOM and the associated BOX.
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
#define FLAGS_SET_Z(flags, value)
POINTARRAY * ptarray_force_dims(const POINTARRAY *pa, int hasz, int hasm, double zval, double mval)
POINTARRAY * ptarray_clone(const POINTARRAY *ptarray)
Clone a POINTARRAY object.
char ptarray_same(const POINTARRAY *pa1, const POINTARRAY *pa2)
int lwpoint_is_empty(const LWPOINT *point)
int project_pt(const POINT2D *P, double distance, double azimuth, POINT2D *R)
Azimuth is angle in radians from vertical axis.
int project_pt_pt(const POINT4D *A, const POINT4D *B, double distance, POINT4D *R)
Azimuth is angle in radians from vertical axis.
char ptarray_same2d(const POINTARRAY *pa1, const POINTARRAY *pa2)
#define LWDEBUG(level, msg)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
LWPOINT * lwpoint_construct_empty(int32_t srid, char hasz, char hasm)
int lwpoint_getPoint4d_p(const LWPOINT *point, POINT4D *out)
LWPOINT * lwpoint_make4d(int32_t srid, double x, double y, double z, double m)
LWPOINT * lwpoint_make2d(int32_t srid, double x, double y)
double lwpoint_get_m(const LWPOINT *point)
void lwpoint_free(LWPOINT *pt)
void lwpoint_release(LWPOINT *lwpoint)
LWPOINT * lwpoint_make3dm(int32_t srid, double x, double y, double m)
int lwpoint_getPoint3dm_p(const LWPOINT *point, POINT3DM *out)
double lwpoint_get_x(const LWPOINT *point)
LWPOINT * lwpoint_project(const LWPOINT *lwpoint1, double distance, double azimuth)
char lwpoint_same2d(const LWPOINT *p1, const LWPOINT *p2)
int lwpoint_getPoint3dz_p(const LWPOINT *point, POINT3DZ *out)
LWPOINT * lwpoint_make3dz(int32_t srid, double x, double y, double z)
LWPOINT * lwpoint_clone(const LWPOINT *g)
LWPOINT * lwpoint_construct(int32_t srid, GBOX *bbox, POINTARRAY *point)
LWPOINT * lwpoint_project_lwpoint(const LWPOINT *lwpoint1, const LWPOINT *lwpoint2, double distance)
LWPOINT * lwpoint_force_dims(const LWPOINT *point, int hasz, int hasm, double zval, double mval)
void printLWPOINT(LWPOINT *point)
double lwpoint_get_z(const LWPOINT *point)
int lwpoint_getPoint2d_p(const LWPOINT *point, POINT2D *out)
double lwpoint_get_y(const LWPOINT *point)
char lwpoint_same(const LWPOINT *p1, const LWPOINT *p2)
LWPOINT * lwpoint_make(int32_t srid, int hasz, int hasm, const POINT4D *p)
static double distance(double x1, double y1, double x2, double y2)