[Gvsig_usuarios] (sin asunto)
bocher
erwan.bocher en wanadoo.fr
Sab Mar 11 17:47:53 CET 2006
Hola,
I tried to integrate OpenJUMP -Viatoris- geoprocessing menu in gvSIG. First I have create small examples functionalities :
- list layers
- list fields layer
- add shape layer...
Now, I'd like to work with geometry. Based on example send by Francisco José Peñarrubia I used JTS library for spatial processing but I don't know how to transform my geometries in a Flayer in gvSIG.
To compare in OpenJUMP. My geometry is stored in a feature storing in a featurecollection.
If I want to convert a polygon layer to a linearRing layer I use this method :
FeatureCollection fc = layer.getFeatureCollectionWrapper(); //layer is the layer selected in OJ
FeatureSchema fs = fc.getFeatureSchema(); // Pienso que es el modelo en Fmap ?
FeatureCollection resultfc = new FeatureDataset(fc.getFeatureSchema()); //The new featureCollection
Feature feat;
for (Iterator it = fc.iterator(); it.hasNext();){
feat = (Feature)it.next(); //feat of layer selected in OJ
Geometry geom = feat.getGeometry(); //geometry of feat
for (int i = 0; i < feat.getGeometry().getNumGeometries(); i++) { //If they are more than two object in feat
Feature newFeat = new BasicFeature(fs);//The new feature
FeatureUtil.copyAttributes(feat, newFeat);//Mapping attributes
newFeat.setGeometry(geom.getBoundary());//New geometry creation
resultfc.add(newFeat);// add new feature in the new featureCollection
}
}
context.getLayerManager().addLayer("Convert",layer.getName() +"_LinearRing" , resultfc);
// Add the new featureCollection as a layer in OpenJUMP. The name of the new layer = source layer name + _LinearRing
So my questions is:
Is it possible to present a method to realise identic work with FMap ?
Moreover I'm interested to use GDBMS to create a spatial SQL language as existing in PostGIS but using layers load in gvSIG. However gvSIG works with GDBMS-0.8-SNAPSHOT. Is it planned to integrate the last GDBMS (GDBMS 1.0) ?
In attached file you can find my gvSIG examples.
------------ próxima parte ------------
Se ha borrado un mensaje que no está en formato texto plano...
Nombre : testgvSIG.tar.gz
Tipo : application/x-gzip
Tamaño : 19025 bytes
Descripción: no disponible
Url : http://runas.cap.gva.es/pipermail/gvsig_usuarios/attachments/20060311/8ab97a88/testgvSIG.tar-0001.bin
Más información sobre la lista de distribución gvSIG_usuarios