PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ lwpoint_to_latlon()

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

Definition at line 393 of file lwprint.c.

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

Referenced by LWGEOM_to_latlon(), test_lwprint_assert_error(), and test_lwprint_assert_format().

394 {
395  const POINT2D *p;
396  if (NULL == pt)
397  {
398  lwerror("Cannot convert a null point into formatted text.");
399  }
400  if (lwgeom_is_empty((LWGEOM *)pt))
401  {
402  lwerror("Cannot convert an empty point into formatted text.");
403  }
404  p = getPoint2d_cp(pt->point, 0);
405  return lwdoubles_to_latlon(p->y, p->x, format);
406 }
static char * lwdoubles_to_latlon(double lat, double lon, const char *format)
Definition: lwprint.c:366
double x
Definition: liblwgeom.h:312
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, int n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from...
Definition: lwgeom_api.c:472
double y
Definition: liblwgeom.h:312
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
Definition: lwgeom.c:1297
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74
Here is the call graph for this function:
Here is the caller graph for this function: