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 @ 44669
History | View | Annotate | Download (18.3 KB)
1 |
/**
|
---|---|
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 |
import org.gvsig.fmap.geom.jts.aggregate.DefaultMultiCurve; |
34 |
import org.gvsig.fmap.geom.jts.aggregate.DefaultMultiSurface; |
35 |
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 |
import org.gvsig.fmap.geom.jts.aggregate.MultiPoint2D; |
40 |
import org.gvsig.fmap.geom.jts.aggregate.MultiPoint2DM; |
41 |
import org.gvsig.fmap.geom.jts.aggregate.MultiPoint3D; |
42 |
import org.gvsig.fmap.geom.jts.aggregate.MultiPoint3DM; |
43 |
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 |
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 |
import org.gvsig.fmap.geom.jts.operation.fromjts.FromJTS; |
52 |
import org.gvsig.fmap.geom.jts.operation.fromwkb.FromPostGISEWKB; |
53 |
import org.gvsig.fmap.geom.jts.operation.fromwkb.FromWKB; |
54 |
import org.gvsig.fmap.geom.jts.operation.fromwkt.FromWKT; |
55 |
import org.gvsig.fmap.geom.jts.operation.tojts.ToJTS; |
56 |
import org.gvsig.fmap.geom.jts.operation.towkb.ToPostGISEWKB; |
57 |
import org.gvsig.fmap.geom.jts.operation.towkb.ToOGCWKB; |
58 |
import org.gvsig.fmap.geom.jts.operation.towkt.ToWKT; |
59 |
import org.gvsig.fmap.geom.jts.persistence.GeometryPersistenceFactory; |
60 |
import org.gvsig.fmap.geom.jts.persistence.GeometryTypePersistenceFactory; |
61 |
import org.gvsig.fmap.geom.jts.primitive.DefaultEnvelope; |
62 |
import org.gvsig.fmap.geom.jts.primitive.DefaultNullGeometry; |
63 |
import org.gvsig.fmap.geom.jts.primitive.Envelope2D; |
64 |
import org.gvsig.fmap.geom.jts.primitive.Envelope3D; |
65 |
import org.gvsig.fmap.geom.jts.primitive.Geometry2D; |
66 |
import org.gvsig.fmap.geom.jts.primitive.Geometry2DM; |
67 |
import org.gvsig.fmap.geom.jts.primitive.Geometry3D; |
68 |
import org.gvsig.fmap.geom.jts.primitive.Geometry3DM; |
69 |
import org.gvsig.fmap.geom.jts.primitive.curve.arc.Arc2D; |
70 |
import org.gvsig.fmap.geom.jts.primitive.curve.arc.Arc2DZ; |
71 |
import org.gvsig.fmap.geom.jts.primitive.curve.circumference.Circumference2D; |
72 |
import org.gvsig.fmap.geom.jts.primitive.curve.circumference.Circumference2DZ; |
73 |
import org.gvsig.fmap.geom.jts.primitive.curve.line.Line2D; |
74 |
import org.gvsig.fmap.geom.jts.primitive.curve.line.Line2DM; |
75 |
import org.gvsig.fmap.geom.jts.primitive.curve.line.Line3D; |
76 |
import org.gvsig.fmap.geom.jts.primitive.curve.line.Line3DM; |
77 |
import org.gvsig.fmap.geom.jts.primitive.curve.periellipse.PeriEllipse2D; |
78 |
import org.gvsig.fmap.geom.jts.primitive.curve.periellipse.PeriEllipse2DZ; |
79 |
import org.gvsig.fmap.geom.jts.primitive.curve.spline.Spline2D; |
80 |
import org.gvsig.fmap.geom.jts.primitive.curve.spline.Spline2DM; |
81 |
import org.gvsig.fmap.geom.jts.primitive.curve.spline.Spline3D; |
82 |
import org.gvsig.fmap.geom.jts.primitive.curve.spline.Spline3DM; |
83 |
import org.gvsig.fmap.geom.jts.primitive.point.Point2DGeometryType; |
84 |
import org.gvsig.fmap.geom.jts.primitive.point.Point2DM; |
85 |
import org.gvsig.fmap.geom.jts.primitive.point.Point3DGeometryType; |
86 |
import org.gvsig.fmap.geom.jts.primitive.point.Point3DM; |
87 |
import org.gvsig.fmap.geom.jts.primitive.ring.Ring2D; |
88 |
import org.gvsig.fmap.geom.jts.primitive.ring.Ring2DM; |
89 |
import org.gvsig.fmap.geom.jts.primitive.ring.Ring3D; |
90 |
import org.gvsig.fmap.geom.jts.primitive.ring.Ring3DM; |
91 |
import org.gvsig.fmap.geom.jts.primitive.surface.circle.Circle2D; |
92 |
import org.gvsig.fmap.geom.jts.primitive.surface.circle.Circle2DZ; |
93 |
import org.gvsig.fmap.geom.jts.primitive.surface.ellipse.Ellipse2D; |
94 |
import org.gvsig.fmap.geom.jts.primitive.surface.ellipse.Ellipse2DZ; |
95 |
import org.gvsig.fmap.geom.jts.primitive.surface.ellipticarc.EllipticArc2D; |
96 |
import org.gvsig.fmap.geom.jts.primitive.surface.ellipticarc.EllipticArc2DZ; |
97 |
import org.gvsig.fmap.geom.jts.primitive.surface.filledspline.FilledSpline2D; |
98 |
import org.gvsig.fmap.geom.jts.primitive.surface.filledspline.FilledSpline2DM; |
99 |
import org.gvsig.fmap.geom.jts.primitive.surface.filledspline.FilledSpline3D; |
100 |
import org.gvsig.fmap.geom.jts.primitive.surface.filledspline.FilledSpline3DM; |
101 |
import org.gvsig.fmap.geom.jts.primitive.surface.polygon.Polygon2D; |
102 |
import org.gvsig.fmap.geom.jts.primitive.surface.polygon.Polygon2DM; |
103 |
import org.gvsig.fmap.geom.jts.primitive.surface.polygon.Polygon3D; |
104 |
import org.gvsig.fmap.geom.jts.primitive.surface.polygon.Polygon3DM; |
105 |
import org.gvsig.fmap.geom.operation.GeometryOperation; |
106 |
import org.gvsig.tools.ToolsLocator; |
107 |
import org.gvsig.tools.dataTypes.DataTypesManager; |
108 |
import org.gvsig.tools.library.AbstractLibrary; |
109 |
import org.gvsig.tools.library.LibraryException; |
110 |
import org.gvsig.tools.persistence.PersistenceManager; |
111 |
|
112 |
/**
|
113 |
* Registers the default implementation for {@link GeometryManager}
|
114 |
*
|
115 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
|
116 |
*/
|
117 |
public class DefaultGeometryLibrary extends AbstractLibrary { |
118 |
|
119 |
@Override
|
120 |
public void doRegistration() { |
121 |
registerAsImplementationOf(GeometryLibrary.class); |
122 |
} |
123 |
|
124 |
@Override
|
125 |
protected void doInitialize() throws LibraryException { |
126 |
// Register the default GeometryManager
|
127 |
GeometryLocator.registerGeometryManager(DefaultGeometryManager.class); |
128 |
} |
129 |
|
130 |
@Override
|
131 |
protected void doPostInitialize() throws LibraryException { |
132 |
|
133 |
GeometryManager geometryManager = GeometryLocator.getGeometryManager(); |
134 |
|
135 |
DataTypesManager dataTypesManager = ToolsLocator.getDataTypesManager(); |
136 |
|
137 |
dataTypesManager.addCoercion(DataTypes.GEOMETRY, new CoerceToGeometry());
|
138 |
dataTypesManager.addCoercion(DataTypes.ENVELOPE, new CoerceToEnvelope());
|
139 |
dataTypesManager.addCoercion(DataTypes.STRING, new CoerceToString());
|
140 |
dataTypesManager.addCoercion(DataTypes.BYTEARRAY,new CoerceToByteArray());
|
141 |
|
142 |
GeometryOperation.OPERATION_INTERSECTS_CODE = |
143 |
geometryManager.getGeometryOperationCode(GeometryOperation.OPERATION_INTERSECTS_NAME); |
144 |
|
145 |
GeometryOperation.OPERATION_CONTAINS_CODE = |
146 |
geometryManager.getGeometryOperationCode(GeometryOperation.OPERATION_CONTAINS_NAME); |
147 |
|
148 |
// Register the geometries in 2D
|
149 |
geometryManager.registerGeometryType(DefaultNullGeometry.class, "Null", TYPES.NULL, SUBTYPES.GEOM2D);
|
150 |
|
151 |
geometryManager.registerGeometryType(Geometry2D.class, "Geometry2D", TYPES.GEOMETRY, SUBTYPES.GEOM2D);
|
152 |
geometryManager.registerGeometryType(Geometry3D.class, "Geometry3D", TYPES.GEOMETRY, SUBTYPES.GEOM3D);
|
153 |
geometryManager.registerGeometryType(Geometry2DM.class, "Geometry2DM", TYPES.GEOMETRY, SUBTYPES.GEOM2DM);
|
154 |
geometryManager.registerGeometryType(Geometry3DM.class, "Geometry3DM", TYPES.GEOMETRY, SUBTYPES.GEOM3DM);
|
155 |
|
156 |
// Register points in 2D
|
157 |
geometryManager.registerGeometryType(new Point2DGeometryType());
|
158 |
// geometryManager.registerGeometryType(Point2D.class, "Point2D", TYPES.POINT, SUBTYPES.GEOM2D);
|
159 |
geometryManager.registerGeometryType(Point2DM.class, "Point2DM", TYPES.POINT, SUBTYPES.GEOM2DM);
|
160 |
|
161 |
// Register curves in 2D
|
162 |
geometryManager.registerGeometryType(Line2D.class, "Line2D", TYPES.LINE, SUBTYPES.GEOM2D, TYPES.CURVE); |
163 |
geometryManager.registerGeometryType(Line2D.class, "Curve2D", TYPES.CURVE, SUBTYPES.GEOM2D, TYPES.CURVE); |
164 |
geometryManager.registerGeometryType(Arc2D.class, "Arc2D", TYPES.ARC, SUBTYPES.GEOM2D, TYPES.CURVE); |
165 |
geometryManager.registerGeometryType(Spline2D.class, "Spline2D", TYPES.SPLINE, SUBTYPES.GEOM2D, TYPES.CURVE);
|
166 |
geometryManager.registerGeometryType(Circumference2D.class, "Circumference2D", TYPES.CIRCUMFERENCE, SUBTYPES.GEOM2D, TYPES.CURVE);
|
167 |
geometryManager.registerGeometryType(PeriEllipse2D.class, "PeriEllipse2D", TYPES.PERIELLIPSE, SUBTYPES.GEOM2D, TYPES.CURVE);
|
168 |
|
169 |
// Register surfaces in 2D
|
170 |
geometryManager.registerGeometryType(Polygon2D.class, "Polygon2D", TYPES.POLYGON, SUBTYPES.GEOM2D, TYPES.SURFACE);
|
171 |
geometryManager.registerGeometryType(Polygon2D.class, "Surface2D", TYPES.SURFACE, SUBTYPES.GEOM2D, TYPES.SURFACE);
|
172 |
|
173 |
geometryManager.registerGeometryType(Circle2D.class, "Circle2D", TYPES.CIRCLE, SUBTYPES.GEOM2D, TYPES.SURFACE);
|
174 |
geometryManager.registerGeometryType(Ellipse2D.class, "Ellipse2D", TYPES.ELLIPSE, SUBTYPES.GEOM2D, TYPES.SURFACE); |
175 |
geometryManager.registerGeometryType(Ring2D.class, "Ring2D", TYPES.RING, SUBTYPES.GEOM2D, TYPES.SURFACE);
|
176 |
geometryManager.registerGeometryType(FilledSpline2D.class, "FilledSpline2D", TYPES.FILLEDSPLINE, SUBTYPES.GEOM2D, TYPES.SURFACE);
|
177 |
geometryManager.registerGeometryType(EllipticArc2D.class, "EllipticArc2D", TYPES.ELLIPTICARC, SUBTYPES.GEOM2D, TYPES.SURFACE);
|
178 |
|
179 |
// Register curves in 2DM
|
180 |
geometryManager.registerGeometryType(Line2DM.class, "Line2DM", TYPES.LINE, SUBTYPES.GEOM2DM, TYPES.CURVE);
|
181 |
geometryManager.registerGeometryType(Line2DM.class, "Curve2DM", TYPES.CURVE, SUBTYPES.GEOM2DM, TYPES.CURVE);
|
182 |
geometryManager.registerGeometryType(Spline2DM.class, "Spline2DM", TYPES.SPLINE, SUBTYPES.GEOM2DM, TYPES.CURVE);
|
183 |
|
184 |
// Register surfaces in 2DM
|
185 |
geometryManager.registerGeometryType(Polygon2DM.class, "Polygon2DM", TYPES.POLYGON, SUBTYPES.GEOM2DM, TYPES.SURFACE);
|
186 |
geometryManager.registerGeometryType(Polygon2DM.class, "Surface2DM", TYPES.SURFACE, SUBTYPES.GEOM2DM, TYPES.SURFACE);
|
187 |
geometryManager.registerGeometryType(Ring2DM.class, "Ring2DM", TYPES.RING, SUBTYPES.GEOM2DM, TYPES.SURFACE);
|
188 |
geometryManager.registerGeometryType(FilledSpline2DM.class, "FilledSpline2DM", TYPES.FILLEDSPLINE, SUBTYPES.GEOM2DM, TYPES.SURFACE);
|
189 |
|
190 |
// Register multigeometries in 2D
|
191 |
// geometryManager.registerGeometryType(BaseMultiPrimitive2D.class, "MultiPrimitive2D", TYPES.AGGREGATE,
|
192 |
// SUBTYPES.GEOM2D);
|
193 |
geometryManager.registerGeometryType(MultiPoint2D.class, "MultiPoint2D", TYPES.MULTIPOINT, SUBTYPES.GEOM2D, TYPES.AGGREGATE);
|
194 |
geometryManager.registerGeometryType(DefaultMultiCurve.class, "MultiCurve", TYPES.MULTICURVE, SUBTYPES.GEOM2D, TYPES.AGGREGATE);
|
195 |
geometryManager.registerGeometryType(MultiLine2D.class, "MultiLine2D", TYPES.MULTILINE, SUBTYPES.GEOM2D, new int[]{TYPES.AGGREGATE, TYPES.MULTICURVE}); |
196 |
geometryManager.registerGeometryType(DefaultMultiSurface.class, "MultiSurface", TYPES.MULTISURFACE, SUBTYPES.GEOM2D, TYPES.AGGREGATE);
|
197 |
geometryManager.registerGeometryType(MultiPolygon2D.class, "MultiPolygon2D", TYPES.MULTIPOLYGON, SUBTYPES.GEOM2D, new int[]{TYPES.AGGREGATE, TYPES.MULTISURFACE}); |
198 |
|
199 |
// Register multigeometries in 2DM
|
200 |
geometryManager.registerGeometryType(MultiPoint2DM.class, "MultiPoint2DM", TYPES.MULTIPOINT, SUBTYPES.GEOM2DM, TYPES.AGGREGATE);
|
201 |
geometryManager.registerGeometryType(DefaultMultiCurve.class, "MultiCurve", TYPES.MULTICURVE, SUBTYPES.GEOM2DM, TYPES.AGGREGATE);
|
202 |
geometryManager.registerGeometryType(MultiLine2DM.class, "MultiLine2DM", TYPES.MULTILINE, SUBTYPES.GEOM2DM, new int[]{TYPES.AGGREGATE, TYPES.MULTICURVE}); |
203 |
geometryManager.registerGeometryType(DefaultMultiSurface.class, "MultiSurface", TYPES.MULTISURFACE, SUBTYPES.GEOM2DM, TYPES.AGGREGATE);
|
204 |
geometryManager.registerGeometryType(MultiPolygon2DM.class, "MultiPolygon2DM", TYPES.MULTIPOLYGON, SUBTYPES.GEOM2DM, new int[]{TYPES.AGGREGATE, TYPES.MULTISURFACE}); |
205 |
|
206 |
// Register the geometries in 3D
|
207 |
geometryManager.registerGeometryType(DefaultNullGeometry.class, TYPES.NULL, SUBTYPES.GEOM3D); |
208 |
|
209 |
// Register points in 3D
|
210 |
geometryManager.registerGeometryType(new Point3DGeometryType());
|
211 |
// geometryManager.registerGeometryType(Point3D.class, "Point3D", TYPES.POINT, SUBTYPES.GEOM3D);
|
212 |
geometryManager.registerGeometryType(Point3DM.class, "Point3DM", TYPES.POINT, SUBTYPES.GEOM3DM);
|
213 |
|
214 |
// Register curves in 3D
|
215 |
geometryManager.registerGeometryType(Line3D.class, "Line3D", TYPES.LINE, SUBTYPES.GEOM3D, TYPES.CURVE);
|
216 |
geometryManager.registerGeometryType(Line3D.class, "Curve3D", TYPES.CURVE, SUBTYPES.GEOM3D, TYPES.CURVE);
|
217 |
geometryManager.registerGeometryType(Arc2DZ.class, "Arc3D", TYPES.ARC, SUBTYPES.GEOM3D, TYPES.CURVE);
|
218 |
geometryManager.registerGeometryType(Spline3D.class, "Spline3D", TYPES.SPLINE, SUBTYPES.GEOM3D, TYPES.CURVE);
|
219 |
geometryManager.registerGeometryType(Circumference2DZ.class, "Circumference2DZ", TYPES.CIRCUMFERENCE, SUBTYPES.GEOM3D, TYPES.CURVE);
|
220 |
geometryManager.registerGeometryType(PeriEllipse2DZ.class, "PeriEllipse2DZ", TYPES.PERIELLIPSE, SUBTYPES.GEOM3D, TYPES.CURVE);
|
221 |
|
222 |
// Register surfaces in 3D
|
223 |
geometryManager.registerGeometryType(Polygon3D.class, "Polygon3D", TYPES.POLYGON, SUBTYPES.GEOM3D, TYPES.SURFACE);
|
224 |
geometryManager.registerGeometryType(Polygon3D.class, "Surface3D", TYPES.SURFACE, SUBTYPES.GEOM3D, TYPES.SURFACE);
|
225 |
geometryManager.registerGeometryType(Ring3D.class, "Ring3D", TYPES.RING, SUBTYPES.GEOM3D, TYPES.SURFACE);
|
226 |
geometryManager.registerGeometryType(FilledSpline3D.class, "FilledSpline3D", TYPES.FILLEDSPLINE, SUBTYPES.GEOM3D, TYPES.SURFACE);
|
227 |
|
228 |
geometryManager.registerGeometryType(Circle2DZ.class, "Circle2DZ", TYPES.CIRCLE, SUBTYPES.GEOM3D, TYPES.SURFACE);
|
229 |
geometryManager.registerGeometryType(Ellipse2DZ.class, "Ellipse2DZ", TYPES.ELLIPSE, SUBTYPES.GEOM3D, TYPES.SURFACE);
|
230 |
|
231 |
geometryManager.registerGeometryType(EllipticArc2DZ.class, "EllipticArc3D", TYPES.ELLIPTICARC, SUBTYPES.GEOM3D, TYPES.SURFACE);
|
232 |
|
233 |
// Register curves in 3DM
|
234 |
geometryManager.registerGeometryType(Line3DM.class, "Line3DM", TYPES.LINE, SUBTYPES.GEOM3DM, TYPES.CURVE);
|
235 |
geometryManager.registerGeometryType(Line3DM.class, "Curve3DM", TYPES.CURVE, SUBTYPES.GEOM3DM, TYPES.CURVE);
|
236 |
geometryManager.registerGeometryType(Spline3DM.class, "Spline3DM", TYPES.SPLINE, SUBTYPES.GEOM3DM, TYPES.CURVE);
|
237 |
|
238 |
// Register surfaces in 3DM
|
239 |
geometryManager.registerGeometryType(Polygon3DM.class, "Polygon3DM", TYPES.POLYGON, SUBTYPES.GEOM3DM, TYPES.SURFACE);
|
240 |
geometryManager.registerGeometryType(Polygon3DM.class, "Surface3DM", TYPES.SURFACE, SUBTYPES.GEOM3DM, TYPES.SURFACE);
|
241 |
geometryManager.registerGeometryType(Ring3DM.class, "Ring3DM", TYPES.RING, SUBTYPES.GEOM3DM, TYPES.SURFACE);
|
242 |
geometryManager.registerGeometryType(FilledSpline3DM.class, "FilledSpline3DM", TYPES.FILLEDSPLINE, SUBTYPES.GEOM3DM, TYPES.SURFACE);
|
243 |
|
244 |
|
245 |
// Register multigeometries in 3D
|
246 |
geometryManager.registerGeometryType(MultiPoint3D.class, "MultiPoint3D", TYPES.MULTIPOINT, SUBTYPES.GEOM3D, TYPES.AGGREGATE);
|
247 |
geometryManager.registerGeometryType(DefaultMultiCurve.class, "MultiCurve", TYPES.MULTICURVE, SUBTYPES.GEOM3D, TYPES.AGGREGATE);
|
248 |
geometryManager.registerGeometryType(MultiLine3D.class, "MultiLine3D", TYPES.MULTILINE, SUBTYPES.GEOM3D, new int[]{TYPES.AGGREGATE, TYPES.MULTICURVE}); |
249 |
geometryManager.registerGeometryType(DefaultMultiSurface.class, "MultiSurface", TYPES.MULTISURFACE, SUBTYPES.GEOM3D, TYPES.AGGREGATE);
|
250 |
geometryManager.registerGeometryType(MultiPolygon3D.class, "MultiPolygon3D", TYPES.MULTIPOLYGON, SUBTYPES.GEOM3D, new int[]{TYPES.AGGREGATE, TYPES.MULTISURFACE}); |
251 |
|
252 |
// Register multigeometries in 3DM
|
253 |
geometryManager.registerGeometryType(MultiPoint3DM.class, "MultiPoint3DM", TYPES.MULTIPOINT, SUBTYPES.GEOM3DM, TYPES.AGGREGATE);
|
254 |
geometryManager.registerGeometryType(DefaultMultiCurve.class, "MultiCurve", TYPES.MULTICURVE, SUBTYPES.GEOM3DM, TYPES.AGGREGATE);
|
255 |
geometryManager.registerGeometryType(MultiLine3DM.class, "MultiLine3DM", TYPES.MULTILINE, SUBTYPES.GEOM3DM, new int[]{TYPES.AGGREGATE, TYPES.MULTICURVE}); |
256 |
geometryManager.registerGeometryType(DefaultMultiSurface.class, "MultiSurface", TYPES.MULTISURFACE, SUBTYPES.GEOM3DM, TYPES.AGGREGATE);
|
257 |
geometryManager.registerGeometryType(MultiPolygon3DM.class, "MultiPolygon3DM", TYPES.MULTIPOLYGON, SUBTYPES.GEOM3DM, new int[]{TYPES.AGGREGATE, TYPES.MULTISURFACE}); |
258 |
|
259 |
// Register solids
|
260 |
// geometryManager.registerGeometryType(Solid2DZ.class, "Solid3D", TYPES.SOLID, SUBTYPES.GEOM3D);
|
261 |
// geometryManager.registerGeometryType(MultiSolid2DZ.class, "MultiSolid3D", TYPES.MULTISOLID, SUBTYPES.GEOM3D,
|
262 |
// TYPES.AGGREGATE);
|
263 |
|
264 |
// Persistence
|
265 |
DefaultEnvelope.registerPersistent(); |
266 |
Envelope2D.registerPersistent(); |
267 |
Envelope3D.registerPersistent(); |
268 |
|
269 |
PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager(); |
270 |
|
271 |
persistenceManager.registerFactory(new GeometryPersistenceFactory());
|
272 |
persistenceManager.registerFactory(new GeometryTypePersistenceFactory());
|
273 |
|
274 |
geometryManager.registerGeometryOperation(ToJTS.NAME, new ToJTS());
|
275 |
geometryManager.registerGeometryOperation(FromJTS.NAME, new FromJTS());
|
276 |
geometryManager.registerGeometryOperation(ToPostGISEWKB.NAME, new ToPostGISEWKB());
|
277 |
geometryManager.registerGeometryOperation(FromWKB.NAME, new FromWKB());
|
278 |
geometryManager.registerGeometryOperation(FromPostGISEWKB.NAME, new FromPostGISEWKB());
|
279 |
geometryManager.registerGeometryOperation(ToOGCWKB.NAME, new ToOGCWKB());
|
280 |
geometryManager.registerGeometryOperation(ToWKT.NAME, new ToWKT());
|
281 |
geometryManager.registerGeometryOperation(FromWKT.NAME, new FromWKT());
|
282 |
} |
283 |
} |