Statistics
| Revision:

gvsig-raster / org.gvsig.raster.gdal / trunk / org.gvsig.raster.gdal / org.gvsig.raster.gdal.io / src / main / java / org / gvsig / jogr / JNIBase.java @ 4089

History | View | Annotate | Download (7.41 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
*
3
* Copyright (C) 2007-2008 Infrastructures and Transports Department
4
* of the Valencian Government (CIT)
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 2
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
*/
22
/**
23
 * @author Nacho Brodin (nachobrodin@gmail.com).<BR> Equipo de desarrollo gvSIG.<BR> http://www.gvsig.gva.es
24
 * @version 0.0
25
 * @link http://www.gvsig.gva.es
26
 */
27

    
28
package org.gvsig.jogr;
29

    
30

    
31
public class JNIBase { 
32
        
33
        protected long cPtr;
34
        
35
//
36
////        private native int getDriverCountNat(long cPtr);
37
////        private native int getLayerCountNat(long cPtr);
38
////        private native int getFeatureCountNat(long cPtr);
39
////        private native int getFieldCountNat(long cPtr);
40
////        private native int getWidthNat(long cPtr);
41
////        private native int getPrecisionNat(long cPtr);
42
////        
43
////        private native int referenceNat(long cPtr);
44
////        private native int dereferenceNat(long cPtr);
45
////        private native int getRefCountNat(long cPtr);
46
////        private native int getSummaryRefCountNat(long cPtr);
47
////        
48
//        private native int referenceFeatureDefnNat(long cPtr);
49
//        private native int dereferenceFeatureDefnNat(long cPtr);
50
////        private native int getReferenceCountNat(long cPtr);
51
////        
52
////        private native int getFieldCountFeatureNat(long cPtr);
53
////        
54
//        //private native int syncToDiskNat(long cPtr);//Excepciones
55
//        //private native int startTransactionNat(long cPtr);//Excepciones
56
//        //private native int commitTransactionNat(long cPtr);//Excepciones
57
//        //private native int rollbackTransactionNat(long cPtr);//Excepciones
58
////        private native int referenceLayerNat(long cPtr);
59
////        private native int dereferenceLayerNat(long cPtr);
60
////        private native int getRefCountLayerNat(long cPtr);
61
////        
62
////        private native int getOpenDSCountNat(long cPtr);
63
////        
64
//        //Geometry
65
////        private native int getDimensionNat( long cPtr);
66
////        private native int isSimpleNat( long cPtr );
67
////        private native int wkbSizeNat( long cPtr );
68
//        
69
//        //Point
70
////        private native int isEmptyPointNat( long cPtr ); //return OGRBoolean
71
////        private native int getCoordinateDimensionPointNat( long cPtr );
72
//        
73
//        //Line String
74
////        private native int isEmptyLineStringNat( long cPtr ); //return OGRBoolean
75
////        private native int getCoordinateDimensionLineStringNat( long cPtr );
76
////        private native int getNumPointsNat( long cPtr );
77
//        
78
//        //Linear Ring
79
////        private native int isClockwiseNat(long cPtr);
80
////        private native int WkbSizeNat(long cPtr);
81
//        
82
//        //Polygon
83
////        private native int getNumInteriorRingsNat( long cPtr );
84
////        private native int wkbSizePolygonNat( long cPtr );
85
////        private native int getDimensionPolygonNat( long cPtr );
86
////        private native int getCoordinateDimensionNat( long cPtr );
87
//        
88
//        //GeometryCollection
89
////        private native int getDimensionGeometryCollectionNat( long cPtr );
90
////        private native int getCoordinateDimensionGeometryCollectionNat( long cPtr );
91
//        
92
//         /**
93
//         * Funci?n que sirve como base para funcionalidades de ogr que admiten como par?metro un long y devuelven un entero.
94
//         * 
95
//         * @throws OGRException.
96
//         * @param msg1        Mensaje de error que se muestra cuando el puntero a objeto pasado es vacio.
97
//         * @param msg2        Mensaje de error que se muestra cuando el resultado de la llamada a la funci?n de gdal es menor o igual que 0.
98
//         */
99
//         
100
//         
101
//        protected int baseSimpleFunctions(int n,String msg1,String msg2)throws OGRException{
102
//                        
103
//                int res = 0;
104
//                if(cPtr <= 0)
105
//                        throw new OGRException(msg1);
106
//                        
107
//                switch(n){
108
//                        case 0: res = getDriverCountNat(cPtr);break;
109
//                        case 1: res = getLayerCountNat(cPtr);break;
110
//                        case 2: res = getFeatureCountNat(cPtr);break;
111
//                        case 3: res = getFieldCountNat(cPtr);break;
112
//                        case 4: res = getWidthNat(cPtr);break;
113
//                        case 5: res = getPrecisionNat(cPtr);break;
114
//                        case 6: res = referenceNat(cPtr);break;
115
//                        case 7: res = dereferenceNat(cPtr);break;
116
//                        case 8: res = getRefCountNat(cPtr);break;
117
//                        case 9: res = getSummaryRefCountNat(cPtr);break;
118
//                        case 10: res = referenceFeatureDefnNat(cPtr);break;
119
//                        case 11: res = dereferenceFeatureDefnNat(cPtr);break;
120
//                        case 12: res = getReferenceCountNat(cPtr);break;
121
//                        case 13: res = getFieldCountFeatureNat(cPtr);break;
122
//                        //case 14: res = syncToDiskNat(cPtr);break;//Excepciones
123
//                        //case 15: res = startTransactionNat( cPtr);break;//Excepciones
124
//                        //case 16: res = commitTransactionNat( cPtr);break;//Excepciones
125
//                        //case 17: res = rollbackTransactionNat( cPtr);break;//Excepciones
126
//                        case 18: res = referenceLayerNat( cPtr);break;
127
//                        case 19: res = dereferenceLayerNat( cPtr);break;
128
//                        case 20: res = getRefCountLayerNat( cPtr);break;
129
//                        case 21: res = getOpenDSCountNat(cPtr);break;
130
//                        case 22: res = getDimensionNat(cPtr);break;
131
//                        case 23: res = isSimpleNat(cPtr );break;
132
//                        case 24: res = wkbSizeNat(cPtr );break;
133
//                        case 25: res = isEmptyPointNat( cPtr );break; //return OGRBoolean
134
//                        case 26: res = getCoordinateDimensionPointNat( cPtr );break;
135
//                        case 27: res = getNumPointsNat( cPtr );break;
136
//                        case 28: res = isEmptyLineStringNat( cPtr );break; //return OGRBoolean
137
//                        case 29: res = getCoordinateDimensionLineStringNat( cPtr );break;
138
//                        case 30: res = isClockwiseNat(cPtr);break;
139
//                        case 31: res = WkbSizeNat(cPtr);break;
140
//                        case 32: res = getNumInteriorRingsNat( cPtr );break;
141
//                        case 33: res = wkbSizeNat( cPtr );break;
142
//                        case 34: res = getDimensionNat( cPtr );break;
143
//                        case 35: res = getCoordinateDimensionNat( cPtr );break;
144
//                }
145
//                        
146
//                if(res<0)
147
//                         throw new OGRException(msg2);
148
//                else return res;
149
//        }
150
//        
151
//        /**
152
//         * Lanza una excepci?n dependiendo del tipo de error pasado
153
//         * @param err
154
//         * @param mensaje
155
//         * @throws OGRCorruptDataException
156
//         * @throws OGRFailureException
157
//         * @throws OGRNotEnoughDataException
158
//         * @throws OGRNotEnoughMemoryException
159
//         * @throws OGRUnsupportedGeometryTypeException
160
//         * @throws OGRUnsupportedOperationException
161
//         * @throws OGRUnsupportedSRSException
162
//         */
163
//        protected void throwException(int err, String mensaje)
164
//                throws OGRCorruptDataException, OGRFailureException, OGRNotEnoughDataException, OGRNotEnoughMemoryException, OGRUnsupportedGeometryTypeException, OGRUnsupportedOperationException, OGRUnsupportedSRSException{
165
//                
166
//                switch(err){
167
//                        case 1:throw new OGRNotEnoughDataException(mensaje);
168
//                        case 2:throw new OGRNotEnoughMemoryException(mensaje);
169
//                        case 3:throw new OGRUnsupportedGeometryTypeException(mensaje);
170
//                        case 4:throw new OGRUnsupportedOperationException(mensaje);
171
//                        case 5:throw new OGRCorruptDataException(mensaje);
172
//                        case 6:throw new OGRFailureException(mensaje);
173
//                        case 7:throw new OGRUnsupportedSRSException(mensaje);
174
//                        default : return;
175
//                }
176
//        }
177
//        
178
//        /**
179
//         * Obtiene el puntero a C del objeto
180
//         * @param cPtr long con la direcci?n de memoria del objeto
181
//         */
182
//        public long getPtro() {
183
//                return cPtr;
184
//        }
185

    
186
//        static {
187
//        System.loadLibrary("jgdal2.0.4");
188
//        }
189
}