Coder Social home page Coder Social logo

geodb's Introduction

Introducing GeoDB

GeoDB is a spatial extension of H2, the Java SQL database. GeoDB utilizes the JTS library as its geometry engine and the Hatbox library for spatial indexing support.

Quickstart

  • Download GeoDB

  • Unzip the geodb-0.9-app.zip file

  • Update the PATH environment variable to include geodb-0.9/bin

  • Run the @geodb@ command:

      % geodb foo
    
  • Initialize the spatial database:

      @h2> CREATE ALIAS InitGeoDB for "geodb.GeoDB.InitGeoDB";
      @h2> CALL InitGeoDB();
    
  • Create a spatial table:

      @h2> CREATE TABLE spatial (id INT AUTO_INCREMENT PRIMARY KEY, geom BLOB);
    
  • Create some spatial data:

      @h2> INSERT INTO spatial (geom) VALUES (ST_GeomFromText('POINT(-5 -5)', 4326));
      @h2> INSERT INTO spatial (geom) VALUES (ST_GeomFromText('POINT(0 0)', 4326));
      @h2> INSERT INTO spatial (geom) VALUES (ST_GeomFromText('POINT(5 5)', 4326));
      
      @h2> SELECT ST_AsText(ST_Buffer(geom, 10)) as buffer FROM spatial;
    
  • Create a spatial index

      @h2> CALL CreateSpatialIndex(null, 'SPATIAL', 'GEOM', '4326');
    
  • Perform a spatial query

      @h2> SELECT ST_AsText(geom) FROM spatial WHERE  id IN (SELECT CAST(HATBOX_JOIN_ID AS INT) FROM HATBOX_MBR_INTERSECTS_ENV('PUBLIC', 'SPATIAL', -2, 2, -2, 2));
    

License

GeoDB is licensed under the MIT license.

More Information

General discussion takes place on the geodb google group. If you have any questions or comments please post a message there.

geodb's People

Contributors

jdeolive avatar jnh5y avatar jodygarnett avatar pcjericks avatar srstsavage avatar

Watchers

 avatar  avatar

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.