Revision 34899
branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/dgn/DGNStoreProvider.java | ||
---|---|---|
370 | 370 |
NAME_FIELD_GEOMETRY, DataTypes.GEOMETRY); |
371 | 371 |
attr.setSRS(this.projection); |
372 | 372 |
attr.setGeometryType(Geometry.TYPES.GEOMETRY); |
373 |
attr.setGeometrySubType(Geometry.SUBTYPES.GEOM2DZ);
|
|
373 |
attr.setGeometrySubType(Geometry.SUBTYPES.GEOM3D);
|
|
374 | 374 |
// ID_FIELD_GEOMETRY = attr.getIndex(); |
375 | 375 |
|
376 | 376 |
featureType.setDefaultGeometryAttributeName(NAME_FIELD_GEOMETRY); |
... | ... | |
862 | 862 |
// point = (Point) geomManager.create(TYPES.POINT, |
863 | 863 |
// SUBTYPES.GEOM3D); |
864 | 864 |
point = (Point) geomManager.create(TYPES.POINT, |
865 |
SUBTYPES.GEOM2DZ);
|
|
865 |
SUBTYPES.GEOM3D);
|
|
866 | 866 |
} catch (CreateGeometryException e) { |
867 | 867 |
throw new org.gvsig.fmap.dal.feature.exception.CreateGeometryException( |
868 | 868 |
e); |
branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/shp/utils/SHPFile.java | ||
---|---|---|
326 | 326 |
case (SHP.POLYLINE3D): |
327 | 327 |
case (SHP.POLYGON3D): |
328 | 328 |
case (SHP.MULTIPOINT3D): |
329 |
return SUBTYPES.GEOM2DZ;
|
|
329 |
return SUBTYPES.GEOM3D;
|
|
330 | 330 |
case (SHP.POINTM): |
331 | 331 |
case (SHP.POLYLINEM): |
332 | 332 |
case (SHP.POLYGONM): |
... | ... | |
461 | 461 |
double y = bb.getDouble(); |
462 | 462 |
double z = bb.getDouble(); |
463 | 463 |
|
464 |
Point point3D = (Point)gManager.create(TYPES.POINT, SUBTYPES.GEOM2DZ);
|
|
464 |
Point point3D = (Point)gManager.create(TYPES.POINT, SUBTYPES.GEOM3D);
|
|
465 | 465 |
point3D.setX(x); |
466 | 466 |
point3D.setY(y); |
467 | 467 |
point3D.setCoordinateAt(2, z); |
... | ... | |
500 | 500 |
|
501 | 501 |
double[] pZ = new double[numPoints]; |
502 | 502 |
|
503 |
Curve curve3D = (Curve)gManager.create(TYPES.CURVE , SUBTYPES.GEOM2DZ);
|
|
503 |
Curve curve3D = (Curve)gManager.create(TYPES.CURVE , SUBTYPES.GEOM3D);
|
|
504 | 504 |
curve3D.setGeneralPath(elShape); |
505 | 505 |
|
506 | 506 |
for (i = 0; i < numPoints; i++) { |
... | ... | |
546 | 546 |
|
547 | 547 |
double[] poZ = new double[numPoints]; |
548 | 548 |
|
549 |
Surface surface3D = (Surface)gManager.create(TYPES.SURFACE, SUBTYPES.GEOM2DZ);
|
|
549 |
Surface surface3D = (Surface)gManager.create(TYPES.SURFACE, SUBTYPES.GEOM3D);
|
|
550 | 550 |
surface3D.setGeneralPath(elShape); |
551 | 551 |
|
552 | 552 |
for (i = 0; i < numPoints; i++) { |
... | ... | |
596 | 596 |
temZ[i] = bb.getDouble(); |
597 | 597 |
} |
598 | 598 |
|
599 |
MultiPoint multipoint3D = (MultiPoint)gManager.create(TYPES.MULTIPOINT, SUBTYPES.GEOM2DZ);
|
|
599 |
MultiPoint multipoint3D = (MultiPoint)gManager.create(TYPES.MULTIPOINT, SUBTYPES.GEOM3D);
|
|
600 | 600 |
for (int k=0 ; k<temX.length ; k++){ |
601 |
Point pointAux = (Point)gManager.create(TYPES.POINT ,SUBTYPES.GEOM2DZ);
|
|
601 |
Point pointAux = (Point)gManager.create(TYPES.POINT ,SUBTYPES.GEOM3D);
|
|
602 | 602 |
pointAux.setX(temX[k]); |
603 | 603 |
pointAux.setY(temY[k]); |
604 | 604 |
pointAux.setCoordinateAt(2, temZ[k]); |
branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/shp/utils/SHPPoint.java | ||
---|---|---|
114 | 114 |
z = buffer.getDouble(); |
115 | 115 |
Point point; |
116 | 116 |
try { |
117 |
point = geomManager.createPoint(x, y, SUBTYPES.GEOM2DZ);
|
|
117 |
point = geomManager.createPoint(x, y, SUBTYPES.GEOM3D);
|
|
118 | 118 |
point.setCoordinateAt(2, z); |
119 | 119 |
return point; |
120 | 120 |
//FIXME que hacems con esto |
branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/shp/utils/SHPFileWrite.java | ||
---|---|---|
329 | 329 |
*/ |
330 | 330 |
public int getShapeType(int geometryType, int geometrySubType) { |
331 | 331 |
|
332 |
if (geometrySubType == Geometry.SUBTYPES.GEOM2DZ){
|
|
332 |
if (geometrySubType == Geometry.SUBTYPES.GEOM3D){
|
|
333 | 333 |
switch (geometryType) { |
334 | 334 |
case Geometry.TYPES.POINT: |
335 | 335 |
return SHP.POINT3D; |
branches/v2_0_0_prep/libraries/libFMap_dalfile/src/org/gvsig/fmap/dal/store/dxf/DXFStoreProvider.java | ||
---|---|---|
608 | 608 |
.getGeometry(); |
609 | 609 |
Point3D pto = new Point3D(); |
610 | 610 |
pto = point.getPoint3D(0); |
611 |
org.gvsig.fmap.geom.primitive.Point geom = (org.gvsig.fmap.geom.primitive.Point)gManager.create(TYPES.POINT , SUBTYPES.GEOM2DZ);
|
|
611 |
org.gvsig.fmap.geom.primitive.Point geom = (org.gvsig.fmap.geom.primitive.Point)gManager.create(TYPES.POINT , SUBTYPES.GEOM3D);
|
|
612 | 612 |
geom.setX(pto.getX()); |
613 | 613 |
geom.setY(pto.getY()); |
614 | 614 |
geom.setCoordinateAt(2, pto.getZ()); |
... | ... | |
658 | 658 |
for (int j = 0; j < pts.length; j++) { |
659 | 659 |
elevations[j] = pts[j].getZ(); |
660 | 660 |
} |
661 |
Curve geom = (Curve)gManager.create(TYPES.CURVE , SUBTYPES.GEOM2DZ);
|
|
661 |
Curve geom = (Curve)gManager.create(TYPES.CURVE , SUBTYPES.GEOM3D);
|
|
662 | 662 |
geom.setGeneralPath(genPathX); |
663 | 663 |
for (int j=0 ; j<elevations.length ; j++){ |
664 | 664 |
geom.setCoordinateAt(j, 2, elevations[j]); |
... | ... | |
711 | 711 |
for (int j = 0; j < pts.length; j++) { |
712 | 712 |
elevations[j] = pts[j].getZ(); |
713 | 713 |
} |
714 |
Surface geom = (Surface)gManager.create(TYPES.SURFACE , SUBTYPES.GEOM2DZ);
|
|
714 |
Surface geom = (Surface)gManager.create(TYPES.SURFACE , SUBTYPES.GEOM3D);
|
|
715 | 715 |
geom.setGeneralPath(genPathX); |
716 | 716 |
for (int j=0 ; j<elevations.length ; j++){ |
717 | 717 |
geom.setCoordinateAt(j, 2, elevations[j]); |
... | ... | |
787 | 787 |
Geometry geom = feature.getDefaultGeometry(); |
788 | 788 |
GeometryType type = geom.getGeometryType(); |
789 | 789 |
|
790 |
if ((TYPES.POINT == type.getType()) && (SUBTYPES.GEOM2DZ == type.getSubType())) {
|
|
790 |
if ((TYPES.POINT == type.getType()) && (SUBTYPES.GEOM3D == type.getSubType())) {
|
|
791 | 791 |
dxf3DFile = true; |
792 | 792 |
k = createPoint3D(handle, k, feature); |
793 | 793 |
|
794 | 794 |
} else if ((TYPES.POINT == type.getType()) && (SUBTYPES.GEOM2D == type.getSubType())) { |
795 | 795 |
k = createPoint2D(handle, k, feature); |
796 | 796 |
|
797 |
} else if ((TYPES.CURVE == type.getType()) && (SUBTYPES.GEOM2DZ == type.getSubType())) {
|
|
797 |
} else if ((TYPES.CURVE == type.getType()) && (SUBTYPES.GEOM3D == type.getSubType())) {
|
|
798 | 798 |
dxf3DFile = true; |
799 | 799 |
k = createPolyline3D(handle, k, feature); |
800 | 800 |
|
... | ... | |
804 | 804 |
} else if ((TYPES.CURVE == type.getType()) && (SUBTYPES.GEOM2D == type.getSubType())) { |
805 | 805 |
k = createLwPolyline2D(handle, k, feature, false); |
806 | 806 |
|
807 |
} else if ((TYPES.SURFACE == type.getType()) && (SUBTYPES.GEOM2DZ == type.getSubType())) {
|
|
807 |
} else if ((TYPES.SURFACE == type.getType()) && (SUBTYPES.GEOM3D == type.getSubType())) {
|
|
808 | 808 |
dxf3DFile = true; |
809 | 809 |
k = createPolyline3D(handle, k, feature); |
810 | 810 |
|
... | ... | |
965 | 965 |
if (hasText(feature)) { |
966 | 966 |
return createText3D(handle, k, feature); |
967 | 967 |
} |
968 |
org.gvsig.fmap.geom.primitive.Point point = (org.gvsig.fmap.geom.primitive.Point)geomManager.create(TYPES.POINT, SUBTYPES.GEOM2DZ);
|
|
968 |
org.gvsig.fmap.geom.primitive.Point point = (org.gvsig.fmap.geom.primitive.Point)geomManager.create(TYPES.POINT, SUBTYPES.GEOM3D);
|
|
969 | 969 |
double[] pointCoords = new double[6]; |
970 | 970 |
PathIterator pointIt = (feature.getDefaultGeometry()) |
971 | 971 |
.getPathIterator(null); |
972 | 972 |
while (!pointIt.isDone()) { |
973 | 973 |
pointIt.currentSegment(pointCoords); |
974 |
point = (org.gvsig.fmap.geom.primitive.Point)geomManager.create(TYPES.POINT, SUBTYPES.GEOM2DZ);
|
|
974 |
point = (org.gvsig.fmap.geom.primitive.Point)geomManager.create(TYPES.POINT, SUBTYPES.GEOM3D);
|
|
975 | 975 |
point.setCoordinateAt(0, pointCoords[0]); |
976 | 976 |
point.setCoordinateAt(1, pointCoords[1]); |
977 | 977 |
point.setCoordinateAt(2, pointCoords[2]); |
978 | 978 |
pointIt.next(); |
979 | 979 |
} |
980 |
org.gvsig.fmap.geom.primitive.Point pto = (org.gvsig.fmap.geom.primitive.Point)geomManager.create(TYPES.POINT, SUBTYPES.GEOM2DZ);
|
|
980 |
org.gvsig.fmap.geom.primitive.Point pto = (org.gvsig.fmap.geom.primitive.Point)geomManager.create(TYPES.POINT, SUBTYPES.GEOM3D);
|
|
981 | 981 |
pto.setCoordinateAt(0, point.getCoordinateAt(0)); |
982 | 982 |
pto.setCoordinateAt(1, point.getCoordinateAt(1)); |
983 | 983 |
pto.setCoordinateAt(2, point.getCoordinateAt(2)); |
branches/v2_0_0_prep/libraries/libDwg/src/org/gvsig/dwg/lib/DwgObject.java | ||
---|---|---|
550 | 550 |
|
551 | 551 |
public int getGeometrySubType(boolean is3DFile) { |
552 | 552 |
if (is3DFile) { |
553 |
return Geometry.SUBTYPES.GEOM2DZ;
|
|
553 |
return Geometry.SUBTYPES.GEOM3D;
|
|
554 | 554 |
} else { |
555 | 555 |
return Geometry.SUBTYPES.GEOM2D; |
556 | 556 |
} |
branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/primitive/impl/OrientablePrimitive2D.java | ||
---|---|---|
438 | 438 |
} |
439 | 439 |
|
440 | 440 |
public int getNumVertices() { |
441 |
return gp.getNumCoords(); |
|
441 |
return gp.getNumCoords()/2;
|
|
442 | 442 |
} |
443 | 443 |
|
444 | 444 |
public void addVertex(Point point) { |
branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/primitive/impl/Point2DZ.java | ||
---|---|---|
82 | 82 |
} |
83 | 83 |
|
84 | 84 |
public Point2DZ (double x, double y, double z) { |
85 |
super(TYPES.POINT, SUBTYPES.GEOM2DZ);
|
|
85 |
super(TYPES.POINT, SUBTYPES.GEOM3D);
|
|
86 | 86 |
coordinates[0] = x; |
87 | 87 |
coordinates[1] = y; |
88 | 88 |
coordinates[2] = z; |
branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/Geometry.java | ||
---|---|---|
182 | 182 |
public final static int GEOM2D = 0; |
183 | 183 |
|
184 | 184 |
/** |
185 |
* Geometries with two dimensions and with a value for the elevation. |
|
186 |
*/ |
|
187 |
public final static int GEOM2DZ = 1; |
|
188 |
|
|
189 |
/** |
|
190 | 185 |
* Geometries with three dimensions. |
191 | 186 |
*/ |
192 |
public final static int GEOM3D = 2;
|
|
187 |
public final static int GEOM3D = 1;
|
|
193 | 188 |
|
194 | 189 |
/** |
195 | 190 |
* Geometries with two dimensions and with the M coordinate. |
196 | 191 |
*/ |
197 |
public final static int GEOM2DM = 3;
|
|
192 |
public final static int GEOM2DM = 2;
|
|
198 | 193 |
|
199 | 194 |
/** |
200 | 195 |
* Geometries with three dimensions and with the M coordinate. |
201 | 196 |
*/ |
202 |
public final static int GEOM3DM = 4;
|
|
197 |
public final static int GEOM3DM = 3;
|
|
203 | 198 |
|
204 | 199 |
/** |
205 | 200 |
* The subtype us unknown. |
206 | 201 |
*/ |
207 |
public final static int UNKNOWN = 5;
|
|
202 |
public final static int UNKNOWN = 4;
|
|
208 | 203 |
} |
209 | 204 |
|
210 | 205 |
/** |
branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/operation/towkb/WKBEncoder.java | ||
---|---|---|
447 | 447 |
case SUBTYPES.GEOM2DM: |
448 | 448 |
finalType = finalType + wkbGeometryType.wkb_baseToM; |
449 | 449 |
break; |
450 |
|
|
451 |
case SUBTYPES.GEOM2DZ: |
|
450 |
|
|
452 | 451 |
case SUBTYPES.GEOM3D: |
453 | 452 |
finalType = finalType + wkbGeometryType.wkb_baseToZ; |
454 | 453 |
break; |
branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/impl/DefaultGeometryManager.java | ||
---|---|---|
735 | 735 |
public Envelope createEnvelope(int subType) { |
736 | 736 |
// TODO: register the envelopes!!! |
737 | 737 |
switch (subType) { |
738 |
case SUBTYPES.GEOM2DZ: |
|
739 | 738 |
case SUBTYPES.GEOM3D: |
740 | 739 |
return new Envelope3D(); |
741 | 740 |
default: |
branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/impl/DefaultGeometryLibrary.java | ||
---|---|---|
140 | 140 |
geometryManager.registerGeometryType(MultiCurve2D.class, |
141 | 141 |
"MultiCurve2D", TYPES.MULTICURVE, SUBTYPES.GEOM2D); |
142 | 142 |
geometryManager.registerGeometryType(MultiCurve2DZ.class, |
143 |
"MultiCurve2DZ", TYPES.MULTICURVE, SUBTYPES.GEOM2DZ);
|
|
143 |
"MultiCurve2DZ", TYPES.MULTICURVE, SUBTYPES.GEOM3D);
|
|
144 | 144 |
geometryManager.registerGeometryType(MultiPoint2D.class, |
145 | 145 |
"MultiPoint2D", TYPES.MULTIPOINT, SUBTYPES.GEOM2D); |
146 | 146 |
geometryManager.registerGeometryType(MultiSurface2D.class, |
... | ... | |
148 | 148 |
|
149 | 149 |
// Register the geometries in 2DZ |
150 | 150 |
geometryManager.registerGeometryType(DefaultNullGeometry.class, |
151 |
TYPES.NULL, SUBTYPES.GEOM2DZ);
|
|
152 |
geometryManager.registerGeometryType(Geometry2DZ.class, "Geometry2DZ",
|
|
153 |
TYPES.GEOMETRY, SUBTYPES.GEOM2DZ);
|
|
154 |
geometryManager.registerGeometryType(Arc2DZ.class, TYPES.ARC, |
|
155 |
SUBTYPES.GEOM2DZ);
|
|
156 |
geometryManager.registerGeometryType(Circle2DZ.class, TYPES.CIRCLE, |
|
157 |
SUBTYPES.GEOM2DZ);
|
|
158 |
geometryManager.registerGeometryType(Curve2DZ.class, TYPES.CURVE, |
|
159 |
SUBTYPES.GEOM2DZ);
|
|
160 |
geometryManager.registerGeometryType(Ellipse2DZ.class, TYPES.ELLIPSE, |
|
161 |
SUBTYPES.GEOM2DZ);
|
|
162 |
geometryManager.registerGeometryType(EllipticArc2DZ.class, |
|
163 |
TYPES.ELLIPTICARC, SUBTYPES.GEOM2DZ);
|
|
164 |
geometryManager.registerGeometryType(Point2DZ.class, TYPES.POINT, |
|
165 |
SUBTYPES.GEOM2DZ);
|
|
166 |
geometryManager.registerGeometryType(Spline2DZ.class, TYPES.SPLINE, |
|
167 |
SUBTYPES.GEOM2DZ);
|
|
168 |
geometryManager.registerGeometryType(Surface2DZ.class, TYPES.SURFACE, |
|
169 |
SUBTYPES.GEOM2DZ);
|
|
170 |
geometryManager.registerGeometryType(MultiPoint2DZ.class, |
|
171 |
TYPES.MULTIPOINT, SUBTYPES.GEOM2DZ);
|
|
172 |
geometryManager.registerGeometryType(Solid2DZ.class, TYPES.SOLID, |
|
173 |
SUBTYPES.GEOM2DZ);
|
|
151 |
TYPES.NULL, SUBTYPES.GEOM3D);
|
|
152 |
geometryManager.registerGeometryType(Geometry2DZ.class, "Geometry3D",
|
|
153 |
TYPES.GEOMETRY, SUBTYPES.GEOM3D);
|
|
154 |
geometryManager.registerGeometryType(Arc2DZ.class, "Arc3D", TYPES.ARC,
|
|
155 |
SUBTYPES.GEOM3D);
|
|
156 |
geometryManager.registerGeometryType(Circle2DZ.class, "Circle3D", TYPES.CIRCLE,
|
|
157 |
SUBTYPES.GEOM3D);
|
|
158 |
geometryManager.registerGeometryType(Curve2DZ.class, "Curve3D", TYPES.CURVE,
|
|
159 |
SUBTYPES.GEOM3D);
|
|
160 |
geometryManager.registerGeometryType(Ellipse2DZ.class, "Ellipse3D", TYPES.ELLIPSE,
|
|
161 |
SUBTYPES.GEOM3D);
|
|
162 |
geometryManager.registerGeometryType(EllipticArc2DZ.class, "EllipticArc3D",
|
|
163 |
TYPES.ELLIPTICARC, SUBTYPES.GEOM3D);
|
|
164 |
geometryManager.registerGeometryType(Point2DZ.class, "Point3D", TYPES.POINT,
|
|
165 |
SUBTYPES.GEOM3D);
|
|
166 |
geometryManager.registerGeometryType(Spline2DZ.class, "Spline3D", TYPES.SPLINE,
|
|
167 |
SUBTYPES.GEOM3D);
|
|
168 |
geometryManager.registerGeometryType(Surface2DZ.class, "Surface3D", TYPES.SURFACE,
|
|
169 |
SUBTYPES.GEOM3D);
|
|
170 |
geometryManager.registerGeometryType(MultiPoint2DZ.class, "Multipoint3D",
|
|
171 |
TYPES.MULTIPOINT, SUBTYPES.GEOM3D);
|
|
172 |
geometryManager.registerGeometryType(Solid2DZ.class, "Solid3D", TYPES.SOLID,
|
|
173 |
SUBTYPES.GEOM3D);
|
|
174 | 174 |
|
175 | 175 |
// Persistence |
176 | 176 |
DefaultEnvelope.registerPersistent(); |
branches/v2_0_0_prep/libraries/libFMap_geometries/src-test/org/gvsig/fmap/geom/operation/tojts/toJTSTest.java | ||
---|---|---|
99 | 99 |
} |
100 | 100 |
|
101 | 101 |
public void testMultiPoint() throws GeometryOperationNotSupportedException, GeometryOperationException, CreateGeometryException{ |
102 |
Point point1 = (Point)manager.create(TYPES.POINT, SUBTYPES.GEOM2DZ);
|
|
102 |
Point point1 = (Point)manager.create(TYPES.POINT, SUBTYPES.GEOM3D);
|
|
103 | 103 |
point1.setCoordinateAt(0, 1.0); |
104 | 104 |
point1.setCoordinateAt(1, 2.0); |
105 | 105 |
point1.setCoordinateAt(2, 3.0); |
106 | 106 |
|
107 |
Point point2 = (Point)manager.create(TYPES.POINT, SUBTYPES.GEOM2DZ);
|
|
107 |
Point point2 = (Point)manager.create(TYPES.POINT, SUBTYPES.GEOM3D);
|
|
108 | 108 |
point2.setCoordinateAt(0, 4.0); |
109 | 109 |
point2.setCoordinateAt(1, 5.0); |
110 | 110 |
point2.setCoordinateAt(2, 6.0); |
branches/v2_0_0_prep/libraries/libFMap_geometries/src-test/org/gvsig/fmap/geom/GeometryManagerTest.java | ||
---|---|---|
83 | 83 |
// p.invokeOperation(ToJTS.CODE, ctx); |
84 | 84 |
// p.invokeOperation(Flip.CODE, ctx); |
85 | 85 |
|
86 |
Geometry sol = manager.create(TYPES.SOLID, SUBTYPES.GEOM2DZ);
|
|
86 |
Geometry sol = manager.create(TYPES.SOLID, SUBTYPES.GEOM3D);
|
|
87 | 87 |
assertNotNull(sol); |
88 | 88 |
//logger.debug(sol); |
89 | 89 |
|
branches/v2_0_0_prep/libraries/libFMap_geometries/src-test/org/gvsig/fmap/geom/aggregate/MultiPointTest.java | ||
---|---|---|
52 | 52 |
} |
53 | 53 |
|
54 | 54 |
public void testCreateMultiPoint2D() throws InstantiationException, IllegalAccessException, CreateGeometryException{ |
55 |
Point point1 = (Point)manager.create(TYPES.POINT, SUBTYPES.GEOM2DZ);
|
|
55 |
Point point1 = (Point)manager.create(TYPES.POINT, SUBTYPES.GEOM3D);
|
|
56 | 56 |
point1.setCoordinateAt(0, 1.0); |
57 | 57 |
point1.setCoordinateAt(1, 2.0); |
58 | 58 |
point1.setCoordinateAt(2, 3.0); |
59 | 59 |
|
60 |
Point point2 = (Point)manager.create(TYPES.POINT, SUBTYPES.GEOM2DZ);
|
|
60 |
Point point2 = (Point)manager.create(TYPES.POINT, SUBTYPES.GEOM3D);
|
|
61 | 61 |
point2.setCoordinateAt(0, 4.0); |
62 | 62 |
point2.setCoordinateAt(1, 5.0); |
63 | 63 |
point2.setCoordinateAt(2, 6.0); |
branches/v2_0_0_prep/libraries/libFMap_geometries/src-test/org/gvsig/fmap/geom/primitive/CurveTest.java | ||
---|---|---|
91 | 91 |
} |
92 | 92 |
|
93 | 93 |
public void testCreateCurve2DZ() throws InstantiationException, IllegalAccessException, CreateGeometryException{ |
94 |
Curve curve = (Curve)manager.create(TYPES.CURVE, SUBTYPES.GEOM2DZ);
|
|
94 |
Curve curve = (Curve)manager.create(TYPES.CURVE, SUBTYPES.GEOM3D);
|
|
95 | 95 |
GeneralPathX generalPathX = new GeneralPathX(); |
96 | 96 |
generalPathX.moveTo(0, 0); |
97 | 97 |
generalPathX.lineTo(1, 1); |
branches/v2_0_0_prep/libraries/libFMap_geometries/src-test/org/gvsig/fmap/geom/primitive/PointTest.java | ||
---|---|---|
100 | 100 |
} |
101 | 101 |
|
102 | 102 |
public void testCreatePoint2DZ() throws InstantiationException, IllegalAccessException, CreateGeometryException{ |
103 |
Point point = (Point)manager.create(TYPES.POINT, SUBTYPES.GEOM2DZ);
|
|
103 |
Point point = (Point)manager.create(TYPES.POINT, SUBTYPES.GEOM3D);
|
|
104 | 104 |
point.setCoordinateAt(0, 1.0); |
105 | 105 |
point.setCoordinateAt(1, 2.0); |
106 | 106 |
point.setCoordinateAt(2, 3.0); |
... | ... | |
127 | 127 |
} |
128 | 128 |
|
129 | 129 |
public void testPersistencePoint2DZ() throws CreateGeometryException, PersistenceTypeNotSupportedException, PersistenceClassNotRegistered, PersistenceException, PersistenceValidateExceptions, LocatorException{ |
130 |
Point point1 = (Point)manager.create(TYPES.POINT, SUBTYPES.GEOM2DZ);
|
|
130 |
Point point1 = (Point)manager.create(TYPES.POINT, SUBTYPES.GEOM3D);
|
|
131 | 131 |
point1.setCoordinateAt(0, 1.0); |
132 | 132 |
point1.setCoordinateAt(1, 2.0); |
133 | 133 |
point1.setCoordinateAt(2, 3.0); |
branches/v2_0_0_prep/libraries/libFMap_daldb/src/org/gvsig/fmap/dal/store/postgresql/PostgreSQLHelper.java | ||
---|---|---|
575 | 575 |
if (geometrySubType == Geometry.SUBTYPES.GEOM2DM |
576 | 576 |
|| geometrySubType == Geometry.SUBTYPES.GEOM3DM) { |
577 | 577 |
pgGeomType = pgGeomType + "M"; |
578 |
} else if (geometrySubType == Geometry.SUBTYPES.GEOM2DZ) {
|
|
578 |
} else if (geometrySubType == Geometry.SUBTYPES.GEOM3D) {
|
|
579 | 579 |
throw new UnsupportedGeometryException(geometryType, |
580 | 580 |
geometrySubType); |
581 | 581 |
} |
branches/v2_0_0_prep/extensions/extDwg/src/org/gvsig/dwg/fmap/dal/store/dwg/DWGStoreProvider.java | ||
---|---|---|
258 | 258 |
store.setFeatureTypes(dwgData.fTypes, dwgData.defaultFType); |
259 | 259 |
legendBuilder = dwgData.legendBuilder; |
260 | 260 |
setDynValue("Envelope", dwgData.getEnvelopeCopy()); |
261 |
setDynValue("CRS", projection.getAbrev());
|
|
261 |
setDynValue("CRS", projection); |
|
262 | 262 |
counterNewsOIDs = data.size(); |
263 | 263 |
return null; |
264 | 264 |
} |
... | ... | |
307 | 307 |
private LegendBuilder leyendBuilder; |
308 | 308 |
private AbstractMemoryStoreProvider store; |
309 | 309 |
private Envelope envelope; |
310 |
private DwgFile dwgFeatureFile; |
|
310 | 311 |
|
311 | 312 |
public Reader initialice(AbstractMemoryStoreProvider store, File file, |
312 | 313 |
IProjection projection, |
... | ... | |
326 | 327 |
return this.envelope; |
327 | 328 |
} |
328 | 329 |
|
329 |
public void begin(FeatureStoreProviderServices store) { |
|
330 |
public void begin(FeatureStoreProviderServices store) throws UnsupportedDWGVersionException, ReadException { |
|
331 |
dwgFeatureFile = new DwgFile(file.getAbsolutePath()); |
|
330 | 332 |
|
333 |
try { |
|
334 |
dwgFeatureFile.read(); |
|
335 |
} catch (DwgVersionNotSupportedException e1) { |
|
336 |
throw new UnsupportedDWGVersionException(file.getName(), e1); |
|
337 |
} catch (IOException e) { |
|
338 |
throw new ReadException(NAME, e); |
|
339 |
} |
|
340 |
|
|
331 | 341 |
EditableFeatureType featureType = store.createFeatureType(); |
332 | 342 |
|
333 | 343 |
featureType.setHasOID(true); |
... | ... | |
340 | 350 |
NAME_FIELD_GEOMETRY, DataTypes.GEOMETRY); |
341 | 351 |
attr.setSRS(this.projection); |
342 | 352 |
attr.setGeometryType(Geometry.TYPES.GEOMETRY); |
353 |
boolean is3dFile = dwgFeatureFile.isDwg3DFile(); |
|
354 |
if (is3dFile){ |
|
355 |
attr.setGeometrySubType(Geometry.SUBTYPES.GEOM3D); |
|
356 |
}else{ |
|
357 |
attr.setGeometrySubType(Geometry.SUBTYPES.GEOM2D); |
|
358 |
} |
|
343 | 359 |
ID_FIELD_GEOMETRY = attr.getIndex(); |
344 | 360 |
|
345 | 361 |
featureType.setDefaultGeometryAttributeName(NAME_FIELD_GEOMETRY); |
... | ... | |
424 | 440 |
|
425 | 441 |
this.envelope = null; |
426 | 442 |
|
427 |
DwgFile dwgFeatureFile = new DwgFile(file.getAbsolutePath()); |
|
428 |
|
|
429 |
try { |
|
430 |
dwgFeatureFile.read(); |
|
431 |
} catch (DwgVersionNotSupportedException e1) { |
|
432 |
throw new UnsupportedDWGVersionException(file.getName(), e1); |
|
433 |
} catch (IOException e) { |
|
434 |
throw new ReadException(NAME, e); |
|
435 |
} |
|
436 |
|
|
437 |
|
|
443 |
|
|
438 | 444 |
dwgFeatureFile.calculateGisModelDwgPolylines(); |
439 | 445 |
dwgFeatureFile.blockManagement2(); |
440 | 446 |
List entities = dwgFeatureFile.getDwgObjects(); |
... | ... | |
443 | 449 |
try{ |
444 | 450 |
int envelopeSubType = Geometry.SUBTYPES.GEOM2D; |
445 | 451 |
boolean is3dFile = dwgFeatureFile.isDwg3DFile(); |
446 |
// if (is3dFile) { |
|
447 |
// envelopeSubType = Geometry.SUBTYPES.GEOM3D; |
|
448 |
// } |
|
449 | 452 |
|
450 | 453 |
this.envelope = geomManager.createEnvelope(envelopeSubType); |
451 | 454 |
|
branches/v2_0_0_prep/extensions/extGPE-gvSIG/src-test/org/gvsig/fmap/geom/operation/writegml2/WriteGmlTest.java | ||
---|---|---|
116 | 116 |
} |
117 | 117 |
|
118 | 118 |
public void testMultiPoint2D() throws CreateGeometryException, WriterHandlerCreationException, GeometryOperationNotSupportedException, GeometryOperationException, IOException{ |
119 |
Point point1 = (Point)geometryManager.create(TYPES.POINT, SUBTYPES.GEOM2DZ);
|
|
119 |
Point point1 = (Point)geometryManager.create(TYPES.POINT, SUBTYPES.GEOM3D);
|
|
120 | 120 |
point1.setCoordinateAt(0, 1.0); |
121 | 121 |
point1.setCoordinateAt(1, 2.0); |
122 | 122 |
point1.setCoordinateAt(2, 3.0); |
123 | 123 |
|
124 |
Point point2 = (Point)geometryManager.create(TYPES.POINT, SUBTYPES.GEOM2DZ);
|
|
124 |
Point point2 = (Point)geometryManager.create(TYPES.POINT, SUBTYPES.GEOM3D);
|
|
125 | 125 |
point2.setCoordinateAt(0, 4.0); |
126 | 126 |
point2.setCoordinateAt(1, 5.0); |
127 | 127 |
point2.setCoordinateAt(2, 6.0); |
branches/v2_0_0_prep/extensions/extGPE-gvSIG/src/org/gvsig/fmap/dal/store/gpe/handlers/FmapContentHandler.java | ||
---|---|---|
181 | 181 |
if (coords.getDimension() == 2){ |
182 | 182 |
point = (Point) geomManager.create(TYPES.POINT, SUBTYPES.GEOM2D); |
183 | 183 |
}else if (coords.getDimension() == 3){ |
184 |
point = (Point) geomManager.create(TYPES.POINT, SUBTYPES.GEOM2DZ);
|
|
184 |
point = (Point) geomManager.create(TYPES.POINT, SUBTYPES.GEOM3D);
|
|
185 | 185 |
} |
186 | 186 |
for (int i=0 ; i<buffer.length ; i++){ |
187 | 187 |
point.setCoordinateAt(i, buffer[i]); |
... | ... | |
201 | 201 |
if (buffer.length == 2){ |
202 | 202 |
point = (Point) geomManager.create(TYPES.POINT, SUBTYPES.GEOM2D); |
203 | 203 |
}else if (buffer.length == 3){ |
204 |
point = (Point) geomManager.create(TYPES.POINT, SUBTYPES.GEOM2DZ);
|
|
204 |
point = (Point) geomManager.create(TYPES.POINT, SUBTYPES.GEOM3D);
|
|
205 | 205 |
} |
206 | 206 |
for (int i=0 ; i<buffer.length ; i++){ |
207 | 207 |
point.setCoordinateAt(i, buffer[i]); |
... | ... | |
229 | 229 |
if (coords.getDimension() == 2){ |
230 | 230 |
curve = (Curve) geomManager.create(TYPES.CURVE, SUBTYPES.GEOM2D); |
231 | 231 |
}else if (coords.getDimension() == 3){ |
232 |
curve = (Curve) geomManager.create(TYPES.CURVE, SUBTYPES.GEOM2DZ);
|
|
232 |
curve = (Curve) geomManager.create(TYPES.CURVE, SUBTYPES.GEOM3D);
|
|
233 | 233 |
} |
234 | 234 |
curve.setGeneralPath(gp); |
235 | 235 |
return curve; |
... | ... | |
275 | 275 |
if (coords.getDimension() == 2){ |
276 | 276 |
surface = (Surface) geomManager.create(TYPES.SURFACE, SUBTYPES.GEOM2D); |
277 | 277 |
}else if (coords.getDimension() == 3){ |
278 |
surface = (Surface) geomManager.create(TYPES.SURFACE, SUBTYPES.GEOM2DZ);
|
|
278 |
surface = (Surface) geomManager.create(TYPES.SURFACE, SUBTYPES.GEOM3D);
|
|
279 | 279 |
} |
280 | 280 |
surface.setGeneralPath(gp); |
281 | 281 |
return surface; |
... | ... | |
440 | 440 |
if (coords.getDimension() == 2){ |
441 | 441 |
envelope = geomManager.createEnvelope(SUBTYPES.GEOM2D); |
442 | 442 |
}else if (coords.getDimension() == 3){ |
443 |
envelope = geomManager.createEnvelope(SUBTYPES.GEOM2DZ);
|
|
443 |
envelope = geomManager.createEnvelope(SUBTYPES.GEOM3D);
|
|
444 | 444 |
} |
445 | 445 |
double[] buffer = new double[coords.getDimension()]; |
446 | 446 |
|
Also available in: Unified diff