ERROR:  rt_raster_gdal_rasterize: Could not create OGR Geometry from WKB
********** Error **********

ERROR: rt_raster_gdal_rasterize: Could not create OGR Geometry from WKB
SQL state: XX000


I am trying to create Raster from TIN surface created using number of survey points available to me and store it in database. These points have Z Dimension.

I have created geometry that represents all points using ST_Union and applied ST_DelaunayTriangles to obtain "Delaunay triangulation" around the given input points.

To obtain TIN geometry, I have used workaround provided in below link https://smathermather.wordpress.com/2013/12/18/2-5d-tins-in-postgis/

I verified the TIN surface in QGIS at this point and it looks fine.

Now I need to create DEM raster for this surface. When applying ST_AsRaster,

select ST_AsRaster(ST_DelaunayTriangles(ST_Union(ARRAY(select survey_point from table))),150, 150, '2BUI');

I get above error.

  • Error XX000 usually means there is an error in an external lib, probably GEOSm that results from an invalid geometry in some intermediate stage of the processing. It would help if you could upload some data to replicate this? – John Powell Feb 6 '15 at 12:47

ST_AsRaster does not support the TIN type yet. It may in the future but doesn't right now. You could use the default behavior to return a geometry collection of triangles, since I think ST_AsRaster does support that. Though I suspect that might not be what you are looking for.

As a general note, functions that support Tin are noted in the description of each function. If you don't see TIN mentioned, then it doesn't support it.

  • I had the same doubt when looking at documentation of ST_Raster, but was confused after looking at error message thrown when trying to convert TIN surface. Thanks for your input, I am keeping the question open for few more days to see if any other inputs are obtained on this topic. – 3218801 Feb 9 '15 at 9:51
  • I think I may have spoken too soon. Just noticed you are using the default ST_DelaunayTriangles call, which returns a collection of polygons (not a TIN). ST_AsRaster doesn't support Z either I don't think, but I think it just flattens it in general instead of complaining. What does your SELECT postgis_full_version(); return? What you really want to do is probably store the Z as the raster band value of each polygon. I have a trick for that somewhere. Will post if I can find it. – LR1234567 Feb 10 '15 at 2:29
  • POSTGIS="2.1.4 r12966" GEOS="3.4.2-CAPI-1.8.2 r3924" PROJ="Rel. 4.8.0, 6 March 2012" GDAL="GDAL 1.11.1, released 2014/09/24" LIBXML="2.7.8" LIBJSON="UNKNOWN" TOPOLOGY RASTER – 3218801 Mar 5 '15 at 5:01
  • Yes, we need to store Z value as raster band value, please let me know if u get any information reg same. – 3218801 Mar 5 '15 at 5:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.