Examples of GetFeatureInfoRequest


Examples of org.vfny.geoserver.wms.requests.GetFeatureInfoRequest

     * @throws ServiceException DOCUMENT ME!
     */
    public void execute(Request request) throws ServiceException {
        LOGGER.entering(getClass().getName(), "execute", new Object[] { request });

        GetFeatureInfoRequest getFeatureInfoReq = (GetFeatureInfoRequest) request;
       
        EnvFunction.setLocalValues(getFeatureInfoReq.getGetMapRequest().getEnv());
        try {
            this.delegate = getDelegate(getFeatureInfoReq);
            delegate.execute(request);
        } finally {
            EnvFunction.clearLocalValues();
View Full Code Here

Examples of org.vfny.geoserver.wms.requests.GetFeatureInfoRequest

     *
     * @throws WmsException For any problems.
     */
    protected void execute(FeatureTypeInfo[] requestedLayers, Query[] queries,
        int x, int y) throws WmsException {
        GetFeatureInfoRequest request = getRequest();
        this.format = request.getInfoFormat();

        GetMapRequest getMapReq = request.getGetMapRequest();

        int width = getMapReq.getWidth();
        int height = getMapReq.getHeight();
        Envelope bbox = getMapReq.getBbox();

        Coordinate upperLeft = pixelToWorld(x - 2, y - 2, bbox, width, height);
        Coordinate lowerRight = pixelToWorld(x + 2, y + 2, bbox, width, height);

        Coordinate[] coords = new Coordinate[5];
        coords[0] = upperLeft;
        coords[1] = new Coordinate(lowerRight.x, upperLeft.y);
        coords[2] = lowerRight;
        coords[3] = new Coordinate(upperLeft.x, lowerRight.y);
        coords[4] = coords[0];

          //DJB:
            //TODO: this should probably put a max features restriction on the query
            //      unforunately, this queryies by filter not by query, so this is a slightly more difficult problem
            //      Its not a big deal not to do this because the writer will ensure that the correct # of items
            //      are actually printed out.
            //DJB: DONE - see "q", below
            // NOTE: you can ask for results from multiple layers at once.  So, if max features is 2 (after you add max features query to above) and you
            //       query 10 layers, you could still get 20 features being sent on.
            //       Thats why max features is handled at the query portion!
        GeometryFactory geomFac = new GeometryFactory();

        LinearRing boundary = geomFac.createLinearRing(coords);

        Polygon pixelRect = geomFac.createPolygon(boundary, null);

        FilterFactory filterFac = FilterFactory.createFilterFactory();

        GeometryFilter getFInfoFilter = null;

        try {
            getFInfoFilter = filterFac.createGeometryFilter(AbstractFilter.GEOMETRY_INTERSECTS);
            getFInfoFilter.addLeftGeometry(filterFac.createLiteralExpression(
                    pixelRect));
        } catch (IllegalFilterException e) {
            e.printStackTrace();
            throw new WmsException(null, "Internal error : " + e.getMessage());
        }

        int layerCount = requestedLayers.length;
        results = new ArrayList(layerCount);
        metas = new ArrayList(layerCount);

       
        try {
            for (int i = 0; i < layerCount; i++) {
                FeatureTypeInfo finfo = requestedLayers[i];
                Query q = new DefaultQuery( finfo.getTypeName(), null, getFInfoFilter,request.getFeatureCount(), Query.ALL_NAMES, null );
                FeatureResults match = finfo.getFeatureSource().getFeatures(q);

                //this was crashing Gml2FeatureResponseDelegate due to not setting
                //the featureresults, thus not being able of querying the SRS
                //if (match.getCount() > 0) {
View Full Code Here

Examples of org.vfny.geoserver.wms.requests.GetFeatureInfoRequest

     */
    private Query[] buildQueries(FeatureTypeInfo[] layers)
        throws WmsException {
        int nLayers = layers.length;
        Query[] queries = new Query[nLayers];
        GetFeatureInfoRequest infoRequest = getRequest();
        Envelope requestExtent = infoRequest.getGetMapRequest().getBbox();
        FilterFactory ffactory = FilterFactory.createFilterFactory();

        try {
            Filter finalLayerFilter;
            Query layerQuery;
View Full Code Here

Examples of org.vfny.geoserver.wms.requests.GetFeatureInfoRequest

     *
     * @throws ServiceException DOCUMENT ME!
     * @throws IOException DOCUMENT ME!
     */
    public void writeTo(OutputStream out) throws ServiceException, IOException {
        GetFeatureInfoRequest fInfoReq = (GetFeatureInfoRequest) getRequest();
        FeatureRequest freq = new FeatureRequest();
        freq.setHttpServletRequest(fInfoReq.getHttpServletRequest());

        freq.setRequest("GETFEATURE");
        freq.setHandle("GetFeatureInfo");
        freq.setMaxFeatures(fInfoReq.getFeatureCount());

        List queries = null;
        freq.setQueries(queries);

        GetFeatureResults getFeatureResults = new GetFeatureResults(freq);
View Full Code Here

Examples of org.vfny.geoserver.wms.requests.GetFeatureInfoRequest

     */
    public void execute(Request request) throws ServiceException {
        LOGGER.entering(getClass().getName(), "execute",
            new Object[] { request });

        GetFeatureInfoRequest getFeatureInfoReq = (GetFeatureInfoRequest) request;
        this.delegate = getDelegate(getFeatureInfoReq);
        delegate.execute(request);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.