|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gdal.ogr.ogr
public class ogr
Class ogr is an uninstanciable class providing various utility functions as static methods.
In particular, it provides ogr.RegisterAll() and ogr.Open() methods.
Field Summary |
---|
Method Summary | |
---|---|
static Geometry |
BuildPolygonFromEdges(Geometry hLineCollection)
|
static Geometry |
BuildPolygonFromEdges(Geometry hLineCollection,
int bBestEffort)
Build a ring from a bunch of arcs. |
static Geometry |
BuildPolygonFromEdges(Geometry hLineCollection,
int bBestEffort,
int bAutoClose)
Build a ring from a bunch of arcs. |
static Geometry |
BuildPolygonFromEdges(Geometry lineCollection,
int bBestEffort,
int bAutoClose,
double dfTolerance)
Build a ring from a bunch of arcs. |
static Geometry |
CreateGeometryFromGML(String gml)
Create a new Geometry from a GML string. |
static Geometry |
CreateGeometryFromJson(String json)
Create a new Geometry from a GeoJSON string. |
static Geometry |
CreateGeometryFromWkb(byte[] wkb)
Create a new Geometry from a well known binary (wkb) content. |
static Geometry |
CreateGeometryFromWkb(byte[] wkb,
SpatialReference srs)
Create a new Geometry from a well known binary (wkb) content. |
static Geometry |
CreateGeometryFromWkt(String wkt)
Create a new Geometry from a well known text (wkt) string. |
static Geometry |
CreateGeometryFromWkt(String wkt,
SpatialReference srs)
Create a new Geometry from a well known text (wkt) content. |
static void |
DontUseExceptions()
Use return code instead of exceptions. |
static String[] |
GeneralCmdLineProcessor(String[] args)
General utility option processing. |
static String[] |
GeneralCmdLineProcessor(String[] args,
int options)
General utility option processing. |
static Vector |
GeneralCmdLineProcessor(Vector args)
General utility option processing. |
static Vector |
GeneralCmdLineProcessor(Vector args,
int options)
General utility option processing. |
static String |
GeometryTypeToName(int eType)
Fetch a human readable name corresponding to an OGRwkBGeometryType value. |
static Driver |
GetDriver(int iDriver)
Fetch the indicated driver. |
static Driver |
GetDriverByName(String name)
Fetch the indicated driver. |
static int |
GetDriverCount()
Fetch the number of registered drivers. |
static String |
GetFieldTypeName(int type)
Fetch human readable name for a field type. |
static DataSource |
GetOpenDS(int iDS)
Return the iDS th datasource opened. |
static int |
GetOpenDSCount()
Return the number of opened datasources. |
static DataSource |
Open(String filename)
Open a file / data source with one of the registered drivers. |
static DataSource |
Open(String filename,
boolean update)
Open a file / data source with one of the registered drivers. |
static DataSource |
Open(String filename,
int update)
Open a file / data source with one of the registered drivers. |
static DataSource |
OpenShared(String filename)
Open a file / data source with one of the registered drivers. |
static DataSource |
OpenShared(String filename,
int update)
Open a file / data source with one of the registered drivers. |
static void |
RegisterAll()
Register all known configured OGR drivers. |
static int |
SetGenerate_DB2_V72_BYTE_ORDER(int bGenerate_DB2_V72_BYTE_ORDER)
Special entry point to enable the hack for generating DB2 V7.2 style WKB. |
static void |
UseExceptions()
Use exceptions instead of error return codes. |
static int |
wkbFlatten(int eType)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void UseExceptions()
public static void DontUseExceptions()
public static String GeometryTypeToName(int eType)
eType
- the geometry type.
public static String GetFieldTypeName(int type)
type
- the field type to get name for.
public static Geometry CreateGeometryFromWkb(byte[] wkb, SpatialReference srs)
wkb
- the wkb contentsrs
- the srs to assign to the geometry
public static Geometry CreateGeometryFromWkb(byte[] wkb)
wkb
- the wkb content
public static Geometry CreateGeometryFromWkt(String wkt, SpatialReference srs)
wkt
- the wkt contentsrs
- the srs to assign to the geometry
public static Geometry CreateGeometryFromWkt(String wkt)
wkt
- the wkt content
public static Geometry CreateGeometryFromGML(String gml)
gml
- the GML string
public static Geometry CreateGeometryFromJson(String json)
json
- the GeoJSON string
public static Geometry BuildPolygonFromEdges(Geometry lineCollection, int bBestEffort, int bAutoClose, double dfTolerance)
lineCollection
- geometry of type OGRGeometryCollection (or OGRMultiLineString) containing the line string geometries to be built into rings.bBestEffort
- not yet implemented???.bAutoClose
- indicates if the ring should be close when first and
last points of the ring are the same.dfTolerance
- tolerance into which two arcs are considered
close enough to be joined.
public static Geometry BuildPolygonFromEdges(Geometry hLineCollection, int bBestEffort, int bAutoClose)
BuildPolygonFromEdges(Geometry lineCollection, int bBestEffort, int bAutoClose, double dfTolerance)
public static Geometry BuildPolygonFromEdges(Geometry hLineCollection, int bBestEffort)
BuildPolygonFromEdges(Geometry lineCollection, int bBestEffort, int bAutoClose, double dfTolerance)
public static Geometry BuildPolygonFromEdges(Geometry hLineCollection)
public static int GetDriverCount()
public static int GetOpenDSCount()
public static int SetGenerate_DB2_V72_BYTE_ORDER(int bGenerate_DB2_V72_BYTE_ORDER)
public static void RegisterAll()
This function should generally be called once at the beginning of the application.
public static DataSource GetOpenDS(int iDS)
iDS
- the index of the dataset to return (between 0 and GetOpenDSCount() - 1)public static DataSource Open(String filename, int update)
If this method fails, gdal.GetLastErrorMsg() can be used to check if there is an error message explaining why.
The returned dataset should be properly closed with the DataSource.delete() method.
Example:
DataSource ds = ogr.Open( "polygon.shp" ); if( ds == null ) { return; } ... use the data source ... ds.delete();
filename
- the name of the file, or data source to open.update
- 0 for read-only access (the default) or 1 for
read-write access.
public static DataSource Open(String filename)
Open(String filename, int update)
public static DataSource OpenShared(String filename, int update)
NOTE: It is an error, but currently we ignore the bUpdate, and return whatever is open even if it is read-only and the application requested update access.
Open(String filename, int update)
public static DataSource OpenShared(String filename)
NOTE: It is an error, but currently we ignore the bUpdate, and return whatever is open even if it is read-only and the application requested update access.
Open(String filename, int update)
public static Driver GetDriverByName(String name)
name
- the driver name
public static Driver GetDriver(int iDriver)
iDriver
- the driver index, from 0 to GetDriverCount()-1.
public static Vector GeneralCmdLineProcessor(Vector args, int options)
GeneralCmdLineProcessor(String[] args, int options)
public static Vector GeneralCmdLineProcessor(Vector args)
GeneralCmdLineProcessor(String[] args, int options)
public static int wkbFlatten(int eType)
public static String[] GeneralCmdLineProcessor(String[] args, int options)
The typical usage looks something like the following. Note that the formats should be registered so that the --formats and --format options will work properly.
public static void main( Strings[] args ) { ogr.RegisterAll(); args = ogr.GeneralCmdLineProcessor( args, 0 ); }
args
- the argument list arrayoptions
- currently unused
public static String[] GeneralCmdLineProcessor(String[] args)
GeneralCmdLineProcessor(String[] args, int options)
public static DataSource Open(String filename, boolean update)
Open(String filename, int update)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |