Statistics
| Revision:

svn-gvsig-desktop / tags / v1_1_Build_1013 / libraries / libFMap / src / com / iver / cit / gvsig / fmap / layers / ReadableVectorial.java @ 13521

History | View | Annotate | Download (4.66 KB)

1 1100 fjp
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 *
19
 * For more information, contact:
20
 *
21
 *  Generalitat Valenciana
22
 *   Conselleria d'Infraestructures i Transport
23
 *   Av. Blasco Ib??ez, 50
24
 *   46010 VALENCIA
25
 *   SPAIN
26
 *
27
 *      +34 963862235
28
 *   gvsig@gva.es
29
 *      www.gvsig.gva.es
30
 *
31
 *    or
32
 *
33
 *   IVER T.I. S.A
34
 *   Salamanca 50
35
 *   46005 Valencia
36
 *   Spain
37
 *
38
 *   +34 963163400
39
 *   dac@iver.es
40
 */
41 214 fernando
package com.iver.cit.gvsig.fmap.layers;
42
43 3940 caballero
import com.hardcode.driverManager.DriverLoadException;
44
import com.hardcode.gdbms.engine.data.DataSource;
45 3943 fjp
import com.hardcode.gdbms.engine.values.Value;
46
import com.iver.cit.gvsig.fmap.DriverException;
47
import com.iver.cit.gvsig.fmap.core.DefaultFeature;
48
import com.iver.cit.gvsig.fmap.core.IFeature;
49 305 fjp
import com.iver.cit.gvsig.fmap.core.IGeometry;
50 3940 caballero
import com.iver.cit.gvsig.fmap.drivers.DriverAttributes;
51 214 fernando
import com.iver.cit.gvsig.fmap.drivers.DriverIOException;
52 4085 fjp
import com.iver.cit.gvsig.fmap.drivers.IFeatureIterator;
53 3940 caballero
import com.iver.cit.gvsig.fmap.drivers.VectorialDriver;
54
import com.vividsolutions.jts.geom.Envelope;
55 214 fernando
56 369 fernando
import java.awt.geom.Rectangle2D;
57 3940 caballero
import java.util.List;
58 214 fernando
59 369 fernando
60 214 fernando
/**
61
 * Interfaz usada internamente para acceder a fuentes de datos vectoriales en
62
 * modo lectura
63
 */
64
public interface ReadableVectorial {
65 1034 vcaballero
        /**
66
         * Indica que se va a comenzar a hacer una serie de operaciones sobre el
67
         * origen de datos con la finalidad de que dicho origen de datos se
68
         * prepare (abra el fichero, comience una transacci?n, conecte al
69
         * servidor, ...). Abre el fichero de ?ndices en caso de que exista.
70
         *
71
         * @throws DriverIOException
72
         */
73
        void start() throws DriverIOException;
74 214 fernando
75 1034 vcaballero
        /**
76
         * Hace que se cierre el soporte f?sico de la capa. Cierra el fichero de
77
         * ?ndices en caso de que exista.
78
         *
79
         * @throws DriverIOException
80
         */
81
        void stop() throws DriverIOException;
82 214 fernando
83 1034 vcaballero
        /**
84
         * Devuelve la geometr?a a partir de un ?ndice.
85
         *
86
         * @param index ?ndice.
87
         *
88
         * @return Geometr?a.
89
         *
90
         * @throws DriverIOException
91
         */
92
        IGeometry getShape(int index) throws DriverIOException;
93 214 fernando
94 1034 vcaballero
        /**
95
         * Devuelve el n?mero de Shape.
96
         *
97
         * @return N?mero de Shape.
98
         *
99
         * @throws DriverIOException
100
         */
101
        int getShapeCount() throws DriverIOException;
102 214 fernando
103 1034 vcaballero
        /**
104
         * Devuelve la extensi?n total de la capa.
105
         *
106
         * @return Extensi?n total.
107
         *
108
         * @throws DriverIOException
109
         */
110
        Rectangle2D getFullExtent() throws DriverIOException;
111 369 fernando
112 1034 vcaballero
        /**
113
         * Obtiene el tipo de las geometr?as almacenadas en esta fuente de datos
114
         *
115
         * @return Obtiene el tipo de la capa. Es un bit-oring de los tipos
116
         *                    definidos en FShape POINT, LINE, POLYGON o TEXT;
117
         *
118
         * @throws DriverIOException
119
         */
120
        int getShapeType() throws DriverIOException;
121 3940 caballero
        /**
122
         * Obtiene una referencia al objeto que implementa la interfaz vectorial
123
         * con el fin de que las Strategy puedan optimizar en funci?n del driver.
124
         *
125
         * @return VectorialDriver
126
         */
127
        public VectorialDriver getDriver();
128
        /**
129
         * Establece el driver sobre el que act?a el adaptador
130
         *
131
         * @param driver
132
         */
133
        public void setDriver(VectorialDriver driver);
134
         /*
135
     * (non-Javadoc)
136
     *
137
     * @see com.iver.cit.gvsig.fmap.layers.VectorialAdapter#getRecordset()
138
     */
139 3959 caballero
    public SelectableDataSource getRecordset() throws DriverLoadException;
140 3940 caballero
    public DriverAttributes getDriverAttributes();
141 3959 caballero
142 3943 fjp
    /**
143
     * En la implementaci?n por defecto podemos hacer que cada
144
     * feature tenga ID = numero de registro.
145
     * En el DBAdapter podr?amos "overrride" este m?todo y poner
146
     * como ID de la Feature el campo ?nico escogido en
147
     * la base de datos. B?sicamente es por comodidad.
148
     * @param numReg
149
     * @return
150
     * @throws DriverException
151
     */
152
    public IFeature getFeature(int numReg) throws DriverException;
153 4085 fjp
154 4115 fjp
    /* public IFeatureIterator getFeatureIterator(String strEPSG) throws DriverException;
155
    public IFeatureIterator getFeatureIterator(Rectangle2D r, String strEPSG) throws DriverException; */
156 3940 caballero
157 3963 caballero
        //void setRecordset(SelectableDataSource sds);
158 3940 caballero
159 3943 fjp
160 3963 caballero
161 214 fernando
}