Geodb
Spatial database bindings for Java.
Install / Use
/learn @jdeolive/GeodbREADME
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.zipfile -
Update the
PATHenvironment variable to includegeodb-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.
Related Skills
feishu-drive
340.5k|
things-mac
340.5kManage Things 3 via the `things` CLI on macOS (add/update projects+todos via URL scheme; read/search/list from the local Things database)
clawhub
340.5kUse the ClawHub CLI to search, install, update, and publish agent skills from clawhub.com
postkit
PostgreSQL-native identity, configuration, metering, and job queues. SQL functions that work with any language or driver
