Package com.gi.server.core.service.mapservice

Examples of com.gi.server.core.service.mapservice.MapServiceInstance


        if (!editable) {
          return null;
        }

        FeatureType featureType = null;
        MapServiceInstance instance = (MapServiceInstance) mapService
            .getMapServicePool().checkoutIdleInstance();
        try {
          Layer layer = instance.getMap().getLayer(nLayerId);
          featureType = layer.getMapLayer().getFeatureSource()
              .getSchema();
        } finally {
          if (instance != null) {
            mapService.getMapServicePool().checkinIdelInstance(
                instance);
          }
        }

        // Handle features
        FeatureCollection<SimpleFeatureType, SimpleFeature> addsFeatureCollection = null;
        if (adds != null) {
          addsFeatureCollection = EsriJsonUtil
              .json2FeatureCollection(adds,
                  (SimpleFeatureType) featureType);
        }
        FeatureCollection<SimpleFeatureType, SimpleFeature> updatesFeatureCollection = null;
        if (updates != null) {
          updatesFeatureCollection = EsriJsonUtil
              .json2FeatureCollection(updates,
                  (SimpleFeatureType) featureType);
        }
        String[] deleteFeatureIds = null;
        if (deletes != null) {
          deleteFeatureIds = deletes.split(",");
        }

        instance = (MapServiceInstance) mapService.getMapServicePool()
            .checkoutIdleInstance();

        List<FeatureId> addFeatureIds = null;
        HashMap<FeatureId, Boolean> updateFeatureIds = null;
        boolean deleteSuccess = false;
        try {
          Layer layer = instance.getMap().getLayer(nLayerId);

          try {
            addFeatureIds = layer.add(addsFeatureCollection);
          } catch (Exception ex) {
            ex.printStackTrace();
View Full Code Here


        if(!editable){
          return null;
        }
         
        FeatureType featureType = null;
        MapServiceInstance instance = (MapServiceInstance) mapService
            .getMapServicePool().checkoutIdleInstance();
        try {
          Layer layer = instance.getMap().getLayer(nLayerId);
          featureType = layer.getMapLayer().getFeatureSource()
              .getSchema();
        } finally {
          if (instance != null) {
            mapService.getMapServicePool().checkinIdelInstance(
                instance);
          }
        }

        // Handle features
        FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection = EsriJsonUtil
            .json2FeatureCollection(features,
                (SimpleFeatureType) featureType);

        instance = (MapServiceInstance) mapService.getMapServicePool()
            .checkoutIdleInstance();
        List<FeatureId> featureIds = null;
        try {
          Layer layer = instance.getMap().getLayer(nLayerId);
          featureIds = layer.add(featureCollection);
        } finally {
          if (instance != null) {
            mapService.getMapServicePool().checkinIdelInstance(
                instance);
View Full Code Here

          queryParam.setSpatialFilterType(relation);
          queryParam.setWhere(where);
        }

        FeatureCollection<? extends FeatureType, ? extends Feature> featureCollection = null;
        MapServiceInstance instance = (MapServiceInstance) mapService
            .getMapServicePool().checkoutIdleInstance();
        try {
          Layer layer = instance.getMap().getLayer(nLayerId);
          if (featureIds != null) {
            featureCollection = layer.query(featureIds);
          } else {
            featureCollection = layer.query(queryParam);
          }
View Full Code Here

        findParam.setSearchText(searchText);
        findParam.setContains(isContains);
        findParam.setSearchFields(strSearchFields);

        ArrayList<FeatureResult> featureResults = null;
        MapServiceInstance instance = (MapServiceInstance) mapService
            .getMapServicePool().checkoutIdleInstance();
        try {
          featureResults = instance.find(layerIdArray, findParam);
        } finally {
          if (instance != null) {
            mapService.getMapServicePool().checkinIdelInstance(
                instance);
          }
View Full Code Here

        int nLevel = Integer.parseInt(level);
        int nRow = Integer.parseInt(row);
        int nCol = Integer.parseInt(col);

        // Handle export
        MapServiceInstance instance = (MapServiceInstance) mapService
            .getMapServicePool().checkoutIdleInstance();
        try {
          if (mapServiceDesc.getTileInfo().isCreateOnDemand()) {
            result = instance.getOrCreateTile(nLevel, nRow, nCol);
          } else {
            result = instance.getTile(nLevel, nRow, nCol);
          }
        } finally {
          if (instance != null) {
            mapService.getMapServicePool().checkinIdelInstance(
                instance);
View Full Code Here

        renderParam.setTransparent(Boolean.parseBoolean(transparent));
        renderParam.setVisibleLayerIds(layerIds);

        byte[] image = null;
        double scale = 0;
        MapServiceInstance instance = (MapServiceInstance) mapService
            .getMapServicePool().checkoutIdleInstance();
        try {
          image = instance.export(renderParam, format, nDPI);
          scale = instance.getMap().computeScale(env, width, height,
              nDPI);
        } finally {
          if (instance != null) {
            mapService.getMapServicePool().checkinIdelInstance(
                instance);
View Full Code Here

TOP

Related Classes of com.gi.server.core.service.mapservice.MapServiceInstance

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.