PostGIS  2.1.10dev-r@@SVN_REVISION@@
char* lwpoint_to_latlon ( const LWPOINT pt,
const char *  format 

Definition at line 391 of file lwprint.c.

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

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

392 {
393  POINT2D p;
394  if (NULL == pt)
395  {
396  lwerror("Cannot convert a null point into formatted text.");
397  }
398  if (lwgeom_is_empty((LWGEOM *)pt))
399  {
400  lwerror("Cannot convert an empty point into formatted text.");
401  }
402  getPoint2d_p(pt->point, 0, &p);
403  return lwdoubles_to_latlon(p.y, p.x, format);
404 }
Definition: liblwgeom.h:367
static char * lwdoubles_to_latlon(double lat, double lon, const char *format)
Definition: lwprint.c:364
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
double x
Definition: liblwgeom.h:284
double y
Definition: liblwgeom.h:284
int getPoint2d_p(const POINTARRAY *pa, int n, POINT2D *point)
Definition: lwgeom_api.c:434
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:1229

Here is the call graph for this function:

Here is the caller graph for this function: