forked from orbisgis/orbisgis
-
Notifications
You must be signed in to change notification settings - Fork 0
Gdms Introduction
Antoine Gourlay edited this page Jul 23, 2012
·
1 revision
Gdms is the core library of OrbisGIS. It provides:
- Input/Ouput for several formats
- An abstraction layer above those sources
- A processing engine that supports Spatial SQL.
// the main entry point of Gdms
DataSourceFactory dsf = new DataSourceFactory();
// an existing data source in ShapeFile
dsf.getSourceManager().register("hello", new File("/tmp/myShapeFile.shp"));
// just going through the rows of a source
DataSource ds = dsf.getDataSource("hello");
ds.open();
for (int i = 0; i < ds.getRowCount(); i++) {
System.out.println("Geometry as WKT: " + ds.getGeometry(i).toText());
}
ds.close();
// querying using SQL
DataSource ds = dsf.getDataSourceFromSQL("SELECT COUNT(*) FROM hello WHERE NOT ST_IsValid(the_geom);");
ds.open();
System.out.println(String.format("Found %d invalid geometries!", ds.getInt(0)));
ds.close();
- File formats
- TIF with TFW (.tif, .tiff, .tfw): TIFF image with ArcView world file
- AutoCAD DXF (.dxf): AutoCAD Drawing Exchange Format (input only)
- CSV (.csv): Character Separated Values format
- Esri ASCII Grid (.asc): Esri raster ASCII format
- Esri Shapefile (.shp, shx, .dbf): Esri geospatial vector format
- JPG with JGW (.jpg, .jgw): JPEG image with ArcView world file
- gdms (.gdms): Gdms native format
- MIF/MID (.mif, .mid): MapInfo Interchange Format (input only)
- PNG with PGW (.png, .pgw): PNG image with ArcView world file
- Solene (.cir, .val): Solene geometry & attributes format (output partially supported)
- VRML (.wrl): Virtual Reality Modeling Language (input only)
- DBF (.dbf): dBase format
- Databases
- H2: H2 Java Database Engine (and spatial extension h2spatial)
- HSQLDB: Hyper Structured Query Language Database Java Engine
- PostgreSQL: PostgreSQL Database Engine (and spatial extension PostGIS)
Documentation (still partial at this time) on the SQL capabilities of Gdms can be found here: Gdms SQL Language
- Home - overview for developers
- Using Gdms - directly working with Gdms
- The DataSource API - using data sources
- Executing SQL - using SQL
- Dependencies & Licenses - list dependencies and their licenses
- OrbisGIS 4.0 Internals - internal docs
External links:
- Gdms SQL Reference - documentation for Gdms SQL
- User Documentation (v3.0) - OrbisGIS v3 user docs