svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.geometry / org.gvsig.fmap.geometry.jts / src / main / java / org / gvsig / fmap / geom / jts / DefaultGeometryLibrary.java @ 42360
History | View | Annotate | Download (18.2 KB)
1 | 42260 | fdiaz | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | *
|
||
4 | * Copyright (C) 2007-2013 gvSIG Association.
|
||
5 | *
|
||
6 | * This program is free software; you can redistribute it and/or
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | * as published by the Free Software Foundation; either version 3
|
||
9 | * of the License, or (at your option) any later version.
|
||
10 | *
|
||
11 | * This program is distributed in the hope that it will be useful,
|
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | * For any additional information, do not hesitate to contact us
|
||
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | */
|
||
24 | |||
25 | package org.gvsig.fmap.geom.jts; |
||
26 | |||
27 | import org.gvsig.fmap.geom.DataTypes; |
||
28 | import org.gvsig.fmap.geom.Geometry.SUBTYPES; |
||
29 | import org.gvsig.fmap.geom.Geometry.TYPES; |
||
30 | import org.gvsig.fmap.geom.GeometryLibrary; |
||
31 | import org.gvsig.fmap.geom.GeometryLocator; |
||
32 | import org.gvsig.fmap.geom.GeometryManager; |
||
33 | 42283 | fdiaz | import org.gvsig.fmap.geom.jts.aggregate.DefaultMultiCurve; |
34 | import org.gvsig.fmap.geom.jts.aggregate.DefaultMultiSurface; |
||
35 | 42278 | fdiaz | import org.gvsig.fmap.geom.jts.aggregate.MultiLine2D; |
36 | import org.gvsig.fmap.geom.jts.aggregate.MultiLine2DM; |
||
37 | import org.gvsig.fmap.geom.jts.aggregate.MultiLine3D; |
||
38 | import org.gvsig.fmap.geom.jts.aggregate.MultiLine3DM; |
||
39 | 42267 | fdiaz | import org.gvsig.fmap.geom.jts.aggregate.MultiPoint2D; |
40 | import org.gvsig.fmap.geom.jts.aggregate.MultiPoint2DM; |
||
41 | 42278 | fdiaz | import org.gvsig.fmap.geom.jts.aggregate.MultiPoint3D; |
42 | 42267 | fdiaz | import org.gvsig.fmap.geom.jts.aggregate.MultiPoint3DM; |
43 | 42278 | fdiaz | import org.gvsig.fmap.geom.jts.aggregate.MultiPolygon2D; |
44 | import org.gvsig.fmap.geom.jts.aggregate.MultiPolygon2DM; |
||
45 | import org.gvsig.fmap.geom.jts.aggregate.MultiPolygon3D; |
||
46 | import org.gvsig.fmap.geom.jts.aggregate.MultiPolygon3DM; |
||
47 | 42260 | fdiaz | import org.gvsig.fmap.geom.jts.coerce.CoerceToByteArray; |
48 | import org.gvsig.fmap.geom.jts.coerce.CoerceToEnvelope; |
||
49 | import org.gvsig.fmap.geom.jts.coerce.CoerceToGeometry; |
||
50 | import org.gvsig.fmap.geom.jts.coerce.CoerceToString; |
||
51 | 42330 | fdiaz | import org.gvsig.fmap.geom.jts.operation.fromjts.FromJTS; |
52 | import org.gvsig.fmap.geom.jts.operation.fromwkb.FromWKB; |
||
53 | import org.gvsig.fmap.geom.jts.operation.fromwkt.FromWKT; |
||
54 | import org.gvsig.fmap.geom.jts.operation.tojts.ToJTS; |
||
55 | import org.gvsig.fmap.geom.jts.operation.towkb.ToWKB; |
||
56 | import org.gvsig.fmap.geom.jts.operation.towkb.ToWKBNative; |
||
57 | import org.gvsig.fmap.geom.jts.operation.towkt.ToWKT; |
||
58 | 42268 | fdiaz | import org.gvsig.fmap.geom.jts.persistence.GeometryPersistenceFactory; |
59 | import org.gvsig.fmap.geom.jts.persistence.GeometryTypePersistenceFactory; |
||
60 | 42260 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.DefaultEnvelope; |
61 | 42278 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.DefaultNullGeometry; |
62 | 42260 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.Envelope2D; |
63 | import org.gvsig.fmap.geom.jts.primitive.Envelope3D; |
||
64 | 42283 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.Geometry2D; |
65 | import org.gvsig.fmap.geom.jts.primitive.Geometry2DM; |
||
66 | import org.gvsig.fmap.geom.jts.primitive.Geometry3D; |
||
67 | import org.gvsig.fmap.geom.jts.primitive.Geometry3DM; |
||
68 | 42267 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.curve.arc.Arc2D; |
69 | import org.gvsig.fmap.geom.jts.primitive.curve.arc.Arc2DZ; |
||
70 | 42304 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.curve.circumference.Circumference2D; |
71 | import org.gvsig.fmap.geom.jts.primitive.curve.circumference.Circumference2DZ; |
||
72 | 42260 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.curve.line.Line2D; |
73 | import org.gvsig.fmap.geom.jts.primitive.curve.line.Line2DM; |
||
74 | import org.gvsig.fmap.geom.jts.primitive.curve.line.Line3D; |
||
75 | import org.gvsig.fmap.geom.jts.primitive.curve.line.Line3DM; |
||
76 | 42304 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.curve.periellipse.PeriEllipse2D; |
77 | import org.gvsig.fmap.geom.jts.primitive.curve.periellipse.PeriEllipse2DZ; |
||
78 | 42267 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.curve.spline.Spline2D; |
79 | import org.gvsig.fmap.geom.jts.primitive.curve.spline.Spline2DM; |
||
80 | import org.gvsig.fmap.geom.jts.primitive.curve.spline.Spline3D; |
||
81 | import org.gvsig.fmap.geom.jts.primitive.curve.spline.Spline3DM; |
||
82 | 42283 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.point.Point2DGeometryType; |
83 | 42260 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.point.Point2DM; |
84 | 42283 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.point.Point3DGeometryType; |
85 | 42260 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.point.Point3DM; |
86 | 42283 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.ring.Ring2D; |
87 | import org.gvsig.fmap.geom.jts.primitive.ring.Ring2DM; |
||
88 | import org.gvsig.fmap.geom.jts.primitive.ring.Ring3D; |
||
89 | import org.gvsig.fmap.geom.jts.primitive.ring.Ring3DM; |
||
90 | 42268 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.surface.circle.Circle2D; |
91 | import org.gvsig.fmap.geom.jts.primitive.surface.circle.Circle2DZ; |
||
92 | import org.gvsig.fmap.geom.jts.primitive.surface.ellipse.Ellipse2D; |
||
93 | import org.gvsig.fmap.geom.jts.primitive.surface.ellipse.Ellipse2DZ; |
||
94 | 42304 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.surface.ellipticarc.EllipticArc2D; |
95 | import org.gvsig.fmap.geom.jts.primitive.surface.ellipticarc.EllipticArc2DZ; |
||
96 | import org.gvsig.fmap.geom.jts.primitive.surface.filledspline.FilledSpline2D; |
||
97 | import org.gvsig.fmap.geom.jts.primitive.surface.filledspline.FilledSpline2DM; |
||
98 | import org.gvsig.fmap.geom.jts.primitive.surface.filledspline.FilledSpline3D; |
||
99 | import org.gvsig.fmap.geom.jts.primitive.surface.filledspline.FilledSpline3DM; |
||
100 | 42260 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.surface.polygon.Polygon2D; |
101 | 42283 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.surface.polygon.Polygon2DM; |
102 | 42260 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.surface.polygon.Polygon3D; |
103 | 42283 | fdiaz | import org.gvsig.fmap.geom.jts.primitive.surface.polygon.Polygon3DM; |
104 | 42260 | fdiaz | import org.gvsig.fmap.geom.operation.GeometryOperation; |
105 | import org.gvsig.tools.ToolsLocator; |
||
106 | import org.gvsig.tools.dataTypes.DataTypesManager; |
||
107 | import org.gvsig.tools.library.AbstractLibrary; |
||
108 | import org.gvsig.tools.library.LibraryException; |
||
109 | import org.gvsig.tools.persistence.PersistenceManager; |
||
110 | |||
111 | /**
|
||
112 | * Registers the default implementation for {@link GeometryManager}
|
||
113 | *
|
||
114 | * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
|
||
115 | */
|
||
116 | public class DefaultGeometryLibrary extends AbstractLibrary { |
||
117 | |||
118 | public void doRegistration() { |
||
119 | registerAsImplementationOf(GeometryLibrary.class); |
||
120 | } |
||
121 | |||
122 | protected void doInitialize() throws LibraryException { |
||
123 | // Register the default GeometryManager
|
||
124 | GeometryLocator.registerGeometryManager(DefaultGeometryManager.class); |
||
125 | } |
||
126 | |||
127 | protected void doPostInitialize() throws LibraryException { |
||
128 | 42283 | fdiaz | |
129 | 42260 | fdiaz | GeometryManager geometryManager = GeometryLocator.getGeometryManager(); |
130 | |||
131 | DataTypesManager dataTypesManager = ToolsLocator.getDataTypesManager(); |
||
132 | |||
133 | dataTypesManager.setCoercion(DataTypes.GEOMETRY, new CoerceToGeometry());
|
||
134 | dataTypesManager.setCoercion(DataTypes.ENVELOPE, new CoerceToEnvelope());
|
||
135 | dataTypesManager.setCoercion(DataTypes.STRING, |
||
136 | new CoerceToString(dataTypesManager.getCoercion(DataTypes.STRING)));
|
||
137 | dataTypesManager.setCoercion(DataTypes.BYTEARRAY, |
||
138 | new CoerceToByteArray(dataTypesManager.getCoercion(DataTypes.BYTEARRAY)));
|
||
139 | |||
140 | GeometryOperation.OPERATION_INTERSECTS_CODE = |
||
141 | 42283 | fdiaz | geometryManager.getGeometryOperationCode(GeometryOperation.OPERATION_INTERSECTS_NAME); |
142 | 42260 | fdiaz | |
143 | GeometryOperation.OPERATION_CONTAINS_CODE = |
||
144 | 42283 | fdiaz | geometryManager.getGeometryOperationCode(GeometryOperation.OPERATION_CONTAINS_NAME); |
145 | 42260 | fdiaz | |
146 | // Register the geometries in 2D
|
||
147 | 42278 | fdiaz | geometryManager.registerGeometryType(DefaultNullGeometry.class, "Null", TYPES.NULL, SUBTYPES.GEOM2D);
|
148 | 42260 | fdiaz | |
149 | 42283 | fdiaz | geometryManager.registerGeometryType(Geometry2D.class, "Geometry2D", TYPES.GEOMETRY, SUBTYPES.GEOM2D);
|
150 | geometryManager.registerGeometryType(Geometry3D.class, "Geometry3D", TYPES.GEOMETRY, SUBTYPES.GEOM3D);
|
||
151 | geometryManager.registerGeometryType(Geometry2DM.class, "Geometry2DM", TYPES.GEOMETRY, SUBTYPES.GEOM2DM);
|
||
152 | geometryManager.registerGeometryType(Geometry3DM.class, "Geometry3DM", TYPES.GEOMETRY, SUBTYPES.GEOM3DM);
|
||
153 | 42260 | fdiaz | |
154 | // Register points in 2D
|
||
155 | 42283 | fdiaz | geometryManager.registerGeometryType(new Point2DGeometryType());
|
156 | // geometryManager.registerGeometryType(Point2D.class, "Point2D", TYPES.POINT, SUBTYPES.GEOM2D);
|
||
157 | 42260 | fdiaz | geometryManager.registerGeometryType(Point2DM.class, "Point2DM", TYPES.POINT, SUBTYPES.GEOM2DM);
|
158 | |||
159 | // Register curves in 2D
|
||
160 | 42304 | fdiaz | geometryManager.registerGeometryType(Line2D.class, "Line2D", TYPES.LINE, SUBTYPES.GEOM2D, TYPES.CURVE); |
161 | 42330 | fdiaz | geometryManager.registerGeometryType(Line2D.class, "Curve2D", TYPES.CURVE, SUBTYPES.GEOM2D, TYPES.CURVE); |
162 | 42304 | fdiaz | geometryManager.registerGeometryType(Arc2D.class, "Arc2D", TYPES.ARC, SUBTYPES.GEOM2D, TYPES.CURVE); |
163 | geometryManager.registerGeometryType(Spline2D.class, "Spline2D", TYPES.SPLINE, SUBTYPES.GEOM2D, TYPES.CURVE);
|
||
164 | geometryManager.registerGeometryType(Circumference2D.class, "Circumference2D", TYPES.CIRCUMFERENCE, SUBTYPES.GEOM2D, TYPES.CURVE);
|
||
165 | geometryManager.registerGeometryType(PeriEllipse2D.class, "PeriEllipse2D", TYPES.PERIELLIPSE, SUBTYPES.GEOM2D, TYPES.CURVE);
|
||
166 | 42267 | fdiaz | |
167 | 42283 | fdiaz | // Register surfaces in 2D
|
168 | 42304 | fdiaz | geometryManager.registerGeometryType(Polygon2D.class, "Polygon2D", TYPES.POLYGON, SUBTYPES.GEOM2D, TYPES.SURFACE);
|
169 | geometryManager.registerGeometryType(Polygon2D.class, "Surface2D", TYPES.SURFACE, SUBTYPES.GEOM2D, TYPES.SURFACE);
|
||
170 | 42260 | fdiaz | |
171 | 42304 | fdiaz | geometryManager.registerGeometryType(Circle2D.class, "Circle2D", TYPES.CIRCLE, SUBTYPES.GEOM2D, TYPES.SURFACE);
|
172 | geometryManager.registerGeometryType(Ellipse2D.class, "Ellipse2D", TYPES.ELLIPSE, SUBTYPES.GEOM2D, TYPES.SURFACE); |
||
173 | geometryManager.registerGeometryType(Ring2D.class, "Ring2D", TYPES.RING, SUBTYPES.GEOM2D, TYPES.SURFACE);
|
||
174 | geometryManager.registerGeometryType(FilledSpline2D.class, "FilledSpline2D", TYPES.FILLEDSPLINE, SUBTYPES.GEOM2D, TYPES.SURFACE);
|
||
175 | geometryManager.registerGeometryType(EllipticArc2D.class, "EllipticArc2D", TYPES.ELLIPTICARC, SUBTYPES.GEOM2D, TYPES.SURFACE);
|
||
176 | 42260 | fdiaz | |
177 | 42283 | fdiaz | // Register curves in 2DM
|
178 | 42304 | fdiaz | geometryManager.registerGeometryType(Line2DM.class, "Line2DM", TYPES.LINE, SUBTYPES.GEOM2DM, TYPES.CURVE);
|
179 | 42330 | fdiaz | geometryManager.registerGeometryType(Line2DM.class, "Curve2DM", TYPES.CURVE, SUBTYPES.GEOM2DM, TYPES.CURVE);
|
180 | 42304 | fdiaz | geometryManager.registerGeometryType(Spline2DM.class, "Spline2DM", TYPES.SPLINE, SUBTYPES.GEOM2DM, TYPES.CURVE);
|
181 | 42283 | fdiaz | |
182 | // Register surfaces in 2DM
|
||
183 | 42304 | fdiaz | geometryManager.registerGeometryType(Polygon2DM.class, "Polygon2DM", TYPES.POLYGON, SUBTYPES.GEOM2DM, TYPES.SURFACE);
|
184 | 42330 | fdiaz | geometryManager.registerGeometryType(Polygon2DM.class, "Surface2DM", TYPES.SURFACE, SUBTYPES.GEOM2DM, TYPES.SURFACE);
|
185 | 42304 | fdiaz | geometryManager.registerGeometryType(Ring2DM.class, "Ring2DM", TYPES.RING, SUBTYPES.GEOM2DM, TYPES.SURFACE);
|
186 | geometryManager.registerGeometryType(FilledSpline2DM.class, "FilledSpline2DM", TYPES.FILLEDSPLINE, SUBTYPES.GEOM2DM, TYPES.SURFACE);
|
||
187 | 42283 | fdiaz | |
188 | 42260 | fdiaz | // Register multigeometries in 2D
|
189 | // geometryManager.registerGeometryType(BaseMultiPrimitive2D.class, "MultiPrimitive2D", TYPES.AGGREGATE,
|
||
190 | // SUBTYPES.GEOM2D);
|
||
191 | 42304 | fdiaz | geometryManager.registerGeometryType(MultiPoint2D.class, "MultiPoint2D", TYPES.MULTIPOINT, SUBTYPES.GEOM2D, TYPES.AGGREGATE);
|
192 | geometryManager.registerGeometryType(DefaultMultiCurve.class, "MultiCurve", TYPES.MULTICURVE, SUBTYPES.GEOM2D, TYPES.AGGREGATE);
|
||
193 | 42315 | fdiaz | geometryManager.registerGeometryType(MultiLine2D.class, "MultiLine2D", TYPES.MULTILINE, SUBTYPES.GEOM2D, new int[]{TYPES.AGGREGATE, TYPES.MULTICURVE}); |
194 | 42304 | fdiaz | geometryManager.registerGeometryType(DefaultMultiSurface.class, "MultiSurface", TYPES.MULTISURFACE, SUBTYPES.GEOM2D, TYPES.AGGREGATE);
|
195 | 42315 | fdiaz | geometryManager.registerGeometryType(MultiPolygon2D.class, "MultiPolygon2D", TYPES.MULTIPOLYGON, SUBTYPES.GEOM2D, new int[]{TYPES.AGGREGATE, TYPES.MULTISURFACE}); |
196 | 42260 | fdiaz | |
197 | 42267 | fdiaz | // Register multigeometries in 2DM
|
198 | 42304 | fdiaz | geometryManager.registerGeometryType(MultiPoint2DM.class, "MultiPoint2DM", TYPES.MULTIPOINT, SUBTYPES.GEOM2DM, TYPES.AGGREGATE);
|
199 | geometryManager.registerGeometryType(DefaultMultiCurve.class, "MultiCurve", TYPES.MULTICURVE, SUBTYPES.GEOM2DM, TYPES.AGGREGATE);
|
||
200 | 42315 | fdiaz | geometryManager.registerGeometryType(MultiLine2DM.class, "MultiLine2DM", TYPES.MULTILINE, SUBTYPES.GEOM2DM, new int[]{TYPES.AGGREGATE, TYPES.MULTICURVE}); |
201 | 42304 | fdiaz | geometryManager.registerGeometryType(DefaultMultiSurface.class, "MultiSurface", TYPES.MULTISURFACE, SUBTYPES.GEOM2DM, TYPES.AGGREGATE);
|
202 | 42315 | fdiaz | geometryManager.registerGeometryType(MultiPolygon2DM.class, "MultiPolygon2DM", TYPES.MULTIPOLYGON, SUBTYPES.GEOM2DM, new int[]{TYPES.AGGREGATE, TYPES.MULTISURFACE}); |
203 | 42267 | fdiaz | |
204 | 42260 | fdiaz | // Register the geometries in 3D
|
205 | 42278 | fdiaz | geometryManager.registerGeometryType(DefaultNullGeometry.class, TYPES.NULL, SUBTYPES.GEOM3D); |
206 | 42260 | fdiaz | |
207 | // Register points in 3D
|
||
208 | 42283 | fdiaz | geometryManager.registerGeometryType(new Point3DGeometryType());
|
209 | // geometryManager.registerGeometryType(Point3D.class, "Point3D", TYPES.POINT, SUBTYPES.GEOM3D);
|
||
210 | 42267 | fdiaz | geometryManager.registerGeometryType(Point3DM.class, "Point3DM", TYPES.POINT, SUBTYPES.GEOM3DM);
|
211 | 42260 | fdiaz | |
212 | // Register curves in 3D
|
||
213 | 42304 | fdiaz | geometryManager.registerGeometryType(Line3D.class, "Line3D", TYPES.LINE, SUBTYPES.GEOM3D, TYPES.CURVE);
|
214 | 42330 | fdiaz | geometryManager.registerGeometryType(Line3D.class, "Curve3D", TYPES.CURVE, SUBTYPES.GEOM3D, TYPES.CURVE);
|
215 | 42304 | fdiaz | geometryManager.registerGeometryType(Arc2DZ.class, "Arc3D", TYPES.ARC, SUBTYPES.GEOM3D, TYPES.CURVE);
|
216 | geometryManager.registerGeometryType(Spline3D.class, "Spline3D", TYPES.SPLINE, SUBTYPES.GEOM3D, TYPES.CURVE);
|
||
217 | geometryManager.registerGeometryType(Circumference2DZ.class, "Circumference2DZ", TYPES.CIRCUMFERENCE, SUBTYPES.GEOM3D, TYPES.CURVE);
|
||
218 | geometryManager.registerGeometryType(PeriEllipse2DZ.class, "PeriEllipse2DZ", TYPES.PERIELLIPSE, SUBTYPES.GEOM3D, TYPES.CURVE);
|
||
219 | 42260 | fdiaz | |
220 | // Register surfaces in 3D
|
||
221 | 42304 | fdiaz | geometryManager.registerGeometryType(Polygon3D.class, "Polygon3D", TYPES.POLYGON, SUBTYPES.GEOM3D, TYPES.SURFACE);
|
222 | 42330 | fdiaz | geometryManager.registerGeometryType(Polygon3D.class, "Surface3D", TYPES.SURFACE, SUBTYPES.GEOM3D, TYPES.SURFACE);
|
223 | 42304 | fdiaz | geometryManager.registerGeometryType(Ring3D.class, "Ring3D", TYPES.RING, SUBTYPES.GEOM3D, TYPES.SURFACE);
|
224 | geometryManager.registerGeometryType(FilledSpline3D.class, "FilledSpline3D", TYPES.FILLEDSPLINE, SUBTYPES.GEOM3D, TYPES.SURFACE);
|
||
225 | 42268 | fdiaz | |
226 | 42304 | fdiaz | geometryManager.registerGeometryType(Circle2DZ.class, "Circle2DZ", TYPES.CIRCLE, SUBTYPES.GEOM3D, TYPES.SURFACE);
|
227 | geometryManager.registerGeometryType(Ellipse2DZ.class, "Ellipse2DZ", TYPES.ELLIPSE, SUBTYPES.GEOM3D, TYPES.SURFACE);
|
||
228 | 42268 | fdiaz | |
229 | 42304 | fdiaz | geometryManager.registerGeometryType(EllipticArc2DZ.class, "EllipticArc3D", TYPES.ELLIPTICARC, SUBTYPES.GEOM3D, TYPES.SURFACE);
|
230 | 42260 | fdiaz | |
231 | 42283 | fdiaz | // Register curves in 3DM
|
232 | 42304 | fdiaz | geometryManager.registerGeometryType(Line3DM.class, "Line3DM", TYPES.LINE, SUBTYPES.GEOM3DM, TYPES.CURVE);
|
233 | 42330 | fdiaz | geometryManager.registerGeometryType(Line3DM.class, "Curve3DM", TYPES.CURVE, SUBTYPES.GEOM3DM, TYPES.CURVE);
|
234 | 42304 | fdiaz | geometryManager.registerGeometryType(Spline3DM.class, "Spline3DM", TYPES.SPLINE, SUBTYPES.GEOM3DM, TYPES.CURVE);
|
235 | 42283 | fdiaz | |
236 | // Register surfaces in 3DM
|
||
237 | 42304 | fdiaz | geometryManager.registerGeometryType(Polygon3DM.class, "Polygon3DM", TYPES.POLYGON, SUBTYPES.GEOM3DM, TYPES.SURFACE);
|
238 | 42330 | fdiaz | geometryManager.registerGeometryType(Polygon3DM.class, "Surface3DM", TYPES.SURFACE, SUBTYPES.GEOM3DM, TYPES.SURFACE);
|
239 | 42304 | fdiaz | geometryManager.registerGeometryType(Ring3DM.class, "Ring3DM", TYPES.RING, SUBTYPES.GEOM3DM, TYPES.SURFACE);
|
240 | geometryManager.registerGeometryType(FilledSpline3DM.class, "FilledSpline3DM", TYPES.FILLEDSPLINE, SUBTYPES.GEOM3DM, TYPES.SURFACE);
|
||
241 | 42283 | fdiaz | |
242 | |||
243 | 42260 | fdiaz | // Register multigeometries in 3D
|
244 | 42304 | fdiaz | geometryManager.registerGeometryType(MultiPoint3D.class, "Multipoint3D", TYPES.MULTIPOINT, SUBTYPES.GEOM3D, TYPES.AGGREGATE);
|
245 | geometryManager.registerGeometryType(DefaultMultiCurve.class, "MultiCurve", TYPES.MULTICURVE, SUBTYPES.GEOM3D, TYPES.AGGREGATE);
|
||
246 | 42315 | fdiaz | geometryManager.registerGeometryType(MultiLine3D.class, "MultiLine3D", TYPES.MULTILINE, SUBTYPES.GEOM3D, new int[]{TYPES.AGGREGATE, TYPES.MULTICURVE}); |
247 | 42304 | fdiaz | geometryManager.registerGeometryType(DefaultMultiSurface.class, "MultiSurface", TYPES.MULTISURFACE, SUBTYPES.GEOM3D, TYPES.AGGREGATE);
|
248 | 42315 | fdiaz | geometryManager.registerGeometryType(MultiPolygon3D.class, "MultiPolygon3D", TYPES.MULTIPOLYGON, SUBTYPES.GEOM3D, new int[]{TYPES.AGGREGATE, TYPES.MULTISURFACE}); |
249 | 42260 | fdiaz | |
250 | 42267 | fdiaz | // Register multigeometries in 3DM
|
251 | 42304 | fdiaz | geometryManager.registerGeometryType(MultiPoint3DM.class, "MultiPoint3DM", TYPES.MULTIPOINT, SUBTYPES.GEOM2DM, TYPES.AGGREGATE);
|
252 | geometryManager.registerGeometryType(DefaultMultiCurve.class, "MultiCurve", TYPES.MULTICURVE, SUBTYPES.GEOM3DM, TYPES.AGGREGATE);
|
||
253 | 42315 | fdiaz | geometryManager.registerGeometryType(MultiLine3DM.class, "MultiLine3DM", TYPES.MULTILINE, SUBTYPES.GEOM3DM, new int[]{TYPES.AGGREGATE, TYPES.MULTICURVE}); |
254 | 42304 | fdiaz | geometryManager.registerGeometryType(DefaultMultiSurface.class, "MultiSurface", TYPES.MULTISURFACE, SUBTYPES.GEOM3DM, TYPES.AGGREGATE);
|
255 | 42315 | fdiaz | geometryManager.registerGeometryType(MultiPolygon3DM.class, "MultiPolygon3DM", TYPES.MULTIPOLYGON, SUBTYPES.GEOM3DM, new int[]{TYPES.AGGREGATE, TYPES.MULTISURFACE}); |
256 | 42267 | fdiaz | |
257 | 42260 | fdiaz | // Register solids
|
258 | // geometryManager.registerGeometryType(Solid2DZ.class, "Solid3D", TYPES.SOLID, SUBTYPES.GEOM3D);
|
||
259 | // geometryManager.registerGeometryType(MultiSolid2DZ.class, "MultiSolid3D", TYPES.MULTISOLID, SUBTYPES.GEOM3D,
|
||
260 | // TYPES.AGGREGATE);
|
||
261 | |||
262 | // Persistence
|
||
263 | DefaultEnvelope.registerPersistent(); |
||
264 | Envelope2D.registerPersistent(); |
||
265 | Envelope3D.registerPersistent(); |
||
266 | |||
267 | PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager(); |
||
268 | |||
269 | persistenceManager.registerFactory(new GeometryPersistenceFactory());
|
||
270 | persistenceManager.registerFactory(new GeometryTypePersistenceFactory());
|
||
271 | 42330 | fdiaz | |
272 | geometryManager.registerGeometryOperation(ToJTS.NAME, new ToJTS());
|
||
273 | geometryManager.registerGeometryOperation(FromJTS.NAME, new FromJTS());
|
||
274 | geometryManager.registerGeometryOperation(ToWKB.NAME, new ToWKB());
|
||
275 | geometryManager.registerGeometryOperation(FromWKB.NAME, new FromWKB());
|
||
276 | geometryManager.registerGeometryOperation(ToWKBNative.NAME, new ToWKBNative());
|
||
277 | geometryManager.registerGeometryOperation(ToWKT.NAME, new ToWKT());
|
||
278 | geometryManager.registerGeometryOperation(FromWKT.NAME, new FromWKT());
|
||
279 | 42260 | fdiaz | } |
280 | } |