PostGIS 3.6.2dev-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 225 of file rt_util.c.

225 {
226 OGRSpatialReferenceH hsrs;
227 char *rtn = NULL;
228
229 assert(srs != NULL);
230
231 hsrs = OSRNewSpatialReference(NULL);
232 if (OSRSetFromUserInput(hsrs, srs) == OGRERR_NONE) {
233 if (proj4)
234 OSRExportToProj4(hsrs, &rtn);
235 else
236 OSRExportToWkt(hsrs, &rtn);
237 }
238 else {
239 rterror("rt_util_gdal_convert_sr: Could not process the provided srs: %s", srs);
240 return NULL;
241 }
242
243 OSRDestroySpatialReference(hsrs);
244 if (rtn == NULL) {
245 rterror("rt_util_gdal_convert_sr: Could not process the provided srs: %s", srs);
246 return NULL;
247 }
248
249 return rtn;
250}
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: