Code Monkey home page Code Monkey logo

H2GIS Build Status

H2GIS is a spatial extension of the H2 database engine in the spirit of PostGIS. It adds support for managing spatial features and operations on the new Geometry type of H2, the Open Geospatial Consortium (OGC) Simple Features for SQL (SFSQL) functions and additional spatial functions that we (the Atelier SIG) develop. There is currently about 70 spatial functions in H2GIS.

H2GIS is the root project for the new OrbisGIS data management library and is divided into two subprojects: H2Spatial and H2Drivers, both of which are licensed under the GPL 3 license terms.

H2Spatial

H2Spatial extends H2 by adding spatial storage and analysis capabilities, including

  • a constraint on Geometry data type storing POINT, CURVE and SURFACE types in WKB representations
  • spatial operators (ST_Intersection, ST_Difference, etc.)
  • spatial predicates (ST_Intersects, ST_Contains, etc.)

H2Spatial Extension

Additional spatial SQL functions that are not in Simple Features for SQL (SFSQL)

Ex: ST_Extent, ST_Explode

H2Drivers

H2Drivers add H2 read/write support for file formats such as .shp, .dbf, .geojson, .gpx

This package include 2 implementation of TableEngine that allow you to immediatly 'link' a table with a shape file.

It include also file copy functions:

  • SHPREAD( ) and SHPWRITE( ) to read and write Esri shape files.
  • DBFREAD( ) and DBFWRITE( ) to read and write DBase III files.
  • GeoJsonRead() and GeoJsonWrite() to read and write GeoJSON files.
  • GPXRead() to read GPX files.

Usage

For now, H2GIS requires Java 6. Run maven clean install -P standalone in the H2GIS's root directory.

In the folder h2-dist/target/ you will find a zip file h2gis-standalone-bin.zip that contain a run.sh file for running H2 with H2GIS. It will open a browser based console application.

Create a database and run the following commands to add spatial features (do it only after the creation of a new database):

CREATE ALIAS IF NOT EXISTS SPATIAL_INIT FOR "org.h2gis.h2spatialext.CreateSpatialExtension.initSpatialExtension";
CALL SPATIAL_INIT();

You can open a shapefile by calling the following SQL request:

CALL FILE_TABLE('/home/user/myshapefile.shp', 'tablename');

This special table will be immediatly created (no matter the file size). The content will allways be synchronized with the file content.

You can also copy the content of the file into a regular H2 table:

CALL SHPREAD('/home/user/myshapefile.shp', 'tablename');

Or copy the content of a spatial table in a new shape file:

CALL SHPWRITE('/home/user/newshapefile.shp', 'tablename');

Acknowledgements

The H2GIS team utilizes open source software. Specifically, we would like to thank :

H2GIS's Projects

cts icon cts

Projection library in Java

h2gis icon h2gis

A spatial extension of the H2 database.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.