33 #include "../../postgis_config.h" 35 #include "lwgeom_pg.h" 75 const int set_count = 2;
77 int pgrastpos[2] = {-1, -1};
89 for (i = 0, j = 0; i < set_count; i++) {
91 if (PG_ARGISNULL(j)) {
92 for (k = 0; k < i; k++) {
94 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
98 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
105 for (k = 0; k <= i; k++) {
108 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
110 elog(ERROR,
"RASTER_intersects: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
117 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
119 for (k = 0; k < i; k++) {
121 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
127 if (!PG_ARGISNULL(j)) {
128 bandindex[i] = PG_GETARG_INT32(j);
129 if (bandindex[i] < 1 || bandindex[i] > numBands) {
130 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
132 for (k = 0; k < i; k++) {
134 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
149 (hasbandindex[0] && !hasbandindex[1]) ||
150 (!hasbandindex[0] && hasbandindex[1])
152 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
153 for (k = 0; k < set_count; k++) {
155 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
162 for (k = 0; k < set_count; k++) {
164 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
166 elog(ERROR,
"The two rasters provided have different SRIDs");
171 rast[0], (hasbandindex[0] ? bandindex[0] - 1 : -1),
172 rast[1], (hasbandindex[1] ? bandindex[1] - 1 : -1),
175 for (k = 0; k < set_count; k++) {
177 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
181 elog(ERROR,
"RASTER_intersects: Could not test for intersection on the two rasters");
185 PG_RETURN_BOOL(result);
194 const int set_count = 2;
196 int pgrastpos[2] = {-1, -1};
208 for (i = 0, j = 0; i < set_count; i++) {
210 if (PG_ARGISNULL(j)) {
211 for (k = 0; k < i; k++) {
213 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
217 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
224 for (k = 0; k <= i; k++) {
227 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
229 elog(ERROR,
"RASTER_overlaps: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
236 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
238 for (k = 0; k < i; k++) {
240 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
246 if (!PG_ARGISNULL(j)) {
247 bandindex[i] = PG_GETARG_INT32(j);
248 if (bandindex[i] < 1 || bandindex[i] > numBands) {
249 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
251 for (k = 0; k < i; k++) {
253 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
268 (hasbandindex[0] && !hasbandindex[1]) ||
269 (!hasbandindex[0] && hasbandindex[1])
271 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
272 for (k = 0; k < set_count; k++) {
274 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
281 for (k = 0; k < set_count; k++) {
283 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
285 elog(ERROR,
"The two rasters provided have different SRIDs");
290 rast[0], (hasbandindex[0] ? bandindex[0] - 1 : -1),
291 rast[1], (hasbandindex[1] ? bandindex[1] - 1 : -1),
294 for (k = 0; k < set_count; k++) {
296 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
300 elog(ERROR,
"RASTER_overlaps: Could not test for overlap on the two rasters");
304 PG_RETURN_BOOL(result);
313 const int set_count = 2;
315 int pgrastpos[2] = {-1, -1};
327 for (i = 0, j = 0; i < set_count; i++) {
329 if (PG_ARGISNULL(j)) {
330 for (k = 0; k < i; k++) {
332 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
336 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
343 for (k = 0; k <= i; k++) {
346 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
348 elog(ERROR,
"RASTER_touches: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
355 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
357 for (k = 0; k < i; k++) {
359 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
365 if (!PG_ARGISNULL(j)) {
366 bandindex[i] = PG_GETARG_INT32(j);
367 if (bandindex[i] < 1 || bandindex[i] > numBands) {
368 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
370 for (k = 0; k < i; k++) {
372 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
387 (hasbandindex[0] && !hasbandindex[1]) ||
388 (!hasbandindex[0] && hasbandindex[1])
390 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
391 for (k = 0; k < set_count; k++) {
393 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
400 for (k = 0; k < set_count; k++) {
402 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
404 elog(ERROR,
"The two rasters provided have different SRIDs");
409 rast[0], (hasbandindex[0] ? bandindex[0] - 1 : -1),
410 rast[1], (hasbandindex[1] ? bandindex[1] - 1 : -1),
413 for (k = 0; k < set_count; k++) {
415 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
419 elog(ERROR,
"RASTER_touches: Could not test for touch on the two rasters");
423 PG_RETURN_BOOL(result);
432 const int set_count = 2;
434 int pgrastpos[2] = {-1, -1};
446 for (i = 0, j = 0; i < set_count; i++) {
448 if (PG_ARGISNULL(j)) {
449 for (k = 0; k < i; k++) {
451 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
455 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
462 for (k = 0; k <= i; k++) {
465 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
467 elog(ERROR,
"RASTER_contains: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
474 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
476 for (k = 0; k < i; k++) {
478 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
484 if (!PG_ARGISNULL(j)) {
485 bandindex[i] = PG_GETARG_INT32(j);
486 if (bandindex[i] < 1 || bandindex[i] > numBands) {
487 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
489 for (k = 0; k < i; k++) {
491 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
506 (hasbandindex[0] && !hasbandindex[1]) ||
507 (!hasbandindex[0] && hasbandindex[1])
509 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
510 for (k = 0; k < set_count; k++) {
512 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
519 for (k = 0; k < set_count; k++) {
521 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
523 elog(ERROR,
"The two rasters provided have different SRIDs");
528 rast[0], (hasbandindex[0] ? bandindex[0] - 1 : -1),
529 rast[1], (hasbandindex[1] ? bandindex[1] - 1 : -1),
532 for (k = 0; k < set_count; k++) {
534 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
538 elog(ERROR,
"RASTER_contains: Could not test that the first raster contains the second raster");
542 PG_RETURN_BOOL(result);
551 const int set_count = 2;
553 int pgrastpos[2] = {-1, -1};
565 for (i = 0, j = 0; i < set_count; i++) {
567 if (PG_ARGISNULL(j)) {
568 for (k = 0; k < i; k++) {
570 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
574 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
581 for (k = 0; k <= i; k++) {
584 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
586 elog(ERROR,
"RASTER_containsProperly: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
593 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
595 for (k = 0; k < i; k++) {
597 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
603 if (!PG_ARGISNULL(j)) {
604 bandindex[i] = PG_GETARG_INT32(j);
605 if (bandindex[i] < 1 || bandindex[i] > numBands) {
606 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
608 for (k = 0; k < i; k++) {
610 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
625 (hasbandindex[0] && !hasbandindex[1]) ||
626 (!hasbandindex[0] && hasbandindex[1])
628 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
629 for (k = 0; k < set_count; k++) {
631 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
638 for (k = 0; k < set_count; k++) {
640 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
642 elog(ERROR,
"The two rasters provided have different SRIDs");
647 rast[0], (hasbandindex[0] ? bandindex[0] - 1 : -1),
648 rast[1], (hasbandindex[1] ? bandindex[1] - 1 : -1),
651 for (k = 0; k < set_count; k++) {
653 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
657 elog(ERROR,
"RASTER_containsProperly: Could not test that the first raster contains properly the second raster");
661 PG_RETURN_BOOL(result);
670 const int set_count = 2;
672 int pgrastpos[2] = {-1, -1};
684 for (i = 0, j = 0; i < set_count; i++) {
686 if (PG_ARGISNULL(j)) {
687 for (k = 0; k < i; k++) {
689 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
693 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
700 for (k = 0; k <= i; k++) {
703 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
705 elog(ERROR,
"RASTER_covers: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
712 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
714 for (k = 0; k < i; k++) {
716 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
722 if (!PG_ARGISNULL(j)) {
723 bandindex[i] = PG_GETARG_INT32(j);
724 if (bandindex[i] < 1 || bandindex[i] > numBands) {
725 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
727 for (k = 0; k < i; k++) {
729 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
744 (hasbandindex[0] && !hasbandindex[1]) ||
745 (!hasbandindex[0] && hasbandindex[1])
747 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
748 for (k = 0; k < set_count; k++) {
750 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
757 for (k = 0; k < set_count; k++) {
759 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
761 elog(ERROR,
"The two rasters provided have different SRIDs");
766 rast[0], (hasbandindex[0] ? bandindex[0] - 1 : -1),
767 rast[1], (hasbandindex[1] ? bandindex[1] - 1 : -1),
770 for (k = 0; k < set_count; k++) {
772 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
776 elog(ERROR,
"RASTER_covers: Could not test that the first raster covers the second raster");
780 PG_RETURN_BOOL(result);
789 const int set_count = 2;
791 int pgrastpos[2] = {-1, -1};
803 for (i = 0, j = 0; i < set_count; i++) {
805 if (PG_ARGISNULL(j)) {
806 for (k = 0; k < i; k++) {
808 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
812 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
819 for (k = 0; k <= i; k++) {
822 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
824 elog(ERROR,
"RASTER_coveredby: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
831 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
833 for (k = 0; k < i; k++) {
835 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
841 if (!PG_ARGISNULL(j)) {
842 bandindex[i] = PG_GETARG_INT32(j);
843 if (bandindex[i] < 1 || bandindex[i] > numBands) {
844 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
846 for (k = 0; k < i; k++) {
848 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
863 (hasbandindex[0] && !hasbandindex[1]) ||
864 (!hasbandindex[0] && hasbandindex[1])
866 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
867 for (k = 0; k < set_count; k++) {
869 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
876 for (k = 0; k < set_count; k++) {
878 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
880 elog(ERROR,
"The two rasters provided have different SRIDs");
885 rast[0], (hasbandindex[0] ? bandindex[0] - 1 : -1),
886 rast[1], (hasbandindex[1] ? bandindex[1] - 1 : -1),
889 for (k = 0; k < set_count; k++) {
891 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
895 elog(ERROR,
"RASTER_coveredby: Could not test that the first raster is covered by the second raster");
899 PG_RETURN_BOOL(result);
908 const int set_count = 2;
910 int pgrastpos[2] = {-1, -1};
923 for (i = 0, j = 0; i < set_count; i++) {
925 if (PG_ARGISNULL(j)) {
926 for (k = 0; k < i; k++) {
928 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
932 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
939 for (k = 0; k <= i; k++) {
942 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
944 elog(ERROR,
"RASTER_dwithin: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
951 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
953 for (k = 0; k < i; k++) {
955 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
961 if (!PG_ARGISNULL(j)) {
962 bandindex[i] = PG_GETARG_INT32(j);
963 if (bandindex[i] < 1 || bandindex[i] > numBands) {
964 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
966 for (k = 0; k < i; k++) {
968 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
982 if (PG_ARGISNULL(4)) {
983 elog(NOTICE,
"Distance cannot be NULL. Returning NULL");
984 for (k = 0; k < set_count; k++) {
986 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
991 distance = PG_GETARG_FLOAT8(4);
993 elog(NOTICE,
"Distance cannot be less than zero. Returning NULL");
994 for (k = 0; k < set_count; k++) {
996 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1003 (hasbandindex[0] && !hasbandindex[1]) ||
1004 (!hasbandindex[0] && hasbandindex[1])
1006 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
1007 for (k = 0; k < set_count; k++) {
1009 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1016 for (k = 0; k < set_count; k++) {
1018 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1020 elog(ERROR,
"The two rasters provided have different SRIDs");
1025 rast[0], (hasbandindex[0] ? bandindex[0] - 1 : -1),
1026 rast[1], (hasbandindex[1] ? bandindex[1] - 1 : -1),
1030 for (k = 0; k < set_count; k++) {
1032 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1036 elog(ERROR,
"RASTER_dwithin: Could not test that the two rasters are within the specified distance of each other");
1040 PG_RETURN_BOOL(result);
1049 const int set_count = 2;
1051 int pgrastpos[2] = {-1, -1};
1064 for (i = 0, j = 0; i < set_count; i++) {
1066 if (PG_ARGISNULL(j)) {
1067 for (k = 0; k < i; k++) {
1069 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1073 pgrast[i] = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(j));
1080 for (k = 0; k <= i; k++) {
1083 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1085 elog(ERROR,
"RASTER_dfullywithin: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
1092 elog(NOTICE,
"The %s raster provided has no bands", i < 1 ?
"first" :
"second");
1094 for (k = 0; k < i; k++) {
1096 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1102 if (!PG_ARGISNULL(j)) {
1103 bandindex[i] = PG_GETARG_INT32(j);
1104 if (bandindex[i] < 1 || bandindex[i] > numBands) {
1105 elog(NOTICE,
"Invalid band index (must use 1-based) for the %s raster. Returning NULL", i < 1 ?
"first" :
"second");
1107 for (k = 0; k < i; k++) {
1109 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1113 hasbandindex[i] = 1;
1116 hasbandindex[i] = 0;
1123 if (PG_ARGISNULL(4)) {
1124 elog(NOTICE,
"Distance cannot be NULL. Returning NULL");
1125 for (k = 0; k < set_count; k++) {
1127 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1132 distance = PG_GETARG_FLOAT8(4);
1134 elog(NOTICE,
"Distance cannot be less than zero. Returning NULL");
1135 for (k = 0; k < set_count; k++) {
1137 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1144 (hasbandindex[0] && !hasbandindex[1]) ||
1145 (!hasbandindex[0] && hasbandindex[1])
1147 elog(NOTICE,
"Missing band index. Band indices must be provided for both rasters if any one is provided");
1148 for (k = 0; k < set_count; k++) {
1150 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1157 for (k = 0; k < set_count; k++) {
1159 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1161 elog(ERROR,
"The two rasters provided have different SRIDs");
1166 rast[0], (hasbandindex[0] ? bandindex[0] - 1 : -1),
1167 rast[1], (hasbandindex[1] ? bandindex[1] - 1 : -1),
1171 for (k = 0; k < set_count; k++) {
1173 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1177 elog(ERROR,
"RASTER_dfullywithin: Could not test that the two rasters are fully within the specified distance of each other");
1181 PG_RETURN_BOOL(result);
1190 const int set_count = 2;
1192 int pgrastpos[2] = {-1, -1};
1200 char *reason = NULL;
1202 for (i = 0, j = 0; i < set_count; i++) {
1204 if (PG_ARGISNULL(j)) {
1205 for (k = 0; k < i; k++) {
1207 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1218 for (k = 0; k <= i; k++) {
1221 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1223 elog(ERROR,
"RASTER_sameAlignment: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
1234 for (k = 0; k < set_count; k++) {
1236 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1240 elog(ERROR,
"RASTER_sameAlignment: Could not test for alignment on the two rasters");
1245 if (reason != NULL && !aligned)
1246 elog(NOTICE,
"%s", reason);
1248 PG_RETURN_BOOL(aligned);
1257 const int set_count = 2;
1259 int pgrastpos[2] = {-1, -1};
1267 char *reason = NULL;
1268 text *result = NULL;
1270 for (i = 0, j = 0; i < set_count; i++) {
1272 if (PG_ARGISNULL(j)) {
1273 for (k = 0; k < i; k++) {
1275 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1286 for (k = 0; k <= i; k++) {
1289 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1291 elog(ERROR,
"RASTER_notSameAlignmentReason: Could not deserialize the %s raster", i < 1 ?
"first" :
"second");
1302 for (k = 0; k < set_count; k++) {
1304 PG_FREE_IF_COPY(pgrast[k], pgrastpos[k]);
1308 elog(ERROR,
"RASTER_notSameAlignmentReason: Could not test for alignment on the two rasters");
1312 result = cstring2text(reason);
1313 PG_RETURN_TEXT_P(result);
Datum RASTER_contains(PG_FUNCTION_ARGS)
int rt_raster_get_num_bands(rt_raster raster)
Datum RASTER_containsProperly(PG_FUNCTION_ARGS)
rt_errorstate rt_raster_same_alignment(rt_raster rast1, rt_raster rast2, int *aligned, char **reason)
Datum RASTER_notSameAlignmentReason(PG_FUNCTION_ARGS)
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_errorstate rt_raster_contains(rt_raster rast1, int nband1, rt_raster rast2, int nband2, int *contains)
Return ES_ERROR if error occurred in function.
Datum RASTER_dwithin(PG_FUNCTION_ARGS)
PG_FUNCTION_INFO_V1(RASTER_intersects)
See if two rasters intersect.
#define POSTGIS_RT_DEBUGF(level, msg,...)
Datum RASTER_intersects(PG_FUNCTION_ARGS)
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.
Datum RASTER_covers(PG_FUNCTION_ARGS)
Datum RASTER_overlaps(PG_FUNCTION_ARGS)
int32_t rt_raster_get_srid(rt_raster raster)
Get raster's SRID.
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Datum distance(PG_FUNCTION_ARGS)
Datum RASTER_dfullywithin(PG_FUNCTION_ARGS)
Datum RASTER_sameAlignment(PG_FUNCTION_ARGS)
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.
Datum RASTER_coveredby(PG_FUNCTION_ARGS)
Datum RASTER_touches(PG_FUNCTION_ARGS)
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.
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_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_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
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.
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.