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