PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ rt_util_gdal_convert_sr()

char * rt_util_gdal_convert_sr ( const char *  srs,
int  proj4 
)

Definition at line 322 of file rt_util.c.

322 {
323 OGRSpatialReferenceH hsrs;
324 char *rtn = NULL;
325
326 assert(srs != NULL);
327
328 hsrs = OSRNewSpatialReference(NULL);
329 if (OSRSetFromUserInput(hsrs, srs) == OGRERR_NONE) {
330 if (proj4)
331 OSRExportToProj4(hsrs, &rtn);
332 else
333 OSRExportToWkt(hsrs, &rtn);
334 }
335 else {
336 rterror("rt_util_gdal_convert_sr: Could not process the provided srs: %s", srs);
337 return NULL;
338 }
339
340 OSRDestroySpatialReference(hsrs);
341 if (rtn == NULL) {
342 rterror("rt_util_gdal_convert_sr: Could not process the provided srs: %s", srs);
343 return NULL;
344 }
345
346 return rtn;
347}
void rterror(const char *fmt,...) __attribute__((format(printf
Wrappers used for reporting errors and info.

References rterror().

Referenced by rt_raster_gdal_warp(), and rt_raster_to_gdal_mem().

Here is the call graph for this function:
Here is the caller graph for this function: