[mapserver-users] java - mapscript -postgis - raster FAILS

Ahmet Temiz ahmettemiz88 at gmail.com
Tue Jun 2 05:51:56 PDT 2015


Hello

I am trying to retrieve postgis-raster layer. It fails.

I tested data with:

1. shp2img debug 4  -m trdem1.map -l trdem_3857_ov10 -o odem22.tif ;
display odem22.tif

2.  gdalwarp 'PG: dbname=tr22 host=localhost user=orkun password=222222
port=5432 schema=public table=o_10_trdem2_3857    where="
ST_Intersects(rast,  ST_MakeEnvelope( 3235971.7976 , 4950328.02287796 ,
3255971.7976 , 4960328.02287796,3857  ))" mode=2 ' odem22.tif

they look OK

But in java side, mapscript fails.

​here is the related java-mapscript code.​

​~~~~~~~~~~~~~~~~~~​
​
 dem_layer = mapDem3857.getLayerByName("trdem_3857_ov8");
 data="'PG: dbname=tr22 host=localhost user=orkun password=222222 port=5432
schema=public table=o_8_trdem2_3857  ";

data=data+  "  where=\" ST_Intersects(rast,  ST_MakeEnvelope( " ;
String geo_data= String.valueOf(minx)+" , "+String.valueOf(miny)+" ,
"+String.valueOf(maxx)+" , "+String.valueOf(maxy) ;
 data=data+geo_data+",3857  ))\" mode=2 ' ";
log.info(" *** data *** "+data);

dem_layer.setData(data);


        dem_layer.setStatus(1);
 imageObj img = mapDem3857.draw();
 byte[] bytes=img.getBytes();

        img.save("/usr/local/dem8.tif", mapDem3857);

log.info("mapDem3857  bytes "+ bytes.length);
 return bytes;
​
​~~~~~~~~~~~~~~~~~~​


What am I doing wrong ?

regards​


-- 
Ahmet Temiz
Jeoloji Müh.
Afet ve Acil Durum Yönetimi Başkanlığı
Bilgi İşlem  Dairesi Başkanlığı-CBS Grubu


________________________

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/mapserver-users/attachments/20150602/f2c8d9d7/attachment.htm>


More information about the MapServer-users mailing list