[Gvsig_english] JumpBrigde Buffer processing

Fran Peñarrubia fpenarru at iver.es
Fri Mar 17 21:19:32 CET 2006


Hello from "Las Fallas" (see Google) , Erwan.

Sorry, I'm in a hurry, and I don't have much time, so:

1.- Attributes: 
f.setAttribute(adapter.getRecordset().getFieldName(i),featgvSIG.getAttribute(i));
The problem here is that Jump uses Object, but Double, String, Integer, etc.
gvSIG gives you Object, but Value Object (from GDBMS). You need to convert
from Value to Double, Integer, etc. See Value hierarchy and I'm afraid, I
think you will need to use "instanceof" several times....

2.- Symbol legend:

You need to specify what kind of geometries is inside your FeatureDataSet.
In example code, I put always FShape.MULTI. You need something like:

Pseudocode:

	public int getShapeType() {
		int auxType = 0;

		switch (FeatureType) {
		case (POINT):
			auxType = FShape.POINT;
			break;

		case (LINESTRING):
		case (MULTILINESTRING):
			auxType = FShape.LINE;
			break;

		case (POLYGON):
		case (MULTIPOLYGON):
			auxType = FShape.POLYGON;
			break;
		case (MULTIPOINT):
			auxType = FShape.MULTIPOINT;
			break;
                case (MULTIPLE GEOMETRY TYPES)
                        auxType = FShape.MULTIP
                        break;

		}

		return auxType;
	}

Hope this helps, and good luck!!.
 
-----Original Message-----
From: "erwan bocher" <erwan.bocher at gmail.com>
To: "Users and Developers mailing list" <gvsig_internacional at runas.cap.gva.es>
Date: Thu, 16 Mar 2006 00:24:33 +0100
Subject: Re: [Gvsig_english] JumpBrigde Buffer processing

> Hi Francisco,
> 
> Thank you very much for your help. If a good jump bridge is created
> then
> projet-sigle members will be able to make an easy transition from
> OpenJUMP
> to gvSIG.
> On your proposals I have created a class to transform a gvSIG FLyrVect
> into
> a FeatureDataSet.
> 
> However I have several problems :
>                  - I can't export the layer in a shapefile
>                  - Some difficulties to wrap gvsig attributes in
> openjump
> entity
> 
> I use this
> 
> int sc = adapter.getShapeCount();
> IFeature featgvSIG;
> Feature f = new BasicFeature(newfs);
> 
> for (int i = 0; i < sc; i++) {
> 
>             featgvSIG = adapter.getFeature(i);
> 
>             f.setAttribute(adapter.getRecordset().getFieldName(i),
> featgvSIG.getAttribute(i) );
==> Here you need to convert from Value to Double, String, and so on.
==> And also, a for loop to convert each Field (for (j=0; j <
numFields;...) and be careful: gvSIG attributes don't have geometry.
> 
>             geom = adapter.getShape(i).toJTSGeometry();
> 
>             f.setGeometry(geom);
>             fc.add(f);
>         }
> 
> To finish  when I load a layer in gvSIG using jumpBridge the layer
> legend is
> false. See attached file.
> 
> I upload my last classes at
> http://projetsigle.free.fr/temp/geoprocessing.zip.
> 
> If you have time to criticize my work, I'm very interested.
> 
> Thanks and sorry to disturb.
> 
> 
> 
> R1.
> 
> 
> 
> 





More information about the Gvsig_internacional mailing list