svn-gvsig-desktop / trunk / libraries / libjni-gdal / src / es / gva / cit / jgdal / OGRLayer.java @ 915
History | View | Annotate | Download (1.89 KB)
1 |
/**********************************************************************
|
---|---|
2 |
* $Id: OGRLayer.java 915 2005-01-12 08:21:15Z igbrotru $
|
3 |
*
|
4 |
* Name: OGRLayer.java
|
5 |
* Project: JGDAL. Interface java to gdal (Frank Warmerdam).
|
6 |
* Purpose:
|
7 |
* Author: Nacho Brodin, brodin_ign@gva.es
|
8 |
*
|
9 |
**********************************************************************/
|
10 |
/*Copyright (C) 2004 Nacho Brodin <brodin_ign@gva.es>
|
11 |
|
12 |
This program is free software; you can redistribute it and/or
|
13 |
modify it under the terms of the GNU General Public License
|
14 |
as published by the Free Software Foundation; either version 2
|
15 |
of the License, or (at your option) any later version.
|
16 |
|
17 |
This program is distributed in the hope that it will be useful,
|
18 |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
19 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
20 |
GNU General Public License for more details.
|
21 |
|
22 |
You should have received a copy of the GNU General Public License
|
23 |
along with this program; if not, write to the Free Software
|
24 |
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
25 |
*/
|
26 |
|
27 |
package es.gva.cit.jgdal; |
28 |
|
29 |
|
30 |
/**
|
31 |
*
|
32 |
* @author Nacho Brodin <brodin_ign@gva.es>.<BR> Equipo de desarrollo gvSIG.<BR> http://www.gvsig.gva.es
|
33 |
* @version 0.0
|
34 |
* @link http://www.gvsig.gva.es
|
35 |
*/
|
36 |
|
37 |
public class OGRLayer extends JNIBase{ |
38 |
|
39 |
public native long getLayerDefnNat(long cPtr); |
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 |
} |
69 |
} |