PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ lwpoint_to_latlon()

char* lwpoint_to_latlon ( const LWPOINT pt,
const char *  format 
)

Definition at line 431 of file lwprint.c.

432 {
433  const POINT2D *p;
434  if (NULL == pt)
435  {
436  lwerror("Cannot convert a null point into formatted text.");
437  }
438  if (lwgeom_is_empty((LWGEOM *)pt))
439  {
440  lwerror("Cannot convert an empty point into formatted text.");
441  }
442  p = getPoint2d_cp(pt->point, 0);
443  return lwdoubles_to_latlon(p->y, p->x, format);
444 }
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
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:101
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:203
static char * lwdoubles_to_latlon(double lat, double lon, const char *format)
Definition: lwprint.c:402
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: