PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ RASTER_asRaster()

Datum RASTER_asRaster ( PG_FUNCTION_ARGS  )

Definition at line 723 of file rtpg_geometry.c.

References clamp_srid(), FLT_NEQ, gserialized_get_srid(), lwgeom_force_2d(), lwgeom_free(), lwgeom_from_gserialized(), lwgeom_is_empty(), lwgeom_ndims(), lwgeom_to_wkb(), MIN, POSTGIS_RT_DEBUG, POSTGIS_RT_DEBUGF, PT_64BF, PT_END, rtpixdump::rast, rt_pixtype_index_from_name(), rt_raster_destroy(), rt_raster_gdal_rasterize(), rt_raster_new(), rt_raster_serialize(), rt_raster_set_srid(), rtpg_getSR(), rtpg_trim(), rt_raster_serialized_t::size, rt_raster_serialized_t::srid, SRID_UNKNOWN, text_to_cstring(), TRUE, variant, and WKB_SFSQL.

Referenced by RASTER_getPolygon().

724 {
725  GSERIALIZED *gser = NULL;
726 
727  LWGEOM *geom = NULL;
728  rt_raster rast = NULL;
729  rt_pgraster *pgrast = NULL;
730 
731  unsigned char *wkb;
732  size_t wkb_len = 0;
733  unsigned char variant = WKB_SFSQL;
734 
735  double scale[2] = {0};
736  double *scale_x = NULL;
737  double *scale_y = NULL;
738 
739  int dim[2] = {0};
740  int *dim_x = NULL;
741  int *dim_y = NULL;
742 
743  ArrayType *array;
744  Oid etype;
745  Datum *e;
746  bool *nulls;
747  int16 typlen;
748  bool typbyval;
749  char typalign;
750  int n = 0;
751  int i = 0;
752  int j = 0;
753  int haserr = 0;
754 
755  text *pixeltypetext = NULL;
756  char *pixeltype = NULL;
757  rt_pixtype pixtype = PT_END;
758  rt_pixtype *pixtypes = NULL;
759  uint32_t pixtypes_len = 0;
760 
761  double *values = NULL;
762  uint32_t values_len = 0;
763 
764  uint8_t *hasnodatas = NULL;
765  double *nodatavals = NULL;
766  uint32_t nodatavals_len = 0;
767 
768  double ulw[2] = {0};
769  double *ul_xw = NULL;
770  double *ul_yw = NULL;
771 
772  double gridw[2] = {0};
773  double *grid_xw = NULL;
774  double *grid_yw = NULL;
775 
776  double skew[2] = {0};
777  double *skew_x = NULL;
778  double *skew_y = NULL;
779 
780  char **options = NULL;
781  int options_len = 0;
782 
783  uint32_t num_bands = 0;
784 
785  int srid = SRID_UNKNOWN;
786  char *srs = NULL;
787 
788  POSTGIS_RT_DEBUG(3, "RASTER_asRaster: Starting");
789 
790  /* based upon LWGEOM_asBinary function in postgis/lwgeom_ogc.c */
791 
792  /* Get the geometry */
793  if (PG_ARGISNULL(0))
794  PG_RETURN_NULL();
795 
796  gser = PG_GETARG_GSERIALIZED_P(0);
797  geom = lwgeom_from_gserialized(gser);
798 
799  /* Get a 2D version of the geometry if necessary */
800  if (lwgeom_ndims(geom) > 2) {
801  LWGEOM *geom2d = lwgeom_force_2d(geom);
802  lwgeom_free(geom);
803  geom = geom2d;
804  }
805 
806  /* empty geometry, return empty raster */
807  if (lwgeom_is_empty(geom)) {
808  POSTGIS_RT_DEBUG(3, "Input geometry is empty. Returning empty raster");
809  lwgeom_free(geom);
810  PG_FREE_IF_COPY(gser, 0);
811 
812  rast = rt_raster_new(0, 0);
813  if (rast == NULL)
814  PG_RETURN_NULL();
815 
816  pgrast = rt_raster_serialize(rast);
817  rt_raster_destroy(rast);
818 
819  if (NULL == pgrast)
820  PG_RETURN_NULL();
821 
822  SET_VARSIZE(pgrast, pgrast->size);
823  PG_RETURN_POINTER(pgrast);
824  }
825 
826  /* scale x */
827  if (!PG_ARGISNULL(1)) {
828  scale[0] = PG_GETARG_FLOAT8(1);
829  if (FLT_NEQ(scale[0], 0)) scale_x = &scale[0];
830  }
831 
832  /* scale y */
833  if (!PG_ARGISNULL(2)) {
834  scale[1] = PG_GETARG_FLOAT8(2);
835  if (FLT_NEQ(scale[1], 0)) scale_y = &scale[1];
836  }
837  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: scale (x, y) = %f, %f", scale[0], scale[1]);
838 
839  /* width */
840  if (!PG_ARGISNULL(3)) {
841  dim[0] = PG_GETARG_INT32(3);
842  if (dim[0] < 0) dim[0] = 0;
843  if (dim[0] != 0) dim_x = &dim[0];
844  }
845 
846  /* height */
847  if (!PG_ARGISNULL(4)) {
848  dim[1] = PG_GETARG_INT32(4);
849  if (dim[1] < 0) dim[1] = 0;
850  if (dim[1] != 0) dim_y = &dim[1];
851  }
852  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: dim (x, y) = %d, %d", dim[0], dim[1]);
853 
854  /* pixeltype */
855  if (!PG_ARGISNULL(5)) {
856  array = PG_GETARG_ARRAYTYPE_P(5);
857  etype = ARR_ELEMTYPE(array);
858  get_typlenbyvalalign(etype, &typlen, &typbyval, &typalign);
859 
860  switch (etype) {
861  case TEXTOID:
862  break;
863  default:
864 
865  lwgeom_free(geom);
866  PG_FREE_IF_COPY(gser, 0);
867 
868  elog(ERROR, "RASTER_asRaster: Invalid data type for pixeltype");
869  PG_RETURN_NULL();
870  break;
871  }
872 
873  deconstruct_array(array, etype, typlen, typbyval, typalign, &e,
874  &nulls, &n);
875 
876  if (n) {
877  pixtypes = (rt_pixtype *) palloc(sizeof(rt_pixtype) * n);
878  /* clean each pixeltype */
879  for (i = 0, j = 0; i < n; i++) {
880  if (nulls[i]) {
881  pixtypes[j++] = PT_64BF;
882  continue;
883  }
884 
885  pixeltype = NULL;
886  switch (etype) {
887  case TEXTOID:
888  pixeltypetext = (text *) DatumGetPointer(e[i]);
889  if (NULL == pixeltypetext) break;
890  pixeltype = text_to_cstring(pixeltypetext);
891 
892  /* trim string */
893  pixeltype = rtpg_trim(pixeltype);
894  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: pixeltype is '%s'", pixeltype);
895  break;
896  }
897 
898  if (strlen(pixeltype)) {
899  pixtype = rt_pixtype_index_from_name(pixeltype);
900  if (pixtype == PT_END) {
901 
902  pfree(pixtypes);
903 
904  lwgeom_free(geom);
905  PG_FREE_IF_COPY(gser, 0);
906 
907  elog(ERROR, "RASTER_asRaster: Invalid pixel type provided: %s", pixeltype);
908  PG_RETURN_NULL();
909  }
910 
911  pixtypes[j] = pixtype;
912  j++;
913  }
914  }
915 
916  if (j > 0) {
917  /* trim allocation */
918  pixtypes = repalloc(pixtypes, j * sizeof(rt_pixtype));
919  pixtypes_len = j;
920  }
921  else {
922  pfree(pixtypes);
923  pixtypes = NULL;
924  pixtypes_len = 0;
925  }
926  }
927  }
928 #if POSTGIS_DEBUG_LEVEL > 0
929  for (i = 0; i < pixtypes_len; i++)
930  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: pixtypes[%d] = %d", i, (int) pixtypes[i]);
931 #endif
932 
933  /* value */
934  if (!PG_ARGISNULL(6)) {
935  array = PG_GETARG_ARRAYTYPE_P(6);
936  etype = ARR_ELEMTYPE(array);
937  get_typlenbyvalalign(etype, &typlen, &typbyval, &typalign);
938 
939  switch (etype) {
940  case FLOAT4OID:
941  case FLOAT8OID:
942  break;
943  default:
944 
945  if (pixtypes_len) pfree(pixtypes);
946 
947  lwgeom_free(geom);
948  PG_FREE_IF_COPY(gser, 0);
949 
950  elog(ERROR, "RASTER_asRaster: Invalid data type for value");
951  PG_RETURN_NULL();
952  break;
953  }
954 
955  deconstruct_array(array, etype, typlen, typbyval, typalign, &e,
956  &nulls, &n);
957 
958  if (n) {
959  values = (double *) palloc(sizeof(double) * n);
960  for (i = 0, j = 0; i < n; i++) {
961  if (nulls[i]) {
962  values[j++] = 1;
963  continue;
964  }
965 
966  switch (etype) {
967  case FLOAT4OID:
968  values[j] = (double) DatumGetFloat4(e[i]);
969  break;
970  case FLOAT8OID:
971  values[j] = (double) DatumGetFloat8(e[i]);
972  break;
973  }
974  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: values[%d] = %f", j, values[j]);
975 
976  j++;
977  }
978 
979  if (j > 0) {
980  /* trim allocation */
981  values = repalloc(values, j * sizeof(double));
982  values_len = j;
983  }
984  else {
985  pfree(values);
986  values = NULL;
987  values_len = 0;
988  }
989  }
990  }
991 #if POSTGIS_DEBUG_LEVEL > 0
992  for (i = 0; i < values_len; i++)
993  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: values[%d] = %f", i, values[i]);
994 #endif
995 
996  /* nodataval */
997  if (!PG_ARGISNULL(7)) {
998  array = PG_GETARG_ARRAYTYPE_P(7);
999  etype = ARR_ELEMTYPE(array);
1000  get_typlenbyvalalign(etype, &typlen, &typbyval, &typalign);
1001 
1002  switch (etype) {
1003  case FLOAT4OID:
1004  case FLOAT8OID:
1005  break;
1006  default:
1007 
1008  if (pixtypes_len) pfree(pixtypes);
1009  if (values_len) pfree(values);
1010 
1011  lwgeom_free(geom);
1012  PG_FREE_IF_COPY(gser, 0);
1013 
1014  elog(ERROR, "RASTER_asRaster: Invalid data type for nodataval");
1015  PG_RETURN_NULL();
1016  break;
1017  }
1018 
1019  deconstruct_array(array, etype, typlen, typbyval, typalign, &e,
1020  &nulls, &n);
1021 
1022  if (n) {
1023  nodatavals = (double *) palloc(sizeof(double) * n);
1024  hasnodatas = (uint8_t *) palloc(sizeof(uint8_t) * n);
1025  for (i = 0, j = 0; i < n; i++) {
1026  if (nulls[i]) {
1027  hasnodatas[j] = 0;
1028  nodatavals[j] = 0;
1029  j++;
1030  continue;
1031  }
1032 
1033  hasnodatas[j] = 1;
1034  switch (etype) {
1035  case FLOAT4OID:
1036  nodatavals[j] = (double) DatumGetFloat4(e[i]);
1037  break;
1038  case FLOAT8OID:
1039  nodatavals[j] = (double) DatumGetFloat8(e[i]);
1040  break;
1041  }
1042  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: hasnodatas[%d] = %d", j, hasnodatas[j]);
1043  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: nodatavals[%d] = %f", j, nodatavals[j]);
1044 
1045  j++;
1046  }
1047 
1048  if (j > 0) {
1049  /* trim allocation */
1050  nodatavals = repalloc(nodatavals, j * sizeof(double));
1051  hasnodatas = repalloc(hasnodatas, j * sizeof(uint8_t));
1052  nodatavals_len = j;
1053  }
1054  else {
1055  pfree(nodatavals);
1056  pfree(hasnodatas);
1057  nodatavals = NULL;
1058  hasnodatas = NULL;
1059  nodatavals_len = 0;
1060  }
1061  }
1062  }
1063 #if POSTGIS_DEBUG_LEVEL > 0
1064  for (i = 0; i < nodatavals_len; i++) {
1065  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: hasnodatas[%d] = %d", i, hasnodatas[i]);
1066  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: nodatavals[%d] = %f", i, nodatavals[i]);
1067  }
1068 #endif
1069 
1070  /* upperleftx */
1071  if (!PG_ARGISNULL(8)) {
1072  ulw[0] = PG_GETARG_FLOAT8(8);
1073  ul_xw = &ulw[0];
1074  }
1075 
1076  /* upperlefty */
1077  if (!PG_ARGISNULL(9)) {
1078  ulw[1] = PG_GETARG_FLOAT8(9);
1079  ul_yw = &ulw[1];
1080  }
1081  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: upperleft (x, y) = %f, %f", ulw[0], ulw[1]);
1082 
1083  /* gridx */
1084  if (!PG_ARGISNULL(10)) {
1085  gridw[0] = PG_GETARG_FLOAT8(10);
1086  grid_xw = &gridw[0];
1087  }
1088 
1089  /* gridy */
1090  if (!PG_ARGISNULL(11)) {
1091  gridw[1] = PG_GETARG_FLOAT8(11);
1092  grid_yw = &gridw[1];
1093  }
1094  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: grid (x, y) = %f, %f", gridw[0], gridw[1]);
1095 
1096  /* check dependent variables */
1097  haserr = 0;
1098  do {
1099  /* only part of scale provided */
1100  if (
1101  (scale_x == NULL && scale_y != NULL) ||
1102  (scale_x != NULL && scale_y == NULL)
1103  ) {
1104  elog(NOTICE, "Values must be provided for both X and Y of scale if one is specified");
1105  haserr = 1;
1106  break;
1107  }
1108 
1109  /* only part of dimension provided */
1110  if (
1111  (dim_x == NULL && dim_y != NULL) ||
1112  (dim_x != NULL && dim_y == NULL)
1113  ) {
1114  elog(NOTICE, "Values must be provided for both width and height if one is specified");
1115  haserr = 1;
1116  break;
1117  }
1118 
1119  /* scale and dimension provided */
1120  if (
1121  (scale_x != NULL && scale_y != NULL) &&
1122  (dim_x != NULL && dim_y != NULL)
1123  ) {
1124  elog(NOTICE, "Values provided for X and Y of scale and width and height. Using the width and height");
1125  scale_x = NULL;
1126  scale_y = NULL;
1127  break;
1128  }
1129 
1130  /* neither scale or dimension provided */
1131  if (
1132  (scale_x == NULL && scale_y == NULL) &&
1133  (dim_x == NULL && dim_y == NULL)
1134  ) {
1135  elog(NOTICE, "Values must be provided for X and Y of scale or width and height");
1136  haserr = 1;
1137  break;
1138  }
1139 
1140  /* only part of upper-left provided */
1141  if (
1142  (ul_xw == NULL && ul_yw != NULL) ||
1143  (ul_xw != NULL && ul_yw == NULL)
1144  ) {
1145  elog(NOTICE, "Values must be provided for both X and Y when specifying the upper-left corner");
1146  haserr = 1;
1147  break;
1148  }
1149 
1150  /* only part of alignment provided */
1151  if (
1152  (grid_xw == NULL && grid_yw != NULL) ||
1153  (grid_xw != NULL && grid_yw == NULL)
1154  ) {
1155  elog(NOTICE, "Values must be provided for both X and Y when specifying the alignment");
1156  haserr = 1;
1157  break;
1158  }
1159 
1160  /* upper-left and alignment provided */
1161  if (
1162  (ul_xw != NULL && ul_yw != NULL) &&
1163  (grid_xw != NULL && grid_yw != NULL)
1164  ) {
1165  elog(NOTICE, "Values provided for both X and Y of upper-left corner and alignment. Using the values of upper-left corner");
1166  grid_xw = NULL;
1167  grid_yw = NULL;
1168  break;
1169  }
1170  }
1171  while (0);
1172 
1173  if (haserr) {
1174  if (pixtypes_len) pfree(pixtypes);
1175  if (values_len) pfree(values);
1176  if (nodatavals_len) {
1177  pfree(nodatavals);
1178  pfree(hasnodatas);
1179  }
1180 
1181  lwgeom_free(geom);
1182  PG_FREE_IF_COPY(gser, 0);
1183 
1184  PG_RETURN_NULL();
1185  }
1186 
1187  /* skewx */
1188  if (!PG_ARGISNULL(12)) {
1189  skew[0] = PG_GETARG_FLOAT8(12);
1190  if (FLT_NEQ(skew[0], 0)) skew_x = &skew[0];
1191  }
1192 
1193  /* skewy */
1194  if (!PG_ARGISNULL(13)) {
1195  skew[1] = PG_GETARG_FLOAT8(13);
1196  if (FLT_NEQ(skew[1], 0)) skew_y = &skew[1];
1197  }
1198  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: skew (x, y) = %f, %f", skew[0], skew[1]);
1199 
1200  /* all touched */
1201  if (!PG_ARGISNULL(14) && PG_GETARG_BOOL(14) == TRUE) {
1202  if (options_len == 0) {
1203  options_len = 1;
1204  options = (char **) palloc(sizeof(char *) * options_len);
1205  }
1206  else {
1207  options_len++;
1208  options = (char **) repalloc(options, sizeof(char *) * options_len);
1209  }
1210 
1211  options[options_len - 1] = palloc(sizeof(char*) * (strlen("ALL_TOUCHED=TRUE") + 1));
1212  strcpy(options[options_len - 1], "ALL_TOUCHED=TRUE");
1213  }
1214 
1215  if (options_len) {
1216  options_len++;
1217  options = (char **) repalloc(options, sizeof(char *) * options_len);
1218  options[options_len - 1] = NULL;
1219  }
1220 
1221  /* get geometry's srid */
1222  srid = gserialized_get_srid(gser);
1223 
1224  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: srid = %d", srid);
1225  if (clamp_srid(srid) != SRID_UNKNOWN) {
1226  srs = rtpg_getSR(srid);
1227  if (NULL == srs) {
1228 
1229  if (pixtypes_len) pfree(pixtypes);
1230  if (values_len) pfree(values);
1231  if (nodatavals_len) {
1232  pfree(hasnodatas);
1233  pfree(nodatavals);
1234  }
1235  if (options_len) pfree(options);
1236 
1237  lwgeom_free(geom);
1238  PG_FREE_IF_COPY(gser, 0);
1239 
1240  elog(ERROR, "RASTER_asRaster: Could not find srtext for SRID (%d)", srid);
1241  PG_RETURN_NULL();
1242  }
1243  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: srs is %s", srs);
1244  }
1245  else
1246  srs = NULL;
1247 
1248  /* determine number of bands */
1249  /* MIN macro is from GDAL's cpl_port.h */
1250  num_bands = MIN(pixtypes_len, values_len);
1251  num_bands = MIN(num_bands, nodatavals_len);
1252  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: pixtypes_len = %d", pixtypes_len);
1253  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: values_len = %d", values_len);
1254  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: nodatavals_len = %d", nodatavals_len);
1255  POSTGIS_RT_DEBUGF(3, "RASTER_asRaster: num_bands = %d", num_bands);
1256 
1257  /* warn of imbalanced number of band elements */
1258  if (!(
1259  (pixtypes_len == values_len) &&
1260  (values_len == nodatavals_len)
1261  )) {
1262  elog(
1263  NOTICE,
1264  "Imbalanced number of values provided for pixeltype (%d), value (%d) and nodataval (%d). Using the first %d values of each parameter",
1265  pixtypes_len,
1266  values_len,
1267  nodatavals_len,
1268  num_bands
1269  );
1270  }
1271 
1272  /* get wkb of geometry */
1273  POSTGIS_RT_DEBUG(3, "RASTER_asRaster: getting wkb of geometry");
1274  wkb = lwgeom_to_wkb(geom, variant, &wkb_len);
1275  lwgeom_free(geom);
1276  PG_FREE_IF_COPY(gser, 0);
1277 
1278  /* rasterize geometry */
1279  POSTGIS_RT_DEBUG(3, "RASTER_asRaster: rasterizing geometry");
1280  /* use nodatavals for the init parameter */
1281  rast = rt_raster_gdal_rasterize(wkb,
1282  (uint32_t) wkb_len, srs,
1283  num_bands, pixtypes,
1284  nodatavals, values,
1285  nodatavals, hasnodatas,
1286  dim_x, dim_y,
1287  scale_x, scale_y,
1288  ul_xw, ul_yw,
1289  grid_xw, grid_yw,
1290  skew_x, skew_y,
1291  options
1292  );
1293 
1294  if (pixtypes_len) pfree(pixtypes);
1295  if (values_len) pfree(values);
1296  if (nodatavals_len) {
1297  pfree(hasnodatas);
1298  pfree(nodatavals);
1299  }
1300  if (options_len) pfree(options);
1301 
1302  if (!rast) {
1303  elog(ERROR, "RASTER_asRaster: Could not rasterize geometry");
1304  PG_RETURN_NULL();
1305  }
1306 
1307  /* add target srid */
1308  rt_raster_set_srid(rast, srid);
1309 
1310  pgrast = rt_raster_serialize(rast);
1311  rt_raster_destroy(rast);
1312 
1313  if (NULL == pgrast) PG_RETURN_NULL();
1314 
1315  POSTGIS_RT_DEBUG(3, "RASTER_asRaster: done");
1316 
1317  SET_VARSIZE(pgrast, pgrast->size);
1318  PG_RETURN_POINTER(pgrast);
1319 }
char * text_to_cstring(const text *textptr)
int clamp_srid(int srid)
Return a valid SRID from an arbitrary integer Raises a notice if what comes out is different from wha...
Definition: lwutil.c:347
void * rt_raster_serialize(rt_raster raster)
Return this raster in serialized form.
Definition: rt_serialize.c:521
uint8_t variant
Definition: cu_in_twkb.c:26
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1144
rt_raster rt_raster_gdal_rasterize(const unsigned char *wkb, uint32_t wkb_len, const char *srs, uint32_t num_bands, rt_pixtype *pixtype, double *init, double *value, double *nodata, uint8_t *hasnodata, int *width, int *height, double *scale_x, double *scale_y, double *ul_xw, double *ul_yw, double *grid_xw, double *grid_yw, double *skew_x, double *skew_y, char **options)
Return a raster of the provided geometry.
Definition: rt_raster.c:2509
#define MIN(a, b)
Definition: shpopen.c:283
rt_pixtype
Definition: librtcore.h:185
int lwgeom_ndims(const LWGEOM *geom)
Return the number of dimensions (2, 3, 4) in a geometry.
Definition: lwgeom.c:944
#define WKB_SFSQL
Definition: liblwgeom.h:2066
#define POSTGIS_RT_DEBUGF(level, msg,...)
Definition: rtpostgis.h:65
unsigned int uint32_t
Definition: uthash.h:78
uint8_t * lwgeom_to_wkb(const LWGEOM *geom, uint8_t variant, size_t *size_out)
Convert LWGEOM to a char* in WKB format.
Definition: lwout_wkb.c:764
rt_pixtype rt_pixtype_index_from_name(const char *pixname)
Definition: rt_pixel.c:80
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:187
LWGEOM * lwgeom_force_2d(const LWGEOM *geom)
Strip out the Z/M components of an LWGEOM.
Definition: lwgeom.c:784
#define FLT_NEQ(x, y)
Definition: librtcore.h:2233
char * rtpg_trim(const char *input)
void rt_raster_set_srid(rt_raster raster, int32_t srid)
Set raster&#39;s SRID.
Definition: rt_raster.c:363
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_raster.c:82
rt_raster rt_raster_new(uint32_t width, uint32_t height)
Construct a raster with given dimensions.
Definition: rt_raster.c:48
Struct definitions.
Definition: librtcore.h:2250
char * rtpg_getSR(int srid)
#define POSTGIS_RT_DEBUG(level, msg)
Definition: rtpostgis.h:61
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
Definition: lwgeom.c:1393
unsigned char uint8_t
Definition: uthash.h:79
#define TRUE
Definition: dbfopen.c:169
int32_t gserialized_get_srid(const GSERIALIZED *s)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
Definition: g_serialized.c:99
Here is the call graph for this function:
Here is the caller graph for this function: