Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.geometry / org.gvsig.fmap.geometry.api / src / main / java / org / gvsig / fmap / geom / GeometryManager.java @ 43909

History | View | Annotate | Download (49.6 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
package org.gvsig.fmap.geom;
25

    
26
import java.awt.geom.PathIterator;
27
import java.util.List;
28
import org.cresques.cts.IProjection;
29

    
30
import org.gvsig.fmap.geom.aggregate.MultiCurve;
31
import org.gvsig.fmap.geom.aggregate.MultiLine;
32
import org.gvsig.fmap.geom.aggregate.MultiPoint;
33
import org.gvsig.fmap.geom.aggregate.MultiPolygon;
34
import org.gvsig.fmap.geom.aggregate.MultiPrimitive;
35
import org.gvsig.fmap.geom.aggregate.MultiSurface;
36
import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
37
import org.gvsig.fmap.geom.exception.CreateGeometryException;
38
import org.gvsig.fmap.geom.operation.GeometryOperation;
39
import org.gvsig.fmap.geom.operation.GeometryOperationContext;
40
import org.gvsig.fmap.geom.operation.GeometryOperationException;
41
import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
42
import org.gvsig.fmap.geom.primitive.Curve;
43
import org.gvsig.fmap.geom.primitive.Envelope;
44
import org.gvsig.fmap.geom.primitive.GeneralPathX;
45
import org.gvsig.fmap.geom.primitive.IGeneralPathX;
46
import org.gvsig.fmap.geom.primitive.Line;
47
import org.gvsig.fmap.geom.primitive.NullGeometry;
48
import org.gvsig.fmap.geom.primitive.OrientablePrimitive;
49
import org.gvsig.fmap.geom.primitive.Point;
50
import org.gvsig.fmap.geom.primitive.Polygon;
51
import org.gvsig.fmap.geom.primitive.Surface;
52
import org.gvsig.fmap.geom.type.GeometryType;
53
import org.gvsig.fmap.geom.type.GeometryTypeNotSupportedException;
54
import org.gvsig.fmap.geom.type.GeometryTypeNotValidException;
55
import org.gvsig.tools.dynobject.DynObject;
56
import org.gvsig.tools.service.Manager;
57
import org.gvsig.tools.service.ServiceException;
58
import org.gvsig.tools.service.spi.ServiceManager;
59

    
60
/**
61
 * This singleton provides a centralized access to gvSIG's Geometry Model.
62
 * Its responsibilities are:<br>
63
 *
64
 * <ul>
65
 * <li>Offering a set of convenient methods for registering and retrieving
66
 * geometry types.
67
 * <li>Offering a set of convenient methods for registering and retrieving
68
 * geometry operations associated to one or more geometry types.
69
 * <li>Offering a set of convenient methods for registering and retrieving new
70
 * geometries.
71
 * </ul>
72
 *
73
 * @author jiyarza
74
 * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
75
 */
76
public interface GeometryManager extends Manager, ServiceManager {
77

    
78
//    
79
//  Spatial index "Quadtree" is faster in creation but don't 
80
//  support of nearest query.
81
//    
82
//  Spatial index "RTree" is faster in queries and support 
83
//  nearest queries.
84
//  
85
//  The library expose a default implementation for RTree and QuadTree
86
//    
87
    public static final String SPATIALINDEX_DEFAULT_RTREE = "JSIRTree";
88
    public static final String SPATIALINDEX_DEFAULT_QUADTREE = "JTSQuadtree";
89
    
90
    
91
    public interface OPERATIONS {
92

    
93
        public final static String FROMWKT = "FromWKT";
94
        public final static String FROMWKB = "FromWKB";
95
        public final static String FROMEWKB = "FromEWKB";
96

    
97
        public final static String TOWKT = "ToWKT";
98
        public final static String TOWKB = "ToWKB";
99
        public final static String TOEWKB = "ToEWKB";
100
    }
101

    
102
    /**
103
     * <p>
104
     * Registers a GeometryOperation associated to a GeometryType. Returns an
105
     * unique index that is used later to identify and invoke the operation.
106
     * </p>
107
     * <p>
108
     * By convention this index should be in a final and static variable in the
109
     * class that implements the operation. The value of this variable must be
110
     * set using the method
111
     * {@link GeometryManager#getGeometryOperationCode(String)}:<BR>
112
     *
113
     * <pre>
114
     *
115
     * public class MyOperation extends GeometryOperation {
116
     *
117
     *     public static final int CODE = GeometryLocator.getGeometryManager()
118
     *         .getGeometryOperationCode(&quot;MyOperation&quot;);
119
     * }
120
     * </pre>
121
     *
122
     * </p>
123
     *
124
     * @param geomOpName
125
     *            Operation's unique name
126
     * @param geomOp
127
     *            Specific GeometryOperation's instance implementing this
128
     *            operation
129
     * @param geomType
130
     *            GeometryType instance to which this operation should be
131
     *            associated
132
     * @return Index assigned to this operation. This index is used later to
133
     *         access the operation.
134
     *
135
     */
136
    public int registerGeometryOperation(String geomOpName,
137
        GeometryOperation geomOp, GeometryType geomType);
138

    
139
    /**
140
     * <p>
141
     * Registers a GeometryOperation that is common for all GeometryType
142
     * (registered yet or not). Returns an unique index that is used later to
143
     * identify and invoke the operation.
144
     * </p>
145
     * <p>
146
     * By convention this index should be in a final and static variable in the
147
     * class that implements the operation. The value of this variable must be
148
     * set using the method
149
     * {@link GeometryManager#getGeometryOperationCode(String)}:<BR>
150
     *
151
     * <pre>
152
     *
153
     * public class MyOperation extends GeometryOperation {
154
     *
155
     *     public static final int CODE = GeometryLocator.getGeometryManager()
156
     *         .getGeometryOperationCode(&quot;MyOperation&quot;);
157
     * }
158
     * </pre>
159
     *
160
     * </p>
161
     *
162
     * @param geomOpName
163
     *            Operation's unique name
164
     * @param geomOp
165
     *            Specific GeometryOperation's instance implementing this
166
     *            operation
167
     * @return Index assigned to this operation. This index is used later to
168
     *         access the operation.
169
     */
170
    public int registerGeometryOperation(String geomOpName,
171
        GeometryOperation geomOp);
172

    
173
    /**
174
     * <p>
175
     * Registers a GeometryOperation associated to a GeometryType, that has been
176
     * specified using the type code and the subtype code. Returns an unique
177
     * index that is used later to identify and invoke the operation.
178
     * </p>
179
     * <p>
180
     * By convention this index should be in a final and static variable in the
181
     * class that implements the operation. The value of this variable must be
182
     * set using the method
183
     * {@link GeometryManager#getGeometryOperationCode(String)}:<BR>
184
     *
185
     * <pre>
186
     *
187
     * public class MyOperation extends GeometryOperation {
188
     *
189
     *     public static final int CODE = GeometryLocator.getGeometryManager()
190
     *         .getGeometryOperationCode(&quot;MyOperation&quot;);
191
     * }
192
     * </pre>
193
     *
194
     * </p>
195
     * <p>
196
     * This method is only used if you have not a reference to the GeometryType
197
     * associated to the geometry class. If you have such reference then it is
198
     * slightly faster to use the method that receives the GeometryType.<br>
199
     * </p>
200
     *
201
     * @param geomOpName
202
     *            Operation's unique name
203
     * @param geomOp
204
     *            Specific GeometryOperation's instance implementing this
205
     *            operation
206
     * @param type
207
     *            Type of geometry. Must be a value defined in
208
     *            {@link Geometry.TYPES}
209
     * @param subType
210
     *            SubType of geometry. Must be a value defined in
211
     *            {@link Geometry.SUBTYPES}
212
     * @return Index assigned to this operation. This index is used later to
213
     *         access the operation.
214
     * @throws GeometryTypeNotSupportedException
215
     *             Returns this exception if there is not a registered geometry
216
     *             with
217
     *             these type and subtype
218
     * @throws GeometryTypeNotValidException
219
     *             Returns if the type and subtype are not valid
220
     */
221
    public int registerGeometryOperation(String geomOpName,
222
        GeometryOperation geomOp, int type, int subType)
223
        throws GeometryTypeNotSupportedException, GeometryTypeNotValidException;
224

    
225
    /**
226
     * <p>
227
     * Registers a GeometryOperation associated to all the geometries with a
228
     * concrete type. Returns an unique index that is used later to identify and
229
     * invoke the operation.<br>
230
     * </p>
231
     * <p>
232
     * By convention this index should be in a final and static variable in the
233
     * class that implements the operation. The value of this variable must be
234
     * set using the method
235
     * {@link GeometryManager#getGeometryOperationCode(String)}:<BR>
236
     *
237
     * <pre>
238
     *
239
     * public class MyOperation extends GeometryOperation {
240
     *
241
     *     public static final int CODE = GeometryLocator.getGeometryManager()
242
     *         .getGeometryOperationCode(&quot;MyOperation&quot;);
243
     * }
244
     * </pre>
245
     *
246
     * </p>
247
     *
248
     * @param geomOpName
249
     *            Operation's unique name
250
     * @param geomOp
251
     *            Specific GeometryOperation's instance implementing this
252
     *            operation
253
     * @param type
254
     *            Type of geometry. Must be a value defined in
255
     *            {@link Geometry.TYPES}
256
     * @return Index assigned to this operation. This index is used later to
257
     *         access the operation.
258
     */
259
    public int registerGeometryOperation(String geomOpName,
260
        GeometryOperation geomOp, int type);
261

    
262
    /**
263
     * <p>
264
     * Registers a GeometryOperation associated to all the geometries which
265
     * super type matches with a concrete type. Returns an unique index that
266
     * is used later to identify and invoke the operation.<br>
267
     * </p>
268
     * <p>
269
     * By convention this index should be in a final and static variable in the
270
     * class that implements the operation. The value of this variable must be
271
     * set using the method
272
     * {@link GeometryManager#getGeometryOperationCode(String)}:<BR>
273
     *
274
     * <pre>
275
     *
276
     * public class MyOperation extends GeometryOperation {
277
     *
278
     *     public static final int CODE = GeometryLocator.getGeometryManager()
279
     *         .getGeometryOperationCode(&quot;MyOperation&quot;);
280
     * }
281
     * </pre>
282
     *
283
     * </p>
284
     *
285
     * @param geomOpName
286
     *            Operation's unique name
287
     * @param geomOp
288
     *            Specific GeometryOperation's instance implementing this
289
     *            operation
290
     * @param superType
291
     *            super type of geometries that is used to register
292
     *            the operation. Must be a value defined in
293
     *            {@link Geometry.TYPES}
294
     * @return Index assigned to this operation. This index is used later to
295
     *         access the operation.
296
     */
297
    public int registerGeometryOperationBySuperType(String geomOpName,
298
        GeometryOperation geomOp, int superType);
299

    
300
    /**
301
     * <p>
302
     * Registers a GeometryOperation associated to all the geometries which
303
     * super subType matches with a concrete subType. Returns an unique index that
304
     * is used later to identify and invoke the operation.<br>
305
     * </p>
306
     * <p>
307
     * By convention this index should be in a final and static variable in the
308
     * class that implements the operation. The value of this variable must be
309
     * set using the method
310
     * {@link GeometryManager#getGeometryOperationCode(String)}:<BR>
311
     *
312
     * <pre>
313
     *
314
     * public class MyOperation extends GeometryOperation {
315
     *
316
     *     public static final int CODE = GeometryLocator.getGeometryManager()
317
     *         .getGeometryOperationCode(&quot;MyOperation&quot;);
318
     * }
319
     * </pre>
320
     *
321
     * </p>
322
     *
323
     * @param geomOpName
324
     *            Operation's unique name
325
     * @param geomOp
326
     *            Specific GeometryOperation's instance implementing this
327
     *            operation
328
     * @param superSubType
329
     *            super subType of geometries that is used to register
330
     *            the operation. Must be a value defined in
331
     *            {@link Geometry.SUBTYPES}
332
     * @return Index assigned to this operation. This index is used later to
333
     *         access the operation.
334
     */
335
    public int registerGeometryOperationBySuperSubType(String geomOpName,
336
        GeometryOperation geomOp, int superSubType);
337

    
338
    /**
339
     * <p>
340
     * Registers a GeometryOperation associated to all the geometries with a
341
     * concrete subtype. Returns an unique index that is used later to identify
342
     * and invoke the operation.<br>
343
     * </p>
344
     * <p>
345
     * By convention this index should be in a final and static variable in the
346
     * class that implements the operation. The value of this variable must be
347
     * set using the method
348
     * {@link GeometryManager#getGeometryOperationCode(String)}:<BR>
349
     *
350
     * <pre>
351
     *
352
     * public class MyOperation extends GeometryOperation {
353
     *
354
     *     public static final int CODE = GeometryLocator.getGeometryManager()
355
     *         .getGeometryOperationCode(&quot;MyOperation&quot;);
356
     * }
357
     * </pre>
358
     *
359
     * </p>
360
     *
361
     * @param geomOpName
362
     *            Operation's unique name
363
     * @param geomOp
364
     *            Specific GeometryOperation's instance implementing this
365
     *            operation
366
     * @param subType
367
     *            SubType of geometry. Must be a value defined in
368
     *            {@link Geometry.SUBTYPES}
369
     * @return Index assigned to this operation. This index is used later to
370
     *         access the operation.
371
     */
372
    public int registerGeometryOperationBySubtype(String geomOpName,
373
        GeometryOperation geomOp, int subType);
374

    
375
    /**
376
     * <p>
377
     * Registers a GeometryType instance.
378
     * </p>
379
     *
380
     * @param geometryType
381
     *            A {@link GeometryType} instance to create {@link Geometry} objects
382
     */
383
    public void registerGeometryType(GeometryType geometryType);
384

    
385
    /**
386
     * <p>
387
     * Registers a Geometry implementation class with a predefined geometry type
388
     * and returns the associated GeometryType instance. Available predefined
389
     * types are defined in {@link Geometry.TYPES} and the subtypes are defined
390
     * in {@link Geometry.SUBTYPES}.
391
     * </p>
392
     * <p>
393
     * How to register a geometry class with a predefined type:
394
     *
395
     * <pre>
396
     *
397
     * GeometryType geomType = GeometryLocator.getGeometryManager()
398
     *     .registerBasicGeometryType(Point2D.class, &quot;Point2D&quot;, Geometry.TYPES.POINT,
399
     *         Geometry.SYBTYPES.GEOM2D);
400
     * </pre>
401
     *
402
     * </p>
403
     *
404
     * @param geomClass
405
     *            Geometry subclass. It must not be null and must implement
406
     *            Geometry, otherwise an exception
407
     *            is raised.
408
     * @param name
409
     *            Symbolic name for the geometry type, it can be null. If it is
410
     *            null then the symbolic name
411
     *            will be the simple class name.
412
     * @param type
413
     *            Type of geometry. Must be a value defined in
414
     *            {@link Geometry.TYPES}
415
     * @param subType
416
     *            SubType of geometry. Must be a value defined in
417
     *            {@link Geometry.SUBTYPES}
418
     * @return Instance of GeometryType associated to the Geometry
419
     *         implementation class
420
     *         geomClass
421
     * @throws IllegalArgumentException
422
     *             If geomClass is null or does not implement Geometry
423
     */
424
    public GeometryType registerGeometryType(Class geomClass, String name,
425
        int type, int subType);
426

    
427
    /**
428
     * <p>
429
     * Registers a Geometry implementation class with a predefined geometry type
430
     * and returns the associated GeometryType instance. Available predefined
431
     * types are defined in {@link Geometry.TYPES} and the subtypes are defined
432
     * in {@link Geometry.SUBTYPES}.
433
     * </p>
434
     * <p>
435
     * It adds also the super type and the super subType of the geometry, that
436
     * can be used to check if the type (or the subtype) inherits of other
437
     * type (or subType)
438
     * </p>
439
     * <p>
440
     * How to register a geometry class with a predefined type:
441
     *
442
     * <pre>
443
     *
444
     * GeometryType geomType = GeometryLocator.getGeometryManager()
445
     *     .registerBasicGeometryType(Arc3D.class, &quot;Arc3D&quot;, Geometry.TYPES.ARC,
446
     *         Geometry.SYBTYPES.GEOM3D, Geometry.TYPES.CURVE, Geometry.SYBTYPES.GEOM2D);
447
     * </pre>
448
     *
449
     * </p>
450
     *
451
     * @param geomClass
452
     *            Geometry subclass. It must not be null and must implement
453
     *            Geometry, otherwise an exception
454
     *            is raised.
455
     * @param name
456
     *            Symbolic name for the geometry type, it can be null. If it is
457
     *            null then the symbolic name
458
     *            will be the simple class name.
459
     * @param type
460
     *            Type of geometry. Must be a value defined in
461
     *            {@link Geometry.TYPES}
462
     * @param subType
463
     *            SubType of geometry. Must be a value defined in
464
     *            {@link Geometry.SUBTYPES}
465
     * @param superType
466
     *              Super type of a geometry. Must be a value defined in
467
     *            {@link Geometry.TYPES}
468
     * @param superSubType
469
     *             Super subType of a geometry. Must be a value defined in
470
     *            {@link Geometry.SUBTYPES}
471
     * @return Instance of GeometryType associated to the Geometry
472
     *         implementation class
473
     *         geomClass
474
     * @throws IllegalArgumentException
475
     *             If geomClass is null or does not implement Geometry
476
     */
477
    public GeometryType registerGeometryType(Class geomClass, String name,
478
        int type, int subType, int superType, int superSubType);
479

    
480
    /**
481
     * <p>
482
     * Registers a Geometry implementation class with a predefined geometry type
483
     * and returns the associated GeometryType instance. Available predefined
484
     * types are defined in {@link Geometry.TYPES} and the subtypes are defined
485
     * in {@link Geometry.SUBTYPES}.
486
     * </p>
487
     * <p>
488
     * It adds also the super type of the geometry, that can be used to
489
     * check if the type inherits of other type.
490
     * </p>
491
     * <p>
492
     * How to register a geometry class with a predefined type:
493
     *
494
     * <pre>
495
     *
496
     * GeometryType geomType = GeometryLocator.getGeometryManager()
497
     *     .registerBasicGeometryType(Arc3D.class, &quot;Arc3D&quot;, Geometry.TYPES.ARC,
498
     *         Geometry.SYBTYPES.GEOM3D, Geometry.TYPES.CURVE);
499
     * </pre>
500
     *
501
     * </p>
502
     *
503
     * @param geomClass
504
     *            Geometry subclass. It must not be null and must implement
505
     *            Geometry, otherwise an exception
506
     *            is raised.
507
     * @param name
508
     *            Symbolic name for the geometry type, it can be null. If it is
509
     *            null then the symbolic name
510
     *            will be the simple class name.
511
     * @param type
512
     *            Type of geometry. Must be a value defined in
513
     *            {@link Geometry.TYPES}
514
     * @param subType
515
     *            SubType of geometry. Must be a value defined in
516
     *            {@link Geometry.SUBTYPES}
517
     * @param superType
518
     *              Super type of a geometry. Must be a value defined in
519
     *            {@link Geometry.TYPES}
520
     * @return Instance of GeometryType associated to the Geometry
521
     *         implementation class
522
     *         geomClass
523
     * @throws IllegalArgumentException
524
     *             If geomClass is null or does not implement Geometry
525
     */
526
    public GeometryType registerGeometryType(Class geomClass, String name,
527
        int type, int subType, int superType);
528

    
529
    /**
530
     * <p>
531
     * Registers a Geometry implementation class with a predefined geometry type
532
     * and returns the associated GeometryType instance. Available predefined
533
     * types are defined in {@link Geometry.TYPES} and the subtypes are defined
534
     * in {@link Geometry.SUBTYPES}.
535
     * </p>
536
     * <p>
537
     * It adds also the super types and the super subTypes of the geometry, that
538
     * can be used to check if the type (or the subtype) inherits of other
539
     * types (or subTypes)
540
     * </p>
541
     * <p>
542
     * How to register a geometry class with a predefined type:
543
     *
544
     * <pre>
545
     *
546
     * GeometryType geomType = GeometryLocator.getGeometryManager()
547
     *     .registerBasicGeometryType(Circle3DM.class, &quot;Circle3DM&quot;, Geometry.TYPES.CIRCLE,
548
     *         Geometry.SYBTYPES.GEOM3DM,
549
     *         new int[]{Geometry.TYPES.CURVE, Geometry.TYPES.GEOMETRY},
550
     *         new int[]{Geometry.SYBTYPES.GEOM2D, Geometry.SYBTYPES.GEOM3D});
551
     * </pre>
552
     *
553
     * </p>
554
     *
555
     * @param geomClass
556
     *            Geometry subclass. It must not be null and must implement
557
     *            Geometry, otherwise an exception
558
     *            is raised.
559
     * @param name
560
     *            Symbolic name for the geometry type, it can be null. If it is
561
     *            null then the symbolic name
562
     *            will be the simple class name.
563
     * @param type
564
     *            Type of geometry. Must be a value defined in
565
     *            {@link Geometry.TYPES}
566
     * @param subType
567
     *            SubType of geometry. Must be a value defined in
568
     *            {@link Geometry.SUBTYPES}
569
     * @param superTypes
570
     *              List of the super types of a geometry. Must be a value defined in
571
     *            {@link Geometry.TYPES}
572
     * @param superSubTypes
573
     *             List of the super subType of a geometry. Must be a value defined in
574
     *            {@link Geometry.SUBTYPES}
575
     * @return Instance of GeometryType associated to the Geometry
576
     *         implementation class
577
     *         geomClass
578
     * @throws IllegalArgumentException
579
     *             If geomClass is null or does not implement Geometry
580
     */
581
    public GeometryType registerGeometryType(Class geomClass, String name,
582
        int type, int subType, int[] superTypes, int superSubTypes[]);
583

    
584
    /**
585
     * <p>
586
     * Registers a Geometry implementation class with a predefined geometry type
587
     * and returns the associated GeometryType instance. Available predefined
588
     * types are defined in {@link Geometry.TYPES} and the subtypes are defined
589
     * in {@link Geometry.SUBTYPES}.
590
     * </p>
591
     * <p>
592
     * It adds also the super types and the super subTypes of the geometry, that
593
     * can be used to check if the type inherits of other types.
594
     * </p>
595
     * <p>
596
     * How to register a geometry class with a predefined type:
597
     *
598
     * <pre>
599
     *
600
     * GeometryType geomType = GeometryLocator.getGeometryManager()
601
     *     .registerBasicGeometryType(Circle2D.class, &quot;Circle2DM&quot;, Geometry.TYPES.CIRCLE,
602
     *         Geometry.SYBTYPES.GEOM2D,
603
     *         new int[]{Geometry.TYPES.CURVE, Geometry.TYPES.SURFACE});
604
     * </pre>
605
     *
606
     * </p>
607
     *
608
     * @param geomClass
609
     *            Geometry subclass. It must not be null and must implement
610
     *            Geometry, otherwise an exception
611
     *            is raised.
612
     * @param name
613
     *            Symbolic name for the geometry type, it can be null. If it is
614
     *            null then the symbolic name
615
     *            will be the simple class name.
616
     * @param type
617
     *            Type of geometry. Must be a value defined in
618
     *            {@link Geometry.TYPES}
619
     * @param subType
620
     *            SubType of geometry. Must be a value defined in
621
     *            {@link Geometry.SUBTYPES}
622
     * @param superTypes
623
     *              List of the super types of a geometry. Must be a value defined in
624
     *            {@link Geometry.TYPES}
625
     * @return Instance of GeometryType associated to the Geometry
626
     *         implementation class
627
     *         geomClass
628
     * @throws IllegalArgumentException
629
     *             If geomClass is null or does not implement Geometry
630
     */
631
    public GeometryType registerGeometryType(Class geomClass, String name,
632
        int type, int subType, int[] superTypes);
633

    
634
    /**
635
     * <p>
636
     * Registers a Geometry implementation class with a predefined geometry type
637
     * and returns the associated GeometryType instance. Available predefined
638
     * types are defined in {@link Geometry.TYPES} and the subtypes are defined
639
     * in {@link Geometry.SUBTYPES}.
640
     * </p>
641
     * <p>
642
     * In this case the symbolic name will be the geometry's simple class name
643
     * </p>
644
     * How to register a new geometry type:
645
     *
646
     * <pre>
647
     *
648
     * GeometryType geomType = GeometryLocator.getGeometryManager()
649
     *     .registerBasicGeometryType(Point2D.class, Geometry.TYPES.POINT,
650
     *         Geometry.SYBTYPES.GEOM2D);
651
     * </pre>
652
     *
653
     * @param geomClass
654
     *            Geometry implementation class. It must not be null and must
655
     *            implement Geometry,
656
     *            otherwise an exception is thrown.
657
     * @param type
658
     *            Type of geometry. Must be a value defined in
659
     *            {@link Geometry.TYPES}
660
     * @param subType
661
     *            SubType of geometry. Must be a value defined in
662
     *            {@link Geometry.SUBTYPES}
663
     * @return Instance of GeometryType associated to the Geometry
664
     *         implementation class
665
     * @throws IllegalArgumentException
666
     *             If geomClass is null or does not implement Geometry
667
     */
668
    public GeometryType registerGeometryType(Class geomClass, int type,
669
        int subType);
670

    
671
    /**
672
     * <p>
673
     * Returns an instance of GeometryType given the Geometry type and the
674
     * subtype.
675
     * </p>
676
     *
677
     * @param type
678
     *            Type of geometry. Must be a value defined in
679
     *            {@link Geometry.TYPES}
680
     * @param subType
681
     *            SubType of geometry. Must be a value defined in
682
     *            {@link Geometry.SUBTYPES}
683
     * @return Instance of GeometryType associated to the type and the subtype
684
     * @throws GeometryTypeNotSupportedException
685
     *             Returns this exception if there is not a registered geometry
686
     *             with
687
     *             these type and subtype
688
     * @throws GeometryTypeNotValidException
689
     *             Returns if the type and subtype are not valid
690
     */
691
    public GeometryType getGeometryType(int type, int subType)
692
        throws GeometryTypeNotSupportedException, GeometryTypeNotValidException;
693

    
694
    /**
695
     * <p>
696
     * This method creates a {@link Geometry} with the type specified by this
697
     * GeometryType. The geometry is empty, and all the internal attributes must
698
     * be assigned to a value when the geometry has been created.
699
     * </p>
700
     * <p>
701
     * This example creates a point2D and sets the coordinates to 1,1:
702
     *
703
     * <pre>
704
     * Point point =
705
     *     (Point) GeometryLocator.getGeometryManager().create(GEOMETRY.TYPES.POINT,
706
     *         GEOMETRY.SUBTYPES.GEOM2D);
707
     * point.setX(1);
708
     * point.setY(1);
709
     * </pre>
710
     *
711
     * </p>
712
     *
713
     * @param geomType
714
     *            The geometry type
715
     * @return
716
     *         A instance of a geometry.
717
     * @throws CreateGeometryException
718
     *             This exception is thrown when the manager can not create
719
     *             the geometry.
720
     */
721
    public Geometry create(GeometryType geomType)
722
        throws CreateGeometryException;
723

    
724
    /**
725
     * <p>
726
     * Creates a Envelope with a concrete subtype. The envelope is empty and it
727
     * have to be filled with the corners once has been created.
728
     * </p>
729
     *
730
     * @param subType
731
     *            SubType of envelope. Must be a value defined in
732
     *            {@link Geometry.SUBTYPES}
733
     * @return
734
     *         A Envelope
735
     * @throws CreateEnvelopeException
736
     *             If it is not possible to create the envelope.
737
     */
738
    public Envelope createEnvelope(int subType) throws CreateEnvelopeException;
739

    
740
    /**
741
     * <p>
742
     * Creates a Envelope with a concrete subtype. It sets the values for the
743
     * lower corner and the upper corner (in 2D) using the method parameters.
744
     * </p>
745
     *
746
     * @param minX
747
     *            The minimum value for the X coordinate.
748
     * @param minY
749
     *            The minimum value for the Y coordinate.
750
     * @param maxX
751
     *            The maximum value for the X coordinate.
752
     * @param maxY
753
     *            The maximum value for the Y coordinate.
754
     * @param subType
755
     *            SubType of envelope. Must be a value defined in
756
     *            {@link Geometry.SUBTYPES}
757
     * @return
758
     * @throws CreateEnvelopeException
759
     */
760
    public Envelope createEnvelope(double minX, double minY, double maxX,
761
        double maxY, int subType) throws CreateEnvelopeException;
762

    
763
    /**
764
     * <p>
765
     * This method creates a {@link Geometry} with the type specified by this
766
     * name. If a geometry with this name doesn't exist, a
767
     * {@link IllegalArgumentException} is thrown. The geometry is empty, and
768
     * all the internal attributes must be assigned to a value when the geometry
769
     * has been created.
770
     * </p>
771
     * <p>
772
     * This example creates a point2D and sets the coordinates to 1,1: It
773
     * supposes that there is a Point2D class with name "Point2D".
774
     * </p>
775
     *
776
     * <pre>
777
     * Point point = (Point) GeometryLocator.getGeometryManager().create(&quot;Point2D&quot;);
778
     * point.setX(1);
779
     * point.setY(1);
780
     * </pre>
781
     *
782
     * @param name
783
     *            The name of the geometry type
784
     * @return
785
     *         A instance of a geometry.
786
     * @throws CreateGeometryException
787
     *             This exception is thrown when the manager can not create
788
     *             the geometry.
789
     */
790
    public Geometry create(String name) throws CreateGeometryException;
791

    
792
    /**
793
     * 
794
     * @param data
795
     * @return
796
     * @throws CreateGeometryException
797
     * @throws GeometryException 
798
     */
799
    public Geometry createFrom(Object data)
800
        throws CreateGeometryException, GeometryException;
801

    
802
    /**
803
     * Create a geometry from a WKT definition.
804
     *
805
     * This is a utility method to wrap the invocation to the operation
806
     * {@link OPERATIONS#FROMWKT}.
807
     *
808
     * @param wkt
809
     *            geometry in Well-known text format
810
     *
811
     * @return the geometry as a Geometry
812
     *
813
     * @throws CreateGeometryException
814
     * @throws GeometryException
815
     */
816
    public Geometry createFrom(String wkt, String srs)
817
        throws CreateGeometryException, GeometryException;
818

    
819
    public Geometry createFrom(String wkt, IProjection srs)
820
        throws CreateGeometryException, GeometryException;
821

    
822
    public Geometry createFrom(String wkt) throws CreateGeometryException,
823
        GeometryException;
824

    
825
    /**
826
     * Create a geometry from a WKB definition.
827
     *
828
     * This is a utility method to wrap the invocation to the operation
829
     * {@link OPERATIONS#FROMWKB}.
830
     *
831
     * @param wkb
832
     *            geometry in well-known binary format
833
     *
834
     * @return the geometry as a Geometry
835
     *
836
     * @throws CreateGeometryException
837
     * @throws GeometryException
838
     */
839
    public Geometry createFrom(byte[] wkb) throws CreateGeometryException,
840
        GeometryException;
841

    
842
    public Geometry createFrom(byte[] wkb, IProjection srs) throws CreateGeometryException,
843
        GeometryException;
844
    
845
    /**
846
     * <p>
847
     * This method creates a {@link Geometry} with a concrete type and subtype.
848
     * The geometry is empty, and all the internal attributes must be assigned
849
     * to a value when the geometry has been created.
850
     * </p>
851
     * <p>
852
     * This example creates a point2D and sets the coordinates to 1,1. It
853
     * supposes that there is a Point2D class with the id 1.
854
     * </p>
855
     *
856
     * <pre>
857
     * Point point =
858
     *     (Point) GeometryLocator.getGeometryManager().create(Geometry.TYPES.POINT,
859
     *         Geometry.SYBTYPES.GEOM2D);
860
     * point.setX(1);
861
     * point.setY(1);
862
     * </pre>
863
     *
864
     * @param type
865
     *            Type of geometry. Must be a value defined in
866
     *            {@link Geometry.TYPES}
867
     * @param subType
868
     *            SubType of geometry. Must be a value defined in
869
     *            {@link Geometry.SUBTYPES}
870
     * @return
871
     *         A instance of a geometry.
872
     * @throws CreateGeometryException
873
     *             This exception is thrown when the manager can not create
874
     *             the geometry.
875
     */
876
    public Geometry create(int type, int subType)
877
        throws CreateGeometryException;
878

    
879
    /**
880
     * <p>
881
     * It creates a null geometry with a concrete subtype.
882
     * <p>
883
     *
884
     * @param subType
885
     *            SubType of geometry. Must be a value defined in
886
     *            {@link Geometry.SUBTYPES}
887
     * @return
888
     *         A NullGeometry
889
     * @throws CreateGeometryException
890
     *             This exception is thrown when the manager can not create
891
     *             the geometry.
892
     * @deprecated use null instead. This method can be removed in next revisions
893
     */
894
    public NullGeometry createNullGeometry(int subType)
895
        throws CreateGeometryException;
896

    
897
    /**
898
     * <p>
899
     * Create a new point with a concrete type and sets the value for the X and
900
     * the Y.
901
     * </p>
902
     *
903
     * @param x
904
     *            The X coordinate
905
     * @param y
906
     *            The y coordinate
907
     * @param subType
908
     *            SubType of geometry. Must be a value defined in
909
     *            {@link Geometry.SUBTYPES}
910
     * @throws CreateGeometryException
911
     *             This exception is thrown when the manager can not create
912
     *             the geometry.
913
     * @return
914
     *         The Point
915
     */
916
    public Point createPoint(double x, double y, int subType)
917
        throws CreateGeometryException;
918

    
919
    /**
920
     * Create a new line with a concrete type. Use later addVertex to add
921
     * vertex to te line.
922
     *
923
     * @param subType SubType of geometry. Must be a value defined in {@link Geometry.SUBTYPES}
924
     * @return a line
925
     * @throws CreateGeometryException
926
     *             This exception is thrown when the manager can not create
927
     *             the geometry.
928
     */
929
    public Line createLine(int subType) throws CreateGeometryException;
930

    
931
    /**
932
     * @deprecated use createLine
933
     */
934
    public Curve createCurve(int subType) throws CreateGeometryException;
935

    
936
    /**
937
     * Create a new polygon with a concrete type.
938
     * Use later addVertex to add vertex to te polygon.
939
     *
940
     * @param subType
941
     *            SubType of geometry. Must be a value defined in
942
     *            {@link Geometry.SUBTYPES}
943
     * @return
944
     *         A polygon
945
     * @throws CreateGeometryException
946
     *             This exception is thrown when the manager can not create
947
     *             the geometry.
948
     */
949
    public Polygon createPolygon(int subType)
950
        throws CreateGeometryException;
951

    
952
    /**
953
     * @deprecated use createPolygon
954
     */
955
    public Surface createSurface(int subType)
956
        throws CreateGeometryException;
957

    
958
    /**
959
     * Create a new multipoint with a concrete subtype.
960
     * Use addPrimitive to populate the multipoint.
961
     *
962
     * @param subType
963
     *            SubType of geometry. Must be a value defined in
964
     *            {@link Geometry.SUBTYPES}
965
     * @return A multipoint
966
     * @throws CreateGeometryException
967
     *             This exception is thrown when the manager can not create the
968
     *             geometry.
969
     */
970
    public MultiPoint createMultiPoint(int subType)
971
        throws CreateGeometryException;
972

    
973
    /**
974
     * Create a new multicurve with a concrete subtype.
975
     * Use addPrimitive to populate the multicurve.
976
     *
977
     * @param subType
978
     *            SubType of geometry. Must be a value defined in
979
     *            {@link Geometry.SUBTYPES}
980
     * @return A multicurve
981
     * @throws CreateGeometryException
982
     *             This exception is thrown when the manager can not create the
983
     *             geometry.
984
     */
985
    public MultiCurve createMultiCurve(int subType) throws CreateGeometryException;
986

    
987
    public MultiLine createMultiLine(int subType) throws CreateGeometryException;
988

    
989
    /**
990
     * Create a new multisurface with a concrete subtype.
991
     * Use later addPrimitive to populate.
992
     *
993
     * @param subType
994
     *            SubType of geometry. Must be a value defined in
995
     *            {@link Geometry.SUBTYPES}
996
     * @return A multisurface
997
     * @throws CreateGeometryException
998
     *             This exception is thrown when the manager can not create the
999
     *             geometry.
1000
     */
1001
    public MultiSurface createMultiSurface(int subType) throws CreateGeometryException;
1002

    
1003
    public MultiPolygon createMultiPolygon(int subType) throws CreateGeometryException;
1004

    
1005
    /**
1006
     * <p>
1007
     * Returns an operation given the Geometry type, the Geometry subtype and
1008
     * and the operation code. If opCode corresponds to a common operation (a
1009
     * common operation is an operation registered for all geometries), then
1010
     * this method returns the common operation.
1011
     * </p>
1012
     * <p>
1013
     * For better performance, if you need to call an operation multiple times,
1014
     * use this method only once and keep the returned object in a local
1015
     * variable over which you can iterate. For instance:
1016
     *
1017
     * <pre>
1018
     * // Get the operation you need
1019
     * GeometryManager gm = GeometryLocator.getGeometryManager()
1020
     * GeometryOperation geomOp = null;
1021
     * try {
1022
     *    geomOp = gm.getGeometryOperation(Draw2D.CODE, Geometry.TYPES.POINT,
1023
     *    Geometry.SUBTYPES.GEOM2D);
1024
     * } catch (GeometryTypeNotSupportedException gtnse) {
1025
     *    // treat exception
1026
     * } catch (GeometryOperationNotSupportedException gonse) {
1027
     *    // treat exception
1028
     * }
1029
     *
1030
     *  // Fill the operation context with required params
1031
     * GeometryOperationContext ctx = new GeometryOperationContext();
1032
     *
1033
     *  // Here is the main loop where you call the operation
1034
     * for (int i=0; i<myGeometries.length; i++) {
1035
     *    Object result = geomOp.invoke(myGeometries[i], ctx);
1036
     * }
1037
     * </pre>
1038
     *
1039
     * </p>
1040
     *
1041
     * @param opCode
1042
     *            The operation code
1043
     * @param type
1044
     *            Type of geometry. Must be a value defined in
1045
     *            {@link Geometry.TYPES}
1046
     * @param subType
1047
     *            SubType of geometry. Must be a value defined in
1048
     *            {@link Geometry.SUBTYPES}
1049
     * @return Geometry operation
1050
     * @throws GeometryTypeNotSupportedException
1051
     *             Returns this exception if there is not a registered geometry
1052
     *             with
1053
     *             these type and subtype
1054
     * @throws GeometryTypeNotValidException
1055
     *             Returns this exception if the type and subtype are not valid
1056
     * @throws GeometryOperationNotSupportedException
1057
     *             Returns this exception if there is not a registered operation
1058
     *             with
1059
     *             this operation code
1060
     */
1061
    public GeometryOperation getGeometryOperation(int opCode, int type,
1062
        int subType) throws GeometryTypeNotSupportedException,
1063
        GeometryOperationNotSupportedException, GeometryTypeNotValidException;
1064

    
1065
    /**
1066
     * <p>
1067
     * Returns an common operation with given operation code. A common operation
1068
     * is an operation registered for all geometries.
1069
     * </p>
1070
     * <p>
1071
     * For better performance, if you need to call an operation multiple times,
1072
     * use this method only once and keep the returned object in a local
1073
     * variable over which you can iterate. For instance:
1074
     *
1075
     * <pre>
1076
     * // Get the operation you need
1077
     * GeometryManager gm = GeometryLocator.getGeometryManager()
1078
     * GeometryOperation geomOp = null;
1079
     * try {
1080
     *    geomOp = gm.getGeometryOperation(FromWKB.CODE);
1081
     * } catch (GeometryOperationNotSupportedException gonse) {
1082
     *    // treat exception
1083
     * }
1084
     *
1085
     *  // Fill the operation context with required params
1086
     * FromWKBGeometryOperationContext ctx = new FromWKBGeometryOperationContext();
1087
     *
1088
     *  // Here is the main loop where you call the operation
1089
     * for (int i=0; i<myGeometriesWKB.length; i++) {
1090
     *    ctx.setData(myGeometriesWKB[i]);
1091
     *    Object result = geomOp.invoke(null, ctx);
1092
     * }
1093
     * </pre>
1094
     *
1095
     * </p>
1096
     *
1097
     * @param opCode
1098
     *            The operation code
1099
     * @return Geometry operation
1100
     * @throws GeometryOperationNotSupportedException
1101
     *             Returns this exception if there is not a registered operation
1102
     *             with
1103
     *             this operation code
1104
     */
1105
    public GeometryOperation getGeometryOperation(int opCode)
1106
        throws GeometryOperationNotSupportedException;
1107

    
1108
    /**
1109
     * <p>
1110
     * Invokes an operation given its code, the geometry and the operation
1111
     * context holding the parameters required for the operation.
1112
     * </p>
1113
     *
1114
     * @param opCode
1115
     *            Operation code.
1116
     * @param geom
1117
     *            Geometry to which apply the operation
1118
     * @param ctx
1119
     *            Context holding the operation parameters
1120
     * @return
1121
     *         The object returned by an operation, depends on each operation.
1122
     */
1123
    public Object invokeOperation(int opCode, Geometry geom,
1124
        GeometryOperationContext ctx)
1125
        throws GeometryOperationNotSupportedException,
1126
        GeometryOperationException;
1127

    
1128
    /**
1129
     * <p>
1130
     * Invokes an operation given its code, the geometry and the operation
1131
     * context holding the parameters required for the operation.
1132
     * </p>
1133
     *
1134
     * @param geomOpName
1135
     *            Operation name.
1136
     * @param geom
1137
     *            Geometry to which apply the operation
1138
     * @param ctx
1139
     *            Context holding the operation parameters
1140
     * @return
1141
     *         The object returned by an operation, depends on each operation.
1142
     */
1143
    public Object invokeOperation(String geomOpName, Geometry geom,
1144
        GeometryOperationContext ctx)
1145
        throws GeometryOperationNotSupportedException,
1146
        GeometryOperationException;
1147

    
1148
    /**
1149
     * <p>
1150
     * Invokes an operation given its code, and the operation context holding
1151
     * the parameters required for the operation.
1152
     * </p>
1153
     *
1154
     * @param geomOpName
1155
     *            Operation name.
1156
     * @param ctx
1157
     *            Context holding the operation parameters
1158
     * @return
1159
     *         The object returned by an operation, depends on each operation.
1160
     */
1161
    public Object invokeOperation(String geomOpName,
1162
        GeometryOperationContext ctx)
1163
        throws GeometryOperationNotSupportedException,
1164
        GeometryOperationException;
1165

    
1166
    /**
1167
     * <p>
1168
     * Registers the unique name of one operation. If it already exists then
1169
     * this method does nothing but returning the name's corresponding index.
1170
     * </p>
1171
     * <p>
1172
     * By convention this method is used to set the value of the final and
1173
     * static variable that is located in the classes that implements the
1174
     * operation:<BR>
1175
     *
1176
     * <pre>
1177
     *
1178
     * public class MyOperation extends GeometryOperation {
1179
     *
1180
     *     public static final int CODE = GeometryLocator.getGeometryManager()
1181
     *         .getGeometryOperationCode(&quot;MyOperation&quot;);
1182
     * }
1183
     * </pre>
1184
     *
1185
     * </p>
1186
     *
1187
     * @param geomOpName
1188
     *            Name used to register the geometry operation
1189
     * @return
1190
     *         Index assigned to the operation name passed as parameter
1191
     */
1192
    public int getGeometryOperationCode(String geomOpName);
1193

    
1194
    /**
1195
     * Returns a list with the name of the operations that have been
1196
     * registered.
1197
     *
1198
     * @return
1199
     *         A list of the registered operations.
1200
     */
1201
    public List getGeometryOperationNames();
1202

    
1203
    /**
1204
     * Returns the flatness used to convert a curve is a set
1205
     * of points.
1206
     *
1207
     * @return
1208
     *         The flatness.
1209
     */
1210
    public double getFlatness();
1211

    
1212
    /**
1213
     * Sets the application flatness.
1214
     *
1215
     * @param flatness
1216
     *            The flatness to set
1217
     */
1218
    public void setFlatness(double flatness);
1219

    
1220
    /**
1221
     * Create a memory spatial index with the default implementation.
1222
     *
1223
     * @return a new SpatialIndex
1224
     */
1225
    public SpatialIndex createDefaultMemorySpatialIndex() throws ServiceException;
1226

    
1227

    
1228
    /**
1229
     * Create a spatial index with the implementation specified as name.
1230
     * If the creation of index don't requery parameters can be passed a null.
1231
     *
1232
     * @param name of the type of spatial index to create
1233
     * @param parameters used to create the index or null.
1234
     * @return the new SpatialIndex or null if not exists the type of index.
1235
     * @throws GeometryException
1236
     */
1237
    public SpatialIndex createSpatialIndex(String name, DynObject parameters) throws ServiceException;
1238

    
1239
    /**
1240
     * Return the name of the factory of the spatial index required.
1241
     *
1242
     * @param name of the spatial index factory
1243
     * @return the SpatialIndexFactory required or null if not exists
1244
     */
1245
    public SpatialIndexFactory getSpatialIndexFactory(String name);
1246

    
1247
    /**
1248
     * Create a GeneralPathX to populate a geometry.
1249
     * This method is deprecated, instead use OrientablePrimitive#addVertex(Point) to add vertex to
1250
     * primitive geometries or {@link MultiPrimitive#addPrimitive(org.gvsig.fmap.geom.primitive.Primitive)} to add geometries to an aggregate.
1251
     *
1252
     * @param rule
1253
     * @param pathIterator , can be null
1254
     * @return a GeneralPathX
1255
     * @deprecated use method of Geometry to handle this
1256
     * @see OrientablePrimitive#addVertex(Point) or {@link MultiPrimitive#addPrimitive(org.gvsig.fmap.geom.primitive.Primitive)}
1257
     *
1258
     */
1259
    public IGeneralPathX createGeneralPath(int rule, PathIterator pathIterator);
1260

    
1261
        /**
1262
         * <p>
1263
         * Create a new curve with a concrete type and sets the value for the
1264
         * coordinates using a GeneralPathX.
1265
         * </p>
1266
         *
1267
         * @param generalPathX
1268
         *            It is used to set the values for the X and Y coordinates.
1269
         * @param subType
1270
         *            SubType of geometry. Must be a value defined in
1271
         *            {@link Geometry.SUBTYPES}
1272
         * @return
1273
         *         A curve
1274
         * @throws CreateGeometryException
1275
         *             This exception is thrown when the manager can not create
1276
         *             the geometry.
1277
         * @deprecated use {@link #createCurve(int)} and OrientablePrimitive#addVertex(Point)
1278
         */
1279
        public Curve createCurve(GeneralPathX generalPathX, int subType)
1280
            throws CreateGeometryException;
1281

    
1282
         /**
1283
     * <p>
1284
     * Create a new multipoint with a concrete type and sets the value for the
1285
     * coordinates using a GeneralPathX.
1286
     * </p>
1287
     *
1288
     * @param generalPathX
1289
     *            It is used to set the values for the X and Y coordinates.
1290
     * @param subType
1291
     *            SubType of geometry. Must be a value defined in
1292
     *            {@link Geometry.SUBTYPES}
1293
     * @return A multipoint
1294
     * @throws CreateGeometryException
1295
     *             This exception is thrown when the manager can not create the
1296
     *             geometry.
1297
     * @deprecated use {@link #createMultiCurve(int)} and {@link MultiPrimitive#addPrimitive(org.gvsig.fmap.geom.primitive.Primitive)}
1298
     */
1299
    public MultiPoint createMultiPoint(GeneralPathX generalPathX, int subType)
1300
            throws CreateGeometryException;
1301
        /**
1302
         * <p>
1303
         * Create a new multicurve with a concrete type and sets the value for the
1304
         * coordinates using a GeneralPathX.
1305
         * </p>
1306
         *
1307
         * @param generalPathX
1308
         *            It is used to set the values for the X and Y coordinates.
1309
         * @param subType
1310
         *            SubType of geometry. Must be a value defined in
1311
         *            {@link Geometry.SUBTYPES}
1312
         * @return A multicurve
1313
         * @throws CreateGeometryException
1314
         *             This exception is thrown when the manager can not create the
1315
         *             geometry.
1316
         * @deprecated use {@link #createMultiCurve(int)} and {@link MultiPrimitive#addPrimitive(org.gvsig.fmap.geom.primitive.Primitive)}
1317
         */
1318
        public MultiCurve createMultiCurve(GeneralPathX generalPathX, int subType)
1319
                throws CreateGeometryException;
1320

    
1321
        /**
1322
         * <p>
1323
         * Create a new surface with a concrete type and sets the value for the
1324
         * coordinates using a GeneralPathX.
1325
         * </p>
1326
         *
1327
         * @param generalPathX
1328
         *            It is used to set the values for the X and Y coordinates.
1329
         * @param subType
1330
         *            SubType of geometry. Must be a value defined in
1331
         *            {@link Geometry.SUBTYPES}
1332
         * @return
1333
         *         A surface
1334
         * @throws CreateGeometryException
1335
         *             This exception is thrown when the manager can not create
1336
         *             the geometry.
1337
         * @deprecated use {@link #createSurface(int)} and OrientablePrimitive#addVertex(Point)
1338
         */
1339
        public Surface createSurface(GeneralPathX generalPathX, int subType)
1340
            throws CreateGeometryException;
1341

    
1342
        /**
1343
         * <p>
1344
         * Create a new multisurface with a concrete type and sets the value for the
1345
         * coordinates using a GeneralPathX.
1346
         * </p>
1347
         *
1348
         * @param generalPathX
1349
         *            It is used to set the values for the X and Y coordinates.
1350
         * @param subType
1351
         *            SubType of geometry. Must be a value defined in
1352
         *            {@link Geometry.SUBTYPES}
1353
         * @return A multisurface
1354
         * @throws CreateGeometryException
1355
         *             This exception is thrown when the manager can not create the
1356
         *             geometry.
1357
         * @deprecated use {@link #createMultiSurface(int)} and {@link MultiPrimitive#addPrimitive(org.gvsig.fmap.geom.primitive.Primitive)}
1358
         */
1359
        public MultiSurface createMultiSurface(GeneralPathX generalPathX,
1360
            int subType) throws CreateGeometryException;
1361
        
1362
    public InformationbuilderWithGeometrySupport createInformacionBuilder();
1363
    
1364
    /**
1365
     * Check if geomTypeChild is a geoemtry type deribed of geomTypeParent
1366
     * 
1367
     * @param geomTypeParent
1368
     * @param geomTypeChild
1369
     * @return 
1370
     */
1371
    public boolean isSubtype(int geomTypeParent, int geomTypeChild);
1372

    
1373
}