Get raster's convex hull.
The convex hull is a 4 vertices (5 to be closed) single ring polygon bearing the raster's rotation and using projection coordinates.
- Parameters
-
raster | : the raster to get info from |
**hull | : pointer to convex hull |
- Returns
- ES_NONE if success, ES_ERROR if error
The convex hull is typically a 4 vertices (5 to be closed) single ring polygon bearing the raster's rotation and using projection coordinates.
- Parameters
-
raster | : the raster to get info from |
**hull | : pointer to convex hull |
- Returns
- ES_NONE if success, ES_ERROR if error
Definition at line 803 of file rt_geometry.c.
References ES_ERROR, ES_NONE, window::gt, rt_raster_t::height, LW_TRUE, lwline_as_lwgeom(), lwline_construct(), lwpoint_as_lwgeom(), lwpoint_make2d(), lwpoly_as_lwgeom(), lwpoly_construct(), ptarray_append_point(), ptarray_construct(), ptarray_construct_empty(), ptarray_set_point4d(), RASTER_DEBUGF, rt_raster_cell_to_geopoint(), rt_raster_get_geotransform_matrix(), rt_raster_get_height(), rt_raster_get_srid(), rt_raster_get_width(), rtalloc(), rterror(), SRID_UNKNOWN, rt_raster_t::width, POINT4D::x, and POINT4D::y.
Referenced by RASTER_clip(), RASTER_convex_hull(), rt_raster_compute_skewed_raster(), rt_raster_intersects(), rt_raster_surface(), and test_raster_convex_hull().
804 double gt[6] = {0.0};
810 assert(hull != NULL);
848 rterror(
"rt_raster_get_convex_hull: Could not get second point for linestring");
866 rterror(
"rt_raster_get_convex_hull: Could not allocate memory for polygon ring");
873 rterror(
"rt_raster_get_convex_hull: Could not construct point array");
void ptarray_set_point4d(POINTARRAY *pa, int n, const POINT4D *p4d)
POINTARRAY * ptarray_construct(char hasz, char hasm, uint32_t npoints)
Construct an empty pointarray, allocating storage and setting the npoints, but not filling in any inf...
void rt_raster_get_geotransform_matrix(rt_raster raster, double *gt)
Get 6-element array of raster geotransform matrix.
LWPOINT * lwpoint_make2d(int srid, double x, double y)
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
void rterror(const char *fmt,...)
Wrappers used for reporting errors and info.
void * rtalloc(size_t size)
Wrappers used for managing memory.
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
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.
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
int ptarray_append_point(POINTARRAY *pa, const POINT4D *pt, int allow_duplicates)
Append a point to the end of an existing POINTARRAY If allow_duplicate is LW_FALSE, then a duplicate point will not be added.
LWPOLY * lwpoly_construct(int srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points)
#define LW_TRUE
Return types for functions with status returns.
LWLINE * lwline_construct(int srid, GBOX *bbox, POINTARRAY *points)
#define SRID_UNKNOWN
Unknown SRID value.
#define RASTER_DEBUGF(level, msg,...)
int32_t rt_raster_get_srid(rt_raster raster)
Get raster's SRID.
uint16_t rt_raster_get_width(rt_raster raster)
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
uint16_t rt_raster_get_height(rt_raster raster)