<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-9" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 10.00.9200.16618"></HEAD>
<BODY>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=279334212-17062013>Which JDBC driver are you using and which PostgreSQL 
version.  You might be affected by the escape/hex change in 
9.0</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=279334212-17062013></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT color=#0000ff size=2 face=Arial><SPAN 
class=279334212-17062013>detailed here: <A 
href="http://postgis.net/docs/manual-2.0/PostGIS_FAQ.html#id338804">http://postgis.net/docs/manual-2.0/PostGIS_FAQ.html#id338804</A></SPAN></FONT></DIV><FONT 
color=#0000ff size=2 face=Arial></FONT><BR>
<DIV lang=en-us class=OutlookMessageHeader dir=ltr align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>From:</B> postgis-users-bounces@lists.osgeo.org 
[mailto:postgis-users-bounces@lists.osgeo.org] <B>On Behalf Of </B>Ahmet 
Temiz<BR><B>Sent:</B> Monday, June 17, 2013 8:32 AM<BR><B>To:</B> PostGIS Users 
Discussion<BR><B>Subject:</B> [postgis-users] ST_AsPNG is problematic in 
Java<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr><BR clear=all>
<DIV>hello
<DIV><BR></DIV>
<DIV>I am dealing with java-jpa2-postgis(raster)</DIV>
<DIV><BR></DIV>
<DIV>I tried to get an image from postgis(raster) as:</DIV>
<DIV><BR></DIV>
<DIV>
<DIV>List list_rast = session.createSQLQuery("SELECT ST_AsPNG(rast) As 
rastpng <SPAN style="WHITE-SPACE: pre-wrap"> </SPAN>FROM geoslp5 where 
rid=184 ;").list();</DIV>
<DIV><BR></DIV>
<DIV>and converting object to byte[]</DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap">and </SPAN></DIV></DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap">with usual java 
process<BR></SPAN></DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap">ByteArrayOutputStream bos = new 
ByteArrayOutputStream();  </SPAN></DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap">... //</SPAN></DIV>
<DIV><SPAN style="WHITE-SPACE: pre-wrap">bytes = bos.toByteArray 
();</SPAN><BR></DIV>
<DIV><BR></DIV>
<DIV><BR></DIV>
<DIV>But resulting image file(png) is defective ?</DIV>
<DIV><BR></DIV>
<DIV>What may the probable problems ?</DIV>
<DIV><BR></DIV>
<DIV>Do you have any recommendations ?</DIV>
<DIV><BR></DIV>
<DIV><SPAN 
style="FONT-SIZE: 12px; FONT-FAMILY: arial,sans-serif">regards</SPAN><BR 
style="FONT-SIZE: 12px; FONT-FAMILY: arial,sans-serif" clear=all></DIV></DIV>
<DIV><SPAN 
style="FONT-SIZE: 12px; FONT-FAMILY: arial,sans-serif"><BR></SPAN></DIV>-- 
<BR>Ahmet Temiz<BR>Jeoloji Müh.<BR>Afet ve Acil Durum Yönetimi 
Başkanlığı<BR>Planlama ve Zarar Azaltma Dairesi 
Başkanlığı<BR><BR><BR>________________________<BR><BR>Ahmet Temiz<BR>Geological 
Eng.<BR>Information Systems - GIS Group<BR>Disaster and Emergency 
Management<BR>of Presidency </DIV></BODY></HTML>