Examples of MfFeature


Examples of org.mapfish.geo.MfFeature

        // geoserver call
          try {
           
              MfFeatureCollection featureCollection = featuresProvider.getFeatures(featureSource, parameters);
              List featureList = new ArrayList(featureCollection.getCollection());
              MfFeature feature = (MfFeature) featureList.get(0);
             
              //Geometry from GeoServer
              MfGeometry geom = feature.getMfGeometry();
             
             
              // JSON creation
              JSONObject jsonProperties = new JSONObject();
         
              //for each col
              for(int j=0; j<nc; j++){
                jsonProperties.accumulate(
                    dataStoreMeta.getFieldName(j),
                    record.getFieldAt( dataStoreMeta.getFieldIndex(dataStoreMeta.getFieldName(j)) ).getValue()
                )
              }
             
              //for each prop
              if(feature instanceof SbiFeature) {
                JSONObject properties = ((SbiFeature)feature).getProperties();
                Iterator keysIterator = properties.sortedKeys();
                while(keysIterator.hasNext()) {
                  String key = (String)keysIterator.next();
                  jsonProperties.accumulate(key, properties.get(key));
                }
              }
             
              MfFeature featureToCollect = SbiFeatureFactory.getInstance().createFeature(geoIdPValue, geom, jsonProperties);
              outputFeatureCollection.add(featureToCollect);
            } catch (Exception e) {
              e.printStackTrace();
            }
        }
View Full Code Here

Examples of org.mapfish.geo.MfFeature

   
 
  private SbiFeatureFactory() {}
 
  public MfFeature createFeature(final String id, final MfGeometry geometry, final JSONObject properties) {
    MfFeature feature;
   
    logger.debug("IN");
   
    feature = null;
   
View Full Code Here

Examples of org.mapfish.geo.MfFeature

      fetaure = lookupTable.get(geoIdPValue);
      logger.debug("Feature [" + geoIdPValue +"] is equal to [" + fetaure + "]");
      if(fetaure != null) {
        Object x = JSON_READER.decode(fetaure);
        logger.debug("Decoded object is of type [" + x.getClass().getName() + "]");
        MfFeature mfFeature = (MfFeature)x;
        Collection<MfFeature> mfFeatures = new ArrayList();
        mfFeatures.add(mfFeature);
        featureCollection = new MfFeatureCollection(mfFeatures);;
        logger.debug("Feature [" + geoIdPValue + "] added to result features' collection");
      } else {
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.