PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ lwpoint_to_latlon()

char * lwpoint_to_latlon ( const LWPOINT p,
const char *  format 
)
extern

Definition at line 437 of file lwprint.c.

438{
439 const POINT2D *p;
440 if (NULL == pt)
441 {
442 lwerror("Cannot convert a null point into formatted text.");
443 }
444 if (lwgeom_is_empty((LWGEOM *)pt))
445 {
446 lwerror("Cannot convert an empty point into formatted text.");
447 }
448 p = getPoint2d_cp(pt->point, 0);
449 return lwdoubles_to_latlon(p->y, p->x, format);
450}
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
Definition lwinline.h:199
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
Definition lwinline.h:97
static char * lwdoubles_to_latlon(double lat, double lon, const char *format)
Definition lwprint.c:408
double y
Definition liblwgeom.h:390
double x
Definition liblwgeom.h:390

References getPoint2d_cp(), lwdoubles_to_latlon(), lwerror(), lwgeom_is_empty(), LWPOINT::point, POINT2D::x, and POINT2D::y.

Referenced by LWGEOM_to_latlon(), test_lwpoint_to_latlon_assert_error(), and test_lwpoint_to_latlon_assert_format().

Here is the call graph for this function:
Here is the caller graph for this function: