Spatial databases embedded in gvSIG
There are several projects to provide spatial support to some Java database such as Derby, H2 or HSQLDB, but they only include to store geometries in the database and record some functions to perform some operations with them. It is not possible to integrate new indexes or new data types in the database as PostgreSQL has.
Mission of the project
Giving support to spatial indexes in some Java database such as derby, H2 or HSQLDB.
These three databases are implemented in Java and let define new functions in java so that they can be used from SQL. As a consequence, it is easy to implement a wrapper on JTS and give limited support to spatial operations. SpatialDBBox (Spatial DB in a Box) is a method, promoted by GeoTools, that is based on these ideas.
There are implementations of H2SpatialDatabase , SpatialDerby and Hsql Binding for Spatial DB in a Box. But the main problem is that they do not have any type of spatial indexing and it is necessary to scan all data to apply a filter. That is the reason why it is so important to add spatial indexes to any of those databases.
Note that several manager libraries for spatial indexes have been developed in Java, and, in fact, gvSIG uses some of them:
- JTS Quadtree
- Java Spatial Index (RTree) Library
- GeoTools QuadTree
So, the first step could be to integrate some of those libraries in the SQL engine of any of those databases. When it works the next step could be to create your own indexes. Another problem that SpatialDBBox has is that it does not recognize the geometry data type and it stores them in a binary field. So if the user tries to find out in which column a geometry is stored, there is not an automatic or easy way to do it.
PostgreSQL has a system for adding new data types to the database. It also has a mechanism to record types of indexes. Moreover, its spatial extensions record the type of geometry, a series of geometric functions and one or more index types appropriates for indexing geometries. It is possible it also has any system to find the optimizer that a spatial index may use.
This approach is interesting for giving spatial support to H2 or Derby. While the approach of SpatialDBBox is only to the group of functions that can handle geometries.
They will be defined according to the scope of each project.
Is needed a tutor?: