26 #include "../postgis_config.h" 58 for ( i = 0; i < pa->
npoints; i++ )
96 for ( i = 0; i < g->
nrings; i++ )
114 for ( i = 0; i < g->
ngeoms; i++ )
122 lwerror(
"lwgeom_transform: Cannot handle type '%s'",
141 if (pj_is_latlong(srcpj))
to_rad(pt) ;
143 LWDEBUGF(4,
"transforming POINT(%f %f) from '%s' to '%s'", orig_pt.
x, orig_pt.
y, pj_get_def(srcpj,0), pj_get_def(dstpj,0));
146 pj_transform(srcpj, dstpj, 1, 0, &(pt->
x), &(pt->
y), &(pt->
z));
149 pj_errno_ref = pj_get_errno_ref();
151 if (*pj_errno_ref != 0)
153 if (*pj_errno_ref == -38)
155 lwnotice(
"PostGIS was unable to transform the point because either no grid shift files were found, or the point does not lie within the range for which the grid shift is defined. Refer to the ST_Transform() section of the PostGIS manual for details on how to configure PostGIS to alter this behaviour.");
156 lwerror(
"transform: couldn't project point (%g %g %g): %s (%d)",
157 orig_pt.
x, orig_pt.
y, orig_pt.
z, pj_strerrno(*pj_errno_ref), *pj_errno_ref);
162 lwerror(
"transform: couldn't project point (%g %g %g): %s (%d)",
163 orig_pt.
x, orig_pt.
y, orig_pt.
z, pj_strerrno(*pj_errno_ref), *pj_errno_ref);
168 if (pj_is_latlong(dstpj))
to_dec(pt);
183 if (str1 == NULL)
return NULL;
187 if (slen == 0)
return NULL;
201 while ((loc != NULL) && (*loc != 0) )
203 loc = strchr(loc,
' ');
213 if (!(result=pj_init(t, params)))
void ptarray_set_point4d(POINTARRAY *pa, int n, const POINT4D *p4d)
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
#define POLYHEDRALSURFACETYPE
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
void * lwalloc(size_t size)
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
#define LWDEBUGF(level, msg,...)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *point)
This library is the generic geometry handling section of PostGIS.