[postgis-users] ST_AsPNG is problematic in Java

Paragon Corporation lr at pcorp.us
Mon Jun 17 05:45:04 PDT 2013

Which JDBC driver are you using and which PostgreSQL version.  You might be
affected by the escape/hex change in 9.0
detailed here: http://postgis.net/docs/manual-2.0/PostGIS_FAQ.html#id338804


From: postgis-users-bounces at lists.osgeo.org
[mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of Ahmet Temiz
Sent: Monday, June 17, 2013 8:32 AM
To: PostGIS Users Discussion
Subject: [postgis-users] ST_AsPNG is problematic in Java


I am dealing with java-jpa2-postgis(raster)

I tried to get an image from postgis(raster) as:

List list_rast = session.createSQLQuery("SELECT ST_AsPNG(rast) As rastpng
FROM geoslp5 where rid=184 ;").list();

and converting object to byte[]
with usual java process

ByteArrayOutputStream bos = new ByteArrayOutputStream();  
... //
bytes = bos.toByteArray ();

But resulting image file(png) is defective ?

What may the probable problems ?

Do you have any recommendations ?


Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Planlama ve Zarar Azaltma Dairesi Başkanlığı


Ahmet Temiz
Geological Eng.
Information Systems - GIS Group
Disaster and Emergency Management
of Presidency 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130617/4b24e082/attachment.html>

More information about the postgis-users mailing list