<div dir="ltr"><div class="gmail_default" style="font-size:small">hi,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I am struggling with creating dynamic layer with mapscript - java. But following code </div><div class="gmail_default" style="font-size:small">fails as "  msPostGISLayerWhichShapes(): Query error  ..."</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">here is the relevant code:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">( I am not sure which one is better to use "where clause " rather than setFilter to query. )</div><div class="gmail_default" style="font-size:small"><br></div><div><div class="gmail_default"><span style="font-size:small">​</span>if ( ! items[i].contains("undefined")) {</div><div class="gmail_default"><span class="" style="white-space:pre">                  </span>String f = "yas=" + "'" + yas[jeoId] + "'";</div><div class="gmail_default">                        System.out.println("***  f  *** "+f);    //  ***  f  >>>    "  yas='Eosen'  "</div><div class="gmail_default">                       </div><div class="gmail_default">                        layerObj jeoLayer = new layerObj(map_yasSec3857);</div><div class="gmail_default"><br></div><div class="gmail_default">                        jeoLayer.setType(MS_LAYER_TYPE.MS_LAYER_POLYGON);</div><div class="gmail_default"><br></div><div class="gmail_default">                        jeoLayer.setName(items[i]);</div><div class="gmail_default">                        jeoLayer.setProjection("init=epsg:3857");</div><div class="gmail_default">                        jeoLayer.setStatus(mapscript.MS_ON);</div><div class="gmail_default">                     jeoLayer.setConnectiontype(MS_CONNECTION_TYPE.MS_POSTGIS);<br></div><div class="gmail_default"><br></div><div class="gmail_default"><span class="" style="white-space:pre">       </span>        <span class="" style="white-space:pre">      </span>jeoLayer.setConnection("dbname='tr22' host='localhost' port='5432' user='or****' password='******'");</div><div class="gmail_default">                        jeoLayer.setData("geom from  (select gid,yas,geom "</div><div class="gmail_default">                        +" from  sjeo_yas3857 where "</div><div class="gmail_default">                        + f  </div><div class="gmail_default">                        +" ) as foo  using unique gid using srid=3857");</div><div class="gmail_default">                        </div><div class="gmail_default">                        jeoLayer.setProcessing("CLOSE_CONNECTION=DEFER");</div><div class="gmail_default"><span class="" style="white-space:pre">       </span>                </div><div class="gmail_default"><span class="" style="white-space:pre">           </span>        System.out.println( " jeoLayer.getData   "+   jeoLayer.getData());</div><div class="gmail_default">( it gives:  >>> geom from  (select gid,yas,geom  from  sjeo_yas3857 where yas='Eosen' ) as foo  using unique gid using srid=3857   I checked it in console and works)<br></div><div class="gmail_default"><br></div><div class="gmail_default">                        classObj cl = new classObj(jeoLayer);</div><div class="gmail_default"><br></div><div class="gmail_default">                        styleObj style = new styleObj(cl);</div><div class="gmail_default">                        style.setSymbol(1);</div><div class="gmail_default">                        style.setColor( new colorObj(255,0,0,255) );</div><div class="gmail_default">                       </div><div class="gmail_default">                        jeoLayer.setStatus(1);</div><div class="gmail_default"><br></div><div class="gmail_default">                        imageObj img = map_yasSec3857.draw();</div><div class="gmail_default"><br></div><div class="gmail_default">                        jeoLayer.close();</div><div class="gmail_default">                        img.save("/usr/local/map_yas.png",map_yasSec3857);</div><div class="gmail_default">                        img.delete();</div><div class="gmail_default"><br></div><div class="gmail_default">                        bytes=img.getBytes();</div><div style="font-size:small" class="gmail_default">}</div><br></div><div><div style="font-size:small" class="gmail_default">​Can you say what the possible problem is ?</div><div style="font-size:small" class="gmail_default"><br></div><div style="font-size:small" class="gmail_default">kind regards​</div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>Ahmet Temiz<br>Jeoloji Müh.<br>Afet ve Acil Durum Yönetimi Başkanlığı<br>Bilgi İşlem  Dairesi Başkanlığı-CBS Grubu<br><br><br>________________________<br><br>Ahmet Temiz<br>Geological Eng.<br>Information Systems - GIS Group<br>Disaster and Emergency Management<br>of Presidency</div></div></div></div></div>
</div>