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 @ 43513

History | View | Annotate | Download (49.4 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
     * Create a geometry from a WKT definition.
794
     *
795
     * This is a utility method to wrap the invocation to the operation
796
     * {@link OPERATIONS#FROMWKT}.
797
     *
798
     * @param wkt
799
     *            geometry in Well-known text format
800
     *
801
     * @return the geometry as a Geometry
802
     *
803
     * @throws CreateGeometryException
804
     * @throws GeometryException
805
     */
806
    public Geometry createFrom(String wkt, String srs)
807
        throws CreateGeometryException, GeometryException;
808

    
809
    public Geometry createFrom(String wkt, IProjection srs)
810
        throws CreateGeometryException, GeometryException;
811

    
812
    public Geometry createFrom(String wkt) throws CreateGeometryException,
813
        GeometryException;
814

    
815
    /**
816
     * Create a geometry from a WKB definition.
817
     *
818
     * This is a utility method to wrap the invocation to the operation
819
     * {@link OPERATIONS#FROMWKB}.
820
     *
821
     * @param wkb
822
     *            geometry in well-known binary format
823
     *
824
     * @return the geometry as a Geometry
825
     *
826
     * @throws CreateGeometryException
827
     * @throws GeometryException
828
     */
829
    public Geometry createFrom(byte[] wkb) throws CreateGeometryException,
830
        GeometryException;
831

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

    
869
    /**
870
     * <p>
871
     * It creates a null geometry with a concrete subtype.
872
     * <p>
873
     *
874
     * @param subType
875
     *            SubType of geometry. Must be a value defined in
876
     *            {@link Geometry.SUBTYPES}
877
     * @return
878
     *         A NullGeometry
879
     * @throws CreateGeometryException
880
     *             This exception is thrown when the manager can not create
881
     *             the geometry.
882
     * @deprecated use null instead. This method can be removed in next revisions
883
     */
884
    public NullGeometry createNullGeometry(int subType)
885
        throws CreateGeometryException;
886

    
887
    /**
888
     * <p>
889
     * Create a new point with a concrete type and sets the value for the X and
890
     * the Y.
891
     * </p>
892
     *
893
     * @param x
894
     *            The X coordinate
895
     * @param y
896
     *            The y coordinate
897
     * @param subType
898
     *            SubType of geometry. Must be a value defined in
899
     *            {@link Geometry.SUBTYPES}
900
     * @throws CreateGeometryException
901
     *             This exception is thrown when the manager can not create
902
     *             the geometry.
903
     * @return
904
     *         The Point
905
     */
906
    public Point createPoint(double x, double y, int subType)
907
        throws CreateGeometryException;
908

    
909
    /**
910
     * Create a new line with a concrete type. Use later addVertex to add
911
     * vertex to te line.
912
     *
913
     * @param subType SubType of geometry. Must be a value defined in {@link Geometry.SUBTYPES}
914
     * @return a line
915
     * @throws CreateGeometryException
916
     *             This exception is thrown when the manager can not create
917
     *             the geometry.
918
     */
919
    public Line createLine(int subType) throws CreateGeometryException;
920

    
921
    /**
922
     * @deprecated use createLine
923
     */
924
    public Curve createCurve(int subType) throws CreateGeometryException;
925

    
926
    /**
927
     * Create a new polygon with a concrete type.
928
     * Use later addVertex to add vertex to te polygon.
929
     *
930
     * @param subType
931
     *            SubType of geometry. Must be a value defined in
932
     *            {@link Geometry.SUBTYPES}
933
     * @return
934
     *         A polygon
935
     * @throws CreateGeometryException
936
     *             This exception is thrown when the manager can not create
937
     *             the geometry.
938
     */
939
    public Polygon createPolygon(int subType)
940
        throws CreateGeometryException;
941

    
942
    /**
943
     * @deprecated use createPolygon
944
     */
945
    public Surface createSurface(int subType)
946
        throws CreateGeometryException;
947

    
948
    /**
949
     * Create a new multipoint with a concrete subtype.
950
     * Use addPrimitive to populate the multipoint.
951
     *
952
     * @param subType
953
     *            SubType of geometry. Must be a value defined in
954
     *            {@link Geometry.SUBTYPES}
955
     * @return A multipoint
956
     * @throws CreateGeometryException
957
     *             This exception is thrown when the manager can not create the
958
     *             geometry.
959
     */
960
    public MultiPoint createMultiPoint(int subType)
961
        throws CreateGeometryException;
962

    
963
    /**
964
     * Create a new multicurve with a concrete subtype.
965
     * Use addPrimitive to populate the multicurve.
966
     *
967
     * @param subType
968
     *            SubType of geometry. Must be a value defined in
969
     *            {@link Geometry.SUBTYPES}
970
     * @return A multicurve
971
     * @throws CreateGeometryException
972
     *             This exception is thrown when the manager can not create the
973
     *             geometry.
974
     */
975
    public MultiCurve createMultiCurve(int subType) throws CreateGeometryException;
976

    
977
    public MultiLine createMultiLine(int subType) throws CreateGeometryException;
978

    
979
    /**
980
     * Create a new multisurface with a concrete subtype.
981
     * Use later addPrimitive to populate.
982
     *
983
     * @param subType
984
     *            SubType of geometry. Must be a value defined in
985
     *            {@link Geometry.SUBTYPES}
986
     * @return A multisurface
987
     * @throws CreateGeometryException
988
     *             This exception is thrown when the manager can not create the
989
     *             geometry.
990
     */
991
    public MultiSurface createMultiSurface(int subType) throws CreateGeometryException;
992

    
993
    public MultiPolygon createMultiPolygon(int subType) throws CreateGeometryException;
994

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

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

    
1098
    /**
1099
     * <p>
1100
     * Invokes an operation given its code, the geometry and the operation
1101
     * context holding the parameters required for the operation.
1102
     * </p>
1103
     *
1104
     * @param opCode
1105
     *            Operation code.
1106
     * @param geom
1107
     *            Geometry to which apply the operation
1108
     * @param ctx
1109
     *            Context holding the operation parameters
1110
     * @return
1111
     *         The object returned by an operation, depends on each operation.
1112
     */
1113
    public Object invokeOperation(int opCode, Geometry geom,
1114
        GeometryOperationContext ctx)
1115
        throws GeometryOperationNotSupportedException,
1116
        GeometryOperationException;
1117

    
1118
    /**
1119
     * <p>
1120
     * Invokes an operation given its code, the geometry and the operation
1121
     * context holding the parameters required for the operation.
1122
     * </p>
1123
     *
1124
     * @param geomOpName
1125
     *            Operation name.
1126
     * @param geom
1127
     *            Geometry to which apply the operation
1128
     * @param ctx
1129
     *            Context holding the operation parameters
1130
     * @return
1131
     *         The object returned by an operation, depends on each operation.
1132
     */
1133
    public Object invokeOperation(String geomOpName, Geometry geom,
1134
        GeometryOperationContext ctx)
1135
        throws GeometryOperationNotSupportedException,
1136
        GeometryOperationException;
1137

    
1138
    /**
1139
     * <p>
1140
     * Invokes an operation given its code, and the operation context holding
1141
     * the parameters required for the operation.
1142
     * </p>
1143
     *
1144
     * @param geomOpName
1145
     *            Operation name.
1146
     * @param ctx
1147
     *            Context holding the operation parameters
1148
     * @return
1149
     *         The object returned by an operation, depends on each operation.
1150
     */
1151
    public Object invokeOperation(String geomOpName,
1152
        GeometryOperationContext ctx)
1153
        throws GeometryOperationNotSupportedException,
1154
        GeometryOperationException;
1155

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

    
1184
    /**
1185
     * Returns a list with the name of the operations that have been
1186
     * registered.
1187
     *
1188
     * @return
1189
     *         A list of the registered operations.
1190
     */
1191
    public List getGeometryOperationNames();
1192

    
1193
    /**
1194
     * Returns the flatness used to convert a curve is a set
1195
     * of points.
1196
     *
1197
     * @return
1198
     *         The flatness.
1199
     */
1200
    public double getFlatness();
1201

    
1202
    /**
1203
     * Sets the application flatness.
1204
     *
1205
     * @param flatness
1206
     *            The flatness to set
1207
     */
1208
    public void setFlatness(double flatness);
1209

    
1210
    /**
1211
     * Create a memory spatial index with the default implementation.
1212
     *
1213
     * @return a new SpatialIndex
1214
     */
1215
    public SpatialIndex createDefaultMemorySpatialIndex() throws ServiceException;
1216

    
1217

    
1218
    /**
1219
     * Create a spatial index with the implementation specified as name.
1220
     * If the creation of index don't requery parameters can be passed a null.
1221
     *
1222
     * @param name of the type of spatial index to create
1223
     * @param parameters used to create the index or null.
1224
     * @return the new SpatialIndex or null if not exists the type of index.
1225
     * @throws GeometryException
1226
     */
1227
    public SpatialIndex createSpatialIndex(String name, DynObject parameters) throws ServiceException;
1228

    
1229
    /**
1230
     * Return the name of the factory of the spatial index required.
1231
     *
1232
     * @param name of the spatial index factory
1233
     * @return the SpatialIndexFactory required or null if not exists
1234
     */
1235
    public SpatialIndexFactory getSpatialIndexFactory(String name);
1236

    
1237
    /**
1238
     * Create a GeneralPathX to populate a geometry.
1239
     * This method is deprecated, instead use OrientablePrimitive#addVertex(Point) to add vertex to
1240
     * primitive geometries or {@link MultiPrimitive#addPrimitive(org.gvsig.fmap.geom.primitive.Primitive)} to add geometries to an aggregate.
1241
     *
1242
     * @param rule
1243
     * @param pathIterator , can be null
1244
     * @return a GeneralPathX
1245
     * @deprecated use method of Geometry to handle this
1246
     * @see OrientablePrimitive#addVertex(Point) or {@link MultiPrimitive#addPrimitive(org.gvsig.fmap.geom.primitive.Primitive)}
1247
     *
1248
     */
1249
    public IGeneralPathX createGeneralPath(int rule, PathIterator pathIterator);
1250

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

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

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

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

    
1363
}