Get raster's envelope.
The envelope is the minimum bounding rectangle of the raster
- Parameters
-
raster | : the raster to get envelope of |
env | : pointer to rt_envelope |
- Returns
- ES_NONE if success, ES_ERROR if error
Definition at line 873 of file rt_raster.c.
References ES_ERROR, ES_NONE, rt_raster_t::height, rt_envelope::MaxX, rt_envelope::MaxY, rt_envelope::MinX, rt_envelope::MinY, rt_raster_cell_to_geopoint(), rt_raster_get_geotransform_matrix(), rterror(), and rt_raster_t::width.
Referenced by rt_raster_get_envelope_geom(), and test_raster_envelope().
882 double _gt[6] = {0.};
884 assert(raster != NULL);
889 for (i = 0; i < 4; i++) {
900 _r[0] = raster->
width;
904 _r[0] = raster->
width;
916 rterror(
"rt_raster_get_envelope: Could not compute spatial coordinates for raster pixel");
928 if (_w[0] < env->
MinX)
930 else if (_w[0] > env->
MaxX)
933 if (_w[1] < env->
MinY)
935 else if (_w[1] > env->
MaxY)
rt_errorstate rt_raster_cell_to_geopoint(rt_raster raster, double xr, double yr, double *xw, double *yw, double *gt)
Convert an xr, yr raster point to an xw, yw point on map.
void rterror(const char *fmt,...)
Wrappers used for reporting errors and info.
void rt_raster_get_geotransform_matrix(rt_raster raster, double *gt)
Get 6-element array of raster geotransform matrix.