Revision 915 trunk/libraries/libjni-gdal/src/es/gva/cit/jgdal/OGRLayer.java
OGRLayer.java | ||
---|---|---|
36 | 36 |
|
37 | 37 |
public class OGRLayer extends JNIBase{ |
38 | 38 |
|
39 |
public native long getLayerDefnNat(long cPtr); |
|
39 | 40 |
|
41 |
/** |
|
42 |
* Constructor |
|
43 |
* @param cPtr direcci?n de memoria al objeto OGRLayer de C. |
|
44 |
*/ |
|
45 |
|
|
46 |
public OGRLayer(long cPtr){ |
|
47 |
this.cPtr=cPtr; |
|
48 |
} |
|
49 |
|
|
50 |
/** |
|
51 |
* |
|
52 |
* @throws GdalException |
|
53 |
* @return |
|
54 |
*/ |
|
55 |
|
|
56 |
public OGRFeatureDefn getLayerDefn()throws GdalException{ |
|
57 |
|
|
58 |
if(cPtr <= 0) |
|
59 |
throw new GdalException("Error en getLayerDefn(). El constructor no tuvo exito"); |
|
60 |
|
|
61 |
long layer = getLayerDefnNat(cPtr); |
|
62 |
|
|
63 |
if(layer<=0) |
|
64 |
throw new GdalException("Error en getLayerDefn(). No se ha podido obtener el objeto OGRFeatureDefn."); |
|
65 |
|
|
66 |
return new OGRFeatureDefn(layer); |
|
67 |
|
|
68 |
} |
|
40 | 69 |
} |
Also available in: Unified diff