32 #include <utils/builtins.h>
34 #include "../../postgis_config.h"
36 #include "lwgeom_pg.h"
78 int pgrastpos[2] = {-1, -1};
90 for (i = 0, j = 0; i < set_count; i++) {
92 if (PG_ARGISNULL(j)) {
93 for (k = 0; k < i; k++) {
95 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
99 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
106 for (k = 0; k <= i; k++) {
109 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
111 elog(ERROR,
"RASTER_intersects: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
118 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
120 for (k = 0; k < i; k++) {
122 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
128 if (!PG_ARGISNULL(j)) {
129 bandindex[i] = PG_GETARG_INT32(j);
130 if (bandindex[i] < 1 || bandindex[i] > numBands) {
131 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
133 for (k = 0; k < i; k++) {
135 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
150 (hasbandindex[0] && !hasbandindex[1]) ||
151 (!hasbandindex[0] && hasbandindex[1])
153 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
154 for (k = 0; k < set_count; k++) {
156 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
163 for (k = 0; k < set_count; k++) {
165 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
167 elog(ERROR,
"The two rasters provided have different SRIDs");
172 rast[0], (hasbandindex[0] ? (
int)bandindex[0] - 1 : -1),
173 rast[1], (hasbandindex[1] ? (
int)bandindex[1] - 1 : -1),
176 for (k = 0; k < set_count; k++) {
178 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
182 elog(ERROR,
"RASTER_intersects: Could not test for intersection on the two rasters");
186 PG_RETURN_BOOL(result);
197 int pgrastpos[2] = {-1, -1};
209 for (i = 0, j = 0; i < set_count; i++) {
211 if (PG_ARGISNULL(j)) {
212 for (k = 0; k < i; k++) {
214 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
218 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
225 for (k = 0; k <= i; k++) {
228 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
230 elog(ERROR,
"RASTER_overlaps: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
237 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
239 for (k = 0; k < i; k++) {
241 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
247 if (!PG_ARGISNULL(j)) {
248 bandindex[i] = PG_GETARG_INT32(j);
249 if (bandindex[i] < 1 || bandindex[i] > numBands) {
250 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
252 for (k = 0; k < i; k++) {
254 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
269 (hasbandindex[0] && !hasbandindex[1]) ||
270 (!hasbandindex[0] && hasbandindex[1])
272 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
273 for (k = 0; k < set_count; k++) {
275 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
282 for (k = 0; k < set_count; k++) {
284 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
286 elog(ERROR,
"The two rasters provided have different SRIDs");
291 rast[0], (hasbandindex[0] ? (
int)bandindex[0] - 1 : -1),
292 rast[1], (hasbandindex[1] ? (
int)bandindex[1] - 1 : -1),
295 for (k = 0; k < set_count; k++) {
297 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
301 elog(ERROR,
"RASTER_overlaps: Could not test for overlap on the two rasters");
305 PG_RETURN_BOOL(result);
316 int pgrastpos[2] = {-1, -1};
328 for (i = 0, j = 0; i < set_count; i++) {
330 if (PG_ARGISNULL(j)) {
331 for (k = 0; k < i; k++) {
333 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
337 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
344 for (k = 0; k <= i; k++) {
347 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
349 elog(ERROR,
"RASTER_touches: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
356 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
358 for (k = 0; k < i; k++) {
360 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
366 if (!PG_ARGISNULL(j)) {
367 bandindex[i] = PG_GETARG_INT32(j);
368 if (bandindex[i] < 1 || bandindex[i] > numBands) {
369 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
371 for (k = 0; k < i; k++) {
373 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
388 (hasbandindex[0] && !hasbandindex[1]) ||
389 (!hasbandindex[0] && hasbandindex[1])
391 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
392 for (k = 0; k < set_count; k++) {
394 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
401 for (k = 0; k < set_count; k++) {
403 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
405 elog(ERROR,
"The two rasters provided have different SRIDs");
410 rast[0], (hasbandindex[0] ? (
int)bandindex[0] - 1 : -1),
411 rast[1], (hasbandindex[1] ? (
int)bandindex[1] - 1 : -1),
414 for (k = 0; k < set_count; k++) {
416 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
420 elog(ERROR,
"RASTER_touches: Could not test for touch on the two rasters");
424 PG_RETURN_BOOL(result);
435 int pgrastpos[2] = {-1, -1};
447 for (i = 0, j = 0; i < set_count; i++) {
449 if (PG_ARGISNULL(j)) {
450 for (k = 0; k < i; k++) {
452 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
456 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
463 for (k = 0; k <= i; k++) {
466 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
468 elog(ERROR,
"RASTER_contains: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
475 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
477 for (k = 0; k < i; k++) {
479 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
485 if (!PG_ARGISNULL(j)) {
486 bandindex[i] = PG_GETARG_INT32(j);
487 if (bandindex[i] < 1 || bandindex[i] > numBands) {
488 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
490 for (k = 0; k < i; k++) {
492 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
507 (hasbandindex[0] && !hasbandindex[1]) ||
508 (!hasbandindex[0] && hasbandindex[1])
510 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
511 for (k = 0; k < set_count; k++) {
513 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
520 for (k = 0; k < set_count; k++) {
522 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
524 elog(ERROR,
"The two rasters provided have different SRIDs");
529 rast[0], (hasbandindex[0] ? (
int)bandindex[0] - 1 : -1),
530 rast[1], (hasbandindex[1] ? (
int)bandindex[1] - 1 : -1),
533 for (k = 0; k < set_count; k++) {
535 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
539 elog(ERROR,
"RASTER_contains: Could not test that the first raster contains the second raster");
543 PG_RETURN_BOOL(result);
554 int pgrastpos[2] = {-1, -1};
566 for (i = 0, j = 0; i < set_count; i++) {
568 if (PG_ARGISNULL(j)) {
569 for (k = 0; k < i; k++) {
571 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
575 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
582 for (k = 0; k <= i; k++) {
585 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
587 elog(ERROR,
"RASTER_containsProperly: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
594 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
596 for (k = 0; k < i; k++) {
598 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
604 if (!PG_ARGISNULL(j)) {
605 bandindex[i] = PG_GETARG_INT32(j);
606 if (bandindex[i] < 1 || bandindex[i] > numBands) {
607 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
609 for (k = 0; k < i; k++) {
611 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
626 (hasbandindex[0] && !hasbandindex[1]) ||
627 (!hasbandindex[0] && hasbandindex[1])
629 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
630 for (k = 0; k < set_count; k++) {
632 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
639 for (k = 0; k < set_count; k++) {
641 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
643 elog(ERROR,
"The two rasters provided have different SRIDs");
648 rast[0], (hasbandindex[0] ? (
int)bandindex[0] - 1 : -1),
649 rast[1], (hasbandindex[1] ? (
int)bandindex[1] - 1 : -1),
652 for (k = 0; k < set_count; k++) {
654 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
658 elog(ERROR,
"RASTER_containsProperly: Could not test that the first raster contains properly the second raster");
662 PG_RETURN_BOOL(result);
673 int pgrastpos[2] = {-1, -1};
685 for (i = 0, j = 0; i < set_count; i++) {
687 if (PG_ARGISNULL(j)) {
688 for (k = 0; k < i; k++) {
690 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
694 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
701 for (k = 0; k <= i; k++) {
704 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
706 elog(ERROR,
"RASTER_covers: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
713 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
715 for (k = 0; k < i; k++) {
717 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
723 if (!PG_ARGISNULL(j)) {
724 bandindex[i] = PG_GETARG_INT32(j);
725 if (bandindex[i] < 1 || bandindex[i] > numBands) {
726 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
728 for (k = 0; k < i; k++) {
730 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
745 (hasbandindex[0] && !hasbandindex[1]) ||
746 (!hasbandindex[0] && hasbandindex[1])
748 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
749 for (k = 0; k < set_count; k++) {
751 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
758 for (k = 0; k < set_count; k++) {
760 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
762 elog(ERROR,
"The two rasters provided have different SRIDs");
767 rast[0], (hasbandindex[0] ? (
int)bandindex[0] - 1 : -1),
768 rast[1], (hasbandindex[1] ? (
int)bandindex[1] - 1 : -1),
771 for (k = 0; k < set_count; k++) {
773 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
777 elog(ERROR,
"RASTER_covers: Could not test that the first raster covers the second raster");
781 PG_RETURN_BOOL(result);
792 int pgrastpos[2] = {-1, -1};
804 for (i = 0, j = 0; i < set_count; i++) {
806 if (PG_ARGISNULL(j)) {
807 for (k = 0; k < i; k++) {
809 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
813 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
820 for (k = 0; k <= i; k++) {
823 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
825 elog(ERROR,
"RASTER_coveredby: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
832 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
834 for (k = 0; k < i; k++) {
836 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
842 if (!PG_ARGISNULL(j)) {
843 bandindex[i] = PG_GETARG_INT32(j);
844 if (bandindex[i] < 1 || bandindex[i] > numBands) {
845 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
847 for (k = 0; k < i; k++) {
849 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
864 (hasbandindex[0] && !hasbandindex[1]) ||
865 (!hasbandindex[0] && hasbandindex[1])
867 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
868 for (k = 0; k < set_count; k++) {
870 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
877 for (k = 0; k < set_count; k++) {
879 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
881 elog(ERROR,
"The two rasters provided have different SRIDs");
886 rast[0], (hasbandindex[0] ? (
int)bandindex[0] - 1 : -1),
887 rast[1], (hasbandindex[1] ? (
int)bandindex[1] - 1 : -1),
890 for (k = 0; k < set_count; k++) {
892 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
896 elog(ERROR,
"RASTER_coveredby: Could not test that the first raster is covered by the second raster");
900 PG_RETURN_BOOL(result);
911 int pgrastpos[2] = {-1, -1};
924 for (i = 0, j = 0; i < set_count; i++) {
926 if (PG_ARGISNULL(j)) {
927 for (k = 0; k < i; k++) {
929 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
933 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
940 for (k = 0; k <= i; k++) {
943 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
945 elog(ERROR,
"RASTER_dwithin: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
952 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
954 for (k = 0; k < i; k++) {
956 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
962 if (!PG_ARGISNULL(j)) {
963 bandindex[i] = PG_GETARG_INT32(j);
964 if (bandindex[i] < 1 || bandindex[i] > numBands) {
965 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
967 for (k = 0; k < i; k++) {
969 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
983 if (PG_ARGISNULL(4)) {
984 elog(NOTICE,
"Distance cannot be NULL. Returning NULL");
985 for (k = 0; k < set_count; k++) {
987 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
994 elog(NOTICE,
"Distance cannot be less than zero. Returning NULL");
995 for (k = 0; k < set_count; k++) {
997 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1004 (hasbandindex[0] && !hasbandindex[1]) ||
1005 (!hasbandindex[0] && hasbandindex[1])
1007 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
1008 for (k = 0; k < set_count; k++) {
1010 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1017 for (k = 0; k < set_count; k++) {
1019 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1021 elog(ERROR,
"The two rasters provided have different SRIDs");
1026 rast[0], (hasbandindex[0] ? (
int)bandindex[0] - 1 : -1),
1027 rast[1], (hasbandindex[1] ? (
int)bandindex[1] - 1 : -1),
1031 for (k = 0; k < set_count; k++) {
1033 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1037 elog(ERROR,
"RASTER_dwithin: Could not test that the two rasters are within the specified distance of each other");
1041 PG_RETURN_BOOL(result);
1052 int pgrastpos[2] = {-1, -1};
1065 for (i = 0, j = 0; i < set_count; i++) {
1067 if (PG_ARGISNULL(j)) {
1068 for (k = 0; k < i; k++) {
1070 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1074 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
1081 for (k = 0; k <= i; k++) {
1084 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1086 elog(ERROR,
"RASTER_dfullywithin: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
1093 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
1095 for (k = 0; k < i; k++) {
1097 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1103 if (!PG_ARGISNULL(j)) {
1104 bandindex[i] = PG_GETARG_INT32(j);
1105 if (bandindex[i] < 1 || bandindex[i] > numBands) {
1106 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
1108 for (k = 0; k < i; k++) {
1110 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1114 hasbandindex[i] = 1;
1117 hasbandindex[i] = 0;
1124 if (PG_ARGISNULL(4)) {
1125 elog(NOTICE,
"Distance cannot be NULL. Returning NULL");
1126 for (k = 0; k < set_count; k++) {
1128 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1135 elog(NOTICE,
"Distance cannot be less than zero. Returning NULL");
1136 for (k = 0; k < set_count; k++) {
1138 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1145 (hasbandindex[0] && !hasbandindex[1]) ||
1146 (!hasbandindex[0] && hasbandindex[1])
1148 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
1149 for (k = 0; k < set_count; k++) {
1151 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1158 for (k = 0; k < set_count; k++) {
1160 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1162 elog(ERROR,
"The two rasters provided have different SRIDs");
1167 rast[0], (hasbandindex[0] ? (
int)bandindex[0] - 1 : -1),
1168 rast[1], (hasbandindex[1] ? (
int)bandindex[1] - 1 : -1),
1172 for (k = 0; k < set_count; k++) {
1174 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1178 elog(ERROR,
"RASTER_dfullywithin: Could not test that the two rasters are fully within the specified distance of each other");
1182 PG_RETURN_BOOL(result);
1193 int pgrastpos[2] = {-1, -1};
1201 char *reason = NULL;
1203 for (i = 0, j = 0; i < set_count; i++) {
1205 if (PG_ARGISNULL(j)) {
1206 for (k = 0; k < i; k++) {
1208 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1219 for (k = 0; k <= i; k++) {
1222 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1224 elog(ERROR,
"RASTER_sameAlignment: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
1235 for (k = 0; k < set_count; k++) {
1237 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1241 elog(ERROR,
"RASTER_sameAlignment: Could not test for alignment on the two rasters");
1246 if (reason != NULL && !aligned)
1247 elog(NOTICE,
"%s", reason);
1249 PG_RETURN_BOOL(aligned);
1260 int pgrastpos[2] = {-1, -1};
1268 char *reason = NULL;
1269 text *result = NULL;
1271 for (i = 0, j = 0; i < set_count; i++) {
1273 if (PG_ARGISNULL(j)) {
1274 for (k = 0; k < i; k++) {
1276 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1287 for (k = 0; k <= i; k++) {
1290 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1292 elog(ERROR,
"RASTER_notSameAlignmentReason: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
1303 for (k = 0; k < set_count; k++) {
1305 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1309 elog(ERROR,
"RASTER_notSameAlignmentReason: Could not test for alignment on the two rasters");
1313 result = cstring_to_text(reason);
1314 PG_RETURN_TEXT_P(result);
rt_errorstate rt_raster_contains(rt_raster rast1, int nband1, rt_raster rast2, int nband2, int *contains)
Return ES_ERROR if error occurred in function.
rt_errorstate rt_raster_fully_within_distance(rt_raster rast1, int nband1, rt_raster rast2, int nband2, double distance, int *dfwithin)
Return ES_ERROR if error occurred in function.
int32_t rt_raster_get_srid(rt_raster raster)
Get raster's SRID.
rt_errorstate rt_raster_contains_properly(rt_raster rast1, int nband1, rt_raster rast2, int nband2, int *contains)
Return ES_ERROR if error occurred in function.
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
rt_errorstate rt_raster_intersects(rt_raster rast1, int nband1, rt_raster rast2, int nband2, int *intersects)
Return ES_ERROR if error occurred in function.
rt_errorstate rt_raster_coveredby(rt_raster rast1, int nband1, rt_raster rast2, int nband2, int *coveredby)
Return ES_ERROR if error occurred in function.
rt_errorstate rt_raster_touches(rt_raster rast1, int nband1, rt_raster rast2, int nband2, int *touches)
Return ES_ERROR if error occurred in function.
rt_errorstate rt_raster_overlaps(rt_raster rast1, int nband1, rt_raster rast2, int nband2, int *overlaps)
Return ES_ERROR if error occurred in function.
uint16_t rt_raster_get_num_bands(rt_raster raster)
rt_errorstate rt_raster_within_distance(rt_raster rast1, int nband1, rt_raster rast2, int nband2, double distance, int *dwithin)
Return ES_ERROR if error occurred in function.
rt_errorstate rt_raster_same_alignment(rt_raster rast1, rt_raster rast2, int *aligned, char **reason)
rt_errorstate rt_raster_covers(rt_raster rast1, int nband1, rt_raster rast2, int nband2, int *covers)
Return ES_ERROR if error occurred in function.
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
Datum distance(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(RASTER_intersects)
See if two rasters intersect.
Datum RASTER_coveredby(PG_FUNCTION_ARGS)
Datum RASTER_sameAlignment(PG_FUNCTION_ARGS)
Datum RASTER_containsProperly(PG_FUNCTION_ARGS)
Datum RASTER_dfullywithin(PG_FUNCTION_ARGS)
Datum RASTER_notSameAlignmentReason(PG_FUNCTION_ARGS)
Datum RASTER_dwithin(PG_FUNCTION_ARGS)
Datum RASTER_contains(PG_FUNCTION_ARGS)
Datum RASTER_intersects(PG_FUNCTION_ARGS)
Datum RASTER_covers(PG_FUNCTION_ARGS)
Datum RASTER_touches(PG_FUNCTION_ARGS)
Datum RASTER_overlaps(PG_FUNCTION_ARGS)
#define POSTGIS_RT_DEBUGF(level, msg,...)