protected int getNumberOfChunks(Map<String, List<IData>> pInputData) { // return a fixed number // return 3; // return a number depending on an input parameter // int numberOfChunks = ((LiteralIntBinding) pInputData.get("numberOfChunks").get(0)).getPayload().intValue(); // return numberOfChunks; // return a number depending on the complexity of input data FeatureCollection features = ((GTVectorDataBinding) pInputData.get("data").get(0)).getPayload(); return features.size() % 5; }
public List<Map<String, List<IData>>> split(Map<String, List<IData>> pInputData) { List<Map<String, List<IData>>> result = new ArrayList<Map<String, List<IData>>>(); FeatureCollection featureCollection = ((GTVectorDataBinding) pInputData.get("data").get(0)).getPayload(); FeatureCollection[] featureCollectionList = splitFeatureCollection(featureCollection, getNumberOfChunks(pInputData)); for (FeatureCollection fc : featureCollectionList) { Map<String, List<IData>> chunk = new HashMap<String, List<IData>>(); chunk.put("width", pInputData.get("width")); List<IData> data = new ArrayList<IData>(); data.add(new GTVectorDataBinding(fc)); chunk.put("data", data); result.add(chunk); } return result; }
public File writeFeatureCollectionToDirectory(IData data, File parent) throws IOException { GTVectorDataBinding binding = (GTVectorDataBinding) data; FeatureCollection originalCollection = binding.getPayload(); FeatureCollection collection = createCorrectFeatureCollection(originalCollection); return createShapefileDirectory(collection, parent); }
private synchronized void readObject(java.io.ObjectInputStream oos) throws IOException, ClassNotFoundException { SimpleGMLParser parser = new SimpleGMLParser(); InputStream stream = new ByteArrayInputStream(((String) oos.readObject()).getBytes()); // use a default configuration for the parser by requesting the first supported format and schema GTVectorDataBinding data = parser.parse(stream, parser.getSupportedFormats()[0], parser.getSupportedEncodings()[0]); this.featureCollection = data.getPayload(); }
private void writeToStream(IData coll, OutputStream os) { FeatureCollection<?, ?> fc = ((GTVectorDataBinding)coll).getPayload(); Configuration configuration = new KMLConfiguration(); Encoder encoder = new org.geotools.xml.Encoder(configuration); try{ encoder.encode(fc, KML.kml, os); }catch(IOException e){ throw new RuntimeException(e); } }
File file = null; try { GenericFileDataWithGT fileData = new GenericFileDataWithGT(gtData.getPayload()); file = fileData.getBaseFile(true); } catch (IOException e1) {
FeatureCollection featureCollection = ((GTVectorDataBinding) firstInputData).getPayload();
if (coll instanceof GTVectorDataBinding) { GTVectorDataBinding gtData = (GTVectorDataBinding) coll; SimpleFeatureCollection ftColl = (SimpleFeatureCollection) gtData.getPayload(); wmsLayerName = MSMapfileBinding.getInstance().addFeatureCollectionToMapfile(ftColl, workspace, mapfile, shapefileRepository);
FeatureCollection<?, ?> firstCollection = ((GTVectorDataBinding) firstInputData).getPayload(); FeatureCollection<?, ?> secondCollection = ((GTVectorDataBinding) secondInputData).getPayload();
FeatureCollection<?, ?> firstCollection = ((GTVectorDataBinding) firstInputData).getPayload(); FeatureCollection<?, ?> secondCollection = ((GTVectorDataBinding) secondInputData).getPayload();
FeatureCollection<?, ?> firstCollection = ((GTVectorDataBinding) firstInputData).getPayload(); FeatureCollection<?, ?> secondCollection = ((GTVectorDataBinding) secondInputData).getPayload();
FeatureCollection<?, ?> firstCollection = ((GTVectorDataBinding) firstInputData).getPayload(); FeatureCollection<?, ?> secondCollection = ((GTVectorDataBinding) secondInputData).getPayload();
FeatureCollection<?, ?> firstCollection = ((GTVectorDataBinding) firstInputData).getPayload(); FeatureCollection<?, ?> secondCollection = ((GTVectorDataBinding) secondInputData).getPayload();
FeatureCollection<?, ?> firstCollection = ((GTVectorDataBinding) firstInputData).getPayload(); FeatureCollection<?, ?> secondCollection = ((GTVectorDataBinding) secondInputData).getPayload();
FeatureCollection<?, ?> firstCollection = ((GTVectorDataBinding) firstInputData).getPayload(); FeatureCollection<?, ?> secondCollection = ((GTVectorDataBinding) secondInputData).getPayload();
FeatureCollection<?, ?> firstCollection = ((GTVectorDataBinding) firstInputData).getPayload(); FeatureCollection<?, ?> secondCollection = ((GTVectorDataBinding) secondInputData).getPayload();
FeatureCollection<?, ?> firstCollection = ((GTVectorDataBinding) firstInputData).getPayload(); FeatureCollection<?, ?> secondCollection = ((GTVectorDataBinding) secondInputData).getPayload();
throw new IOException("The data passed from the algorithm to the generator has to be a file (shapefile)!"); FeatureCollection fc = gvdb.getPayload();
public void writeToStream(IData coll, OutputStream os) { FeatureCollection<?,?> fc = ((GTVectorDataBinding)coll).getPayload();