[mapserver-users] Layer Query

Gaston Lucero gaston.lucerom at gmail.com
Mon Oct 29 12:40:10 PDT 2012


Hello, I am researching and trying to use queries layers of mapserver,
mapscript through, but not how to obtain, if possible, the result
information.
I do not use wms

My java code

mapObj map = new mapObj("/home/gaston/maps/map/map.map")    ;
layerObj layer = map.getLayerByName("Info");
//centerP es el putno
layer.queryByPoint(map,new pointObj(centerP.getX(),centerP.getY(),0),
mapscriptConstants.MS_SINGLE, 10);
layer.open();
resultCacheObj res =layer.getResults();

            for(int i=0 ;i<layer.getNumResults();i++){ /
                shapeObj feature = layer.getShape(res.getResult(i));

               //Aca no se q hacer
            }


My .map

MAP
STATUS on
SIZE 256 256
EXTENT -20037508 -20037508 20037508 20037508
UNITS meters
IMAGETYPE agg #Este nombre debe coincidir con el valor NAME de OUTPUTFORMAT
SHAPEPATH "data"
FONTSET "font/fonts.fnt"
SYMBOLSET "symbol/symbols.sym"
IMAGECOLOR "#b3c6d4"
DEBUG 5
CONFIG  "MS_ERRORFILE" "/tmp/mapseerver.log"

OUTPUTFORMAT
NAME agg
DRIVER agg/png
IMAGEMODE rgb
FORMATOPTION "PALETTE_FORCE=TRUE" #es incompatible con la opcion anterior
FORMATOPTION "PALETTE=/home/gaston/maps/map/palette/map.palette"
MIMETYPE "image/png"
END
PROJECTION
"init=epsg:900913"
END
LAYER
NAME Info
STATUS on
TYPE polygon
CONNECTIONTYPE postgis
        CONNECTION "####"
DATA "polygon from gis.pois"
CLASS
STYLE
COLOR "#f2efe9"
OUTLINECOLOR "#f2efe9"
END
END
PROCESSING "CLOSE_CONNECTION=DEFER"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20121029/8468971b/attachment.html>


More information about the mapserver-users mailing list