Copy values from a raster to the points on a geometry using the requested interpolation type.
and selected interpolation.
1500{
1506 double igt[6] = {0};
1509 double nodatavalue = 0.0;
1510
1511
1513 if (!band) {
1514 rterror(
"unable to read requested band");
1516 }
1518
1519
1520 if (dim == 'z') {
1521 if (has_z)
1523 else if (has_m)
1525 else
1527 }
1528 else if (dim == 'm') {
1529 if (has_m)
1531 if (has_z)
1533 else
1535 }
1536 else {
1537 rterror(
"unknown value for dim");
1539 }
1540
1541
1544 {
1545 int nodata;
1546 double xr, yr,
value;
1548
1549
1552
1553
1555 band,
1556 xr, yr,
1557 resample,
1558 &value, &nodata
1559 );
1560
1563 }
1564
1565
1566 if (dim == 'z')
1568 if (dim == 'm')
1570
1572 }
1574
1575 if (lwgeom_out)
1576 *lwgeom_out = lwgeom;
1578}
LWPOINTITERATOR * lwpointiterator_create_rw(LWGEOM *g)
Create a new LWPOINTITERATOR over supplied LWGEOM* Supports modification of coordinates during iterat...
LWGEOM * lwgeom_force_3dz(const LWGEOM *geom, double zval)
int lwpointiterator_peek(LWPOINTITERATOR *s, POINT4D *p)
Attempts to assigns the next point in the iterator to p.
void lwpointiterator_destroy(LWPOINTITERATOR *s)
Free all memory associated with the iterator.
LWGEOM * lwgeom_clone(const LWGEOM *lwgeom)
Clone LWGEOM object.
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
int lwpointiterator_modify_next(LWPOINTITERATOR *s, const POINT4D *p)
Attempts to replace the next point int the iterator with p, and advances the iterator to the next poi...
int lwpointiterator_has_next(LWPOINTITERATOR *s)
Returns LW_TRUE if there is another point available in the iterator.
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
LWGEOM * lwgeom_force_4d(const LWGEOM *geom, double zval, double mval)
LWGEOM * lwgeom_force_3dm(const LWGEOM *geom, double mval)
void rterror(const char *fmt,...) __attribute__((format(printf
Wrappers used for reporting errors and info.
rt_errorstate
Enum definitions.
rt_errorstate rt_band_get_pixel_resample(rt_band band, double xr, double yr, rt_resample_type resample, double *r_value, int *r_nodata)
Retrieve a point value from the raster using a world coordinate and selected resampling method.
rt_errorstate rt_band_get_nodata(rt_band band, double *nodata)
Get NODATA value.
rt_errorstate rt_raster_geopoint_to_rasterpoint(rt_raster raster, double xw, double yw, double *xr, double *yr, double *igt)
Convert an xw,yw map point to a xr,yr raster point.
rt_band rt_raster_get_band(rt_raster raster, int n)
Return Nth band, or NULL if unavailable.