[postgis-users] ST_AsPNG is problematic in Java

Bborie Park dustymugs at gmail.com
Mon Jun 17 09:57:37 PDT 2013


Ahmet,

Can you try one of the example code found in the docs?

http://www.postgis.net/docs/manual-dev/using_raster_dataman.html#RT_Raster_Applications

By testing out one of the examples, you should be able to tell if the
problem is in the database or in your java code.

-bborie

On Mon, Jun 17, 2013 at 6:04 AM, Ahmet Temiz <ahmettemiz88 at gmail.com> wrote:
> hello
>
> postgresql (9.2.2)
>
> postgresql-jdbc 9.2
>
> here is the result of SELECT postgis_full_version();
>
>
> postgis_full_version
> ------------------------------------------------------------------------------------------------------------------------------------------------
>  POSTGIS="2.1.0SVN r10952" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.8.0, 6 March
> 2012" GDAL="GDAL 1.9.2, released 2012/10/08" LIBXML="2.8.0" RASTER
>
>
> thank you
>
>
> On Mon, Jun 17, 2013 at 3:45 PM, Paragon Corporation <lr at pcorp.us> wrote:
>>
>> 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
>>
>>
>> hello
>>
>> 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[]
>> and
>> 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 ?
>>
>> regards
>>
>> --
>> 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
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>
>
>
>
> --
> 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
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>


More information about the postgis-users mailing list