Examples of WMSRequest


Examples of org.geotools.data.ows.WMSRequest

     */
    public Object getValue(Element element, ElementValue[] value,
        Attributes attrs, Map hints) throws SAXException,
        OperationNotSupportedException {

      WMSRequest request = new WMSRequest();

      for (int i = 0; i < value.length; i++) {
        // System.out.println("OpType ValueName:"
        // +value[i].getElement().getName());

        if (sameName(elems[0], value[i])
            || sameName(elems[8], value[i])) {
          request.setGetCapabilities((org.geotools.data.ows.OperationType) value[i]
              .getValue());
        }

        if (sameName(elems[1], value[i])
            || sameName(elems[9], value[i])) {
          request.setGetMap((org.geotools.data.ows.OperationType) value[i].getValue());
        }

        if (sameName(elems[2], value[i])
            || sameName(elems[10], value[i])) {
          request.setGetFeatureInfo((org.geotools.data.ows.OperationType) value[i]
              .getValue());
        }

        if (sameName(elems[3], value[i])) {
          request.setDescribeLayer((org.geotools.data.ows.OperationType) value[i]
              .getValue());
        }

        if (sameName(elems[4], value[i])) {
          request.setGetLegendGraphic((org.geotools.data.ows.OperationType) value[i]
              .getValue());
        }

        if (sameName(elems[5], value[i])) {
          request
              .setGetStyles((org.geotools.data.ows.OperationType) value[i]
                  .getValue());
        }

        if (sameName(elems[6], value[i])) {
          request
              .setPutStyles((org.geotools.data.ows.OperationType) value[i]
                  .getValue());
        }

        // TODO extended operations here
View Full Code Here

Examples of org.geotools.data.ows.WMSRequest

        String url = "http://test/wms";
        String mimeTypes = "image/png";
       
        final WebMapServer server = createMock(WebMapServer.class);
        WMSCapabilities cap = createMock(WMSCapabilities.class);
        WMSRequest req = createMock(WMSRequest.class);
        OperationType gcOpType = createMock(OperationType.class);
        XMLConfiguration globalConfig = createMock(XMLConfiguration.class);
        Capture<TileLayer> layerCapture = new Capture<TileLayer>();
       
        GetCapabilitiesConfiguration config =
                new GetCapabilitiesConfiguration(broker, url, mimeTypes, "3x3", "false"){

                    @Override
                    WebMapServer getWMS() {
                        return server;
                    }
           
        };
       
        expect(server.getCapabilities()).andStubReturn(cap);
        expect(cap.getRequest()).andStubReturn(req);
        expect(req.getGetCapabilities()).andStubReturn(gcOpType);
        expect(gcOpType.getGet()).andStubReturn(new URL("http://test/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=getcapabilities"));
       
        expect(cap.getVersion()).andStubReturn("1.1.1");
       
        List<Layer> layers = new LinkedList<Layer>();
View Full Code Here

Examples of org.openstreetmap.josm.io.imagery.WMSRequest

            for (int x = 0; x < dax; ++x) {
                for (int y = 0; y < day; ++y) {
                    GeorefImage img = images[modulo(x,dax)][modulo(y,day)];
                    if(img.getState() == State.FAILED){
                        addRequest(new WMSRequest(img.getXIndex(), img.getYIndex(), info.getPixelPerDegree(), true, false));
                    }
                }
            }
        }
View Full Code Here

Examples of org.openstreetmap.josm.io.imagery.WMSRequest

            if (autoDownloadEnabled) {
                for (int x = 0; x < dax; ++x) {
                    for (int y = 0; y < day; ++y) {
                        GeorefImage img = images[modulo(x,dax)][modulo(y,day)];
                        if(img.getState() == State.NOT_IN_CACHE){
                            addRequest(new WMSRequest(img.getXIndex(), img.getYIndex(), info.getPixelPerDegree(), false, true));
                        }
                    }
                }
                Main.map.mapView.repaint();
            }
View Full Code Here

Examples of org.openstreetmap.josm.io.imagery.WMSRequest

                }
            }
        }

        for (Point p: requestedTiles) {
            addRequest(new WMSRequest(p.x, p.y, info.getPixelPerDegree(), true, false, precacheTask));
        }

        precacheTask.progressMonitor.setTicksCount(precacheTask.getTotalCount());
        precacheTask.progressMonitor.setCustomText(tr("Downloaded {0}/{1} tiles", 0, precacheTask.totalCount));
    }
View Full Code Here

Examples of org.openstreetmap.josm.io.imagery.WMSRequest

        for(int x = bminx; x<=bmaxx; ++x) {
            for(int y = bminy; y<=bmaxy; ++y){
                GeorefImage img = images[modulo(x,dax)][modulo(y,day)];
                if (!img.paint(g, mv, x, y, leftEdge, bottomEdge)) {
                    addRequest(new WMSRequest(x, y, info.getPixelPerDegree(), real, true));
                    areaToCache.add(new ProjectionBounds(getEastNorth(x, y), getEastNorth(x + 1, y + 1)));
                } else if (img.getState() == State.PARTLY_IN_CACHE && autoDownloadEnabled) {
                    addRequest(new WMSRequest(x, y, info.getPixelPerDegree(), real, false));
                    areaToCache.add(new ProjectionBounds(getEastNorth(x, y), getEastNorth(x + 1, y + 1)));
                }
            }
        }
        if (cache != null) {
View Full Code Here

Examples of org.openstreetmap.josm.io.imagery.WMSRequest

    }

    private void sortRequests(boolean localOnly) {
        Iterator<WMSRequest> it = requestQueue.iterator();
        while (it.hasNext()) {
            WMSRequest item = it.next();

            if (item.getPrecacheTask() != null && item.getPrecacheTask().isCancelled) {
                it.remove();
                continue;
            }

            int priority = getRequestPriority(item);
            if (priority == -1 && item.isPrecacheOnly()) {
                priority = Integer.MAX_VALUE; // Still download, but prefer requests in current view
            }

            if (localOnly && !item.hasExactMatch()) {
                priority = Integer.MAX_VALUE; // Only interested in tiles that can be loaded from file immediately
            }

            if (       priority == -1
                    || finishedRequests.contains(item)
                    || processingRequests.contains(item)) {
                it.remove();
            } else {
                item.setPriority(priority);
            }
        }
        Collections.sort(requestQueue);
    }
View Full Code Here

Examples of org.openstreetmap.josm.io.imagery.WMSRequest

            }

            if (canceled)
                return null;
            else {
                WMSRequest request = requestQueue.remove(0);
                processingRequests.add(request);
                return request;
            }

        } finally {
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.