Tuesday, December 15, 2015

Unknown WKB type 48

The exception "com.vividsolutions.jts.io.ParseException: Unknown WKB type 48" typically happens when the PostGIS geometry column is read as raw bytes.

It should be cast at the SQL sentence:

  select ST_AsBinary(geom) as geom ... from ...

It can be read as follows:

  WKBReader reader = new WKBReader();
  Geometry geom = reader.read(rs.getBytes("geom"));

No comments:

Post a Comment