PostGIS  2.1.10dev-r@@SVN_REVISION@@
char* rt_util_gdal_convert_sr ( const char *  srs,
int  proj4 
)

Definition at line 323 of file rt_api.c.

References rterror().

Referenced by rt_raster_gdal_warp(), and rt_raster_to_gdal_mem().

323  {
324  OGRSpatialReferenceH hsrs;
325  char *rtn = NULL;
326 
327  assert(srs != NULL);
328 
329  hsrs = OSRNewSpatialReference(NULL);
330  if (OSRSetFromUserInput(hsrs, srs) == OGRERR_NONE) {
331  if (proj4)
332  OSRExportToProj4(hsrs, &rtn);
333  else
334  OSRExportToWkt(hsrs, &rtn);
335  }
336  else {
337  rterror("rt_util_gdal_convert_sr: Could not process the provided srs: %s", srs);
338  return NULL;
339  }
340 
341  OSRDestroySpatialReference(hsrs);
342  if (rtn == NULL) {
343  rterror("rt_util_gdal_convert_sr: Could not process the provided srs: %s", srs);
344  return NULL;
345  }
346 
347  return rtn;
348 }
void rterror(const char *fmt,...)
Raster core error and info handlers.
Definition: rt_api.c:895

Here is the call graph for this function:

Here is the caller graph for this function: