Package com.gi.engine.carto

Examples of com.gi.engine.carto.IdentifyType


          identifyGeometry = GeometryToolkit.project(
              identifyGeometry, sr, mapSR);
        }

        // Handle layers
        IdentifyType identifyType = IdentifyType.TOP;
        ArrayList<String> layerIds = new ArrayList<String>();
        if (layers != null && !"".equals(layers)) {
          String type = null;
          String ids = layers;
          if (layers.indexOf(":") > 0) {
View Full Code Here


        double distance = tolerance * resolution;
        geometry = GeometryToolkit.buffer(geometry, mapSR, mapSR,
            mapSR, distance);
      }

      IdentifyType identifyType = identifyParam.getIdentifyType();

      // Handle layers
      ArrayList<String> handleLayerIds = null;
      if (identifyType.equals(IdentifyType.TOP)) {
        handleLayerIds = layerIds;
      } else if (identifyType.equals(IdentifyType.VISIBLE)) {
        handleLayerIds = new ArrayList<String>();
        for (int i = 0, count = map.getMapContext().getLayerCount(); i < count; i++) {
          MapLayer layer = map.getLayer(i).getMapLayer();
          if (layer.isVisible()) {
            handleLayerIds.add(String.valueOf(i));
          }
        }
      } else if (identifyType.equals(IdentifyType.ALL)) {
        handleLayerIds = new ArrayList<String>();
        for (int i = 0, count = map.getMapContext().getLayerCount(); i < count; i++) {
          handleLayerIds.add(String.valueOf(i));
        }
      }

      for (int i = 0, count = handleLayerIds.size(); i < count; i++) {
        Layer layer = map.getLayer(i);

        QueryParam queryParam = new QueryParam();
        queryParam.setGeometry(geometry);
        queryParam.setSpatialFilterType(SpatialFilterType.INTERSECTS);
        FeatureCollection<? extends FeatureType, ? extends Feature> layerFeatureCollection = layer
            .query(queryParam);
        if (layerFeatureCollection != null
            && !layerFeatureCollection.isEmpty()) {
          for (FeatureIterator<? extends Feature> itr = layerFeatureCollection
              .features(); itr.hasNext();) {
            Feature feature = itr.next();
            FeatureResult featureResult = new FeatureResult();
            featureResult.setLayer(layer);
            featureResult.setFeature(feature);
            result.add(featureResult);
          }

          if (identifyType.equals(IdentifyType.TOP)) {
            break;
          }
        }
      }
    } catch (Exception e) {
View Full Code Here

TOP

Related Classes of com.gi.engine.carto.IdentifyType

Copyright © 2018 www.massapicom. 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.