Code Monkey home page Code Monkey logo

h2gis's Introduction

ALERT

After several years of development, it is time to reorganize the OrbisGIS architecture to offer to the users and the developers a robust libraries and framework, a better documentation and a more user-friendly GUI. Because the OrbisGIS team is at the heart of open source communities, because it supports collective work and the sharing of tools and methods rather than reinventing the wheel, we have decided to split OrbisGIS in a two main libraries :

These libraries take profit of the FOSS ecosystem and the next OrbisGIS user interface will be developped on top of the Eclipse RCP framework and the dbeaver tool. Many dbeaver features are in line with the needs of the OrbisGIS users and its functions (SQL editor, tree database explorer, table viewer...). We are therefore thinking of adding OrbisGIS features to dbeaver and use it in replacement to the current OrbisGIS (based on DockingFrames). OrbisRCP aggregates all OrbisGIS plugins available for DBeaver. See : https://github.com/orbisgis/orbisrcp

Note that the H2GIS extension and the CTS library are still being actively developed by the OrbisGIS team.

OrbisGIS Build Status

OrbisGIS is a cross-platform open-source Geographic Information System (GIS) created by research and for research. It is leaded by CNRS within the French Lab-STICC laboratory (DECIDE team of Vannes) and licensed under GPLv3. OrbisGIS proposes new methods and techniques to model, represent, process and share spatial data, making it easy to monitor geographical territories and manage their evolution. In a world ever-increasingly aware of its ecological footprint and the relevance of sustainable development, a systematic approach to evaluating public policies is of paramount importance. Such an approach must take into account relevant environmental, social and economic factors to facilitate efficient decision making and planning. As an integrated modeling platform containing analytical tools for computing various indicators at different spatial and temporal scales, OrbisGIS is already an indispensable instrument for many. Come see what all the buzz is about!

For general information, visit our website. Feel free to contact us or use the mailing list.

Developers, check out our GitHub Wiki.

Users, please consult the on-line documentation on doc.orbisgis.org.

Quick build instructions

OrbisGIS uses Maven. To launch a full build (including the tests), run the following command:

$ mvn clean install

To run OrbisGIS using Maven:

$ cd orbisgis-dist
$ mvn exec:exec

To build a release as a standalone zip file:

cd orbisgis-dist
mvn package assembly:single

h2gis's People

Contributors

agouge avatar agueganno avatar bbrangeo avatar bedla avatar ebocher avatar ernlt avatar gourlaysama avatar gpetit avatar hwang-pku avatar j3r3m1 avatar jlleitschuh avatar mmatur avatar nicolas-f avatar spalominos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

h2gis's Issues

Transformation with a IGNF projection is impossible.

When i execute the line sql code :
CREATE TABLE contouring_noise_map_l93 AS SELECT st_transform(ST_setsrid("DATABASE"."PUBLIC"."contouring_noise_map".the_geom, 27572), 310024140) AS the_geom, idiso FROM "DATABASE"."PUBLIC"."contouring_noise_map";

( the SRID 310024140 = "IGNF:Lamb93")

I have this error message:
WARN Thread-81 - Ellipsoid cannot be defined
ERROR Thread-81 - Cannot create the CRS; SQL statement:
create table contouring_noise_map_l93 as select st_transform(ST_setsrid("DATABASE"."PUBLIC"."contouring_noise_map".the_geom, 27572), 310024140) as the_geom, idiso from "DATABASE"."PUBLIC"."contouring_noise_map" [0-175]
org.h2.jdbc.JdbcSQLException: Cannot create the CRS; SQL statement:
create table contouring_noise_map_l93 as select st_transform(ST_setsrid("DATABASE"."PUBLIC"."contouring_noise_map".the_geom, 27572), 310024140) as the_geom, idiso from "DATABASE"."PUBLIC"."contouring_noise_map" [0-175]
at org.h2.message.DbException.addSQL(DbException.java:128)
at org.h2.command.Command.executeUpdate(Command.java:265)
at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:181)
at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:156)
at org.h2gis.utilities.wrapper.StatementWrapper.execute(StatementWrapper.java:93)
at org.orbisgis.view.sqlconsole.actions.ExecuteScriptProcess.parseAndExecuteScript(ExecuteScriptProcess.java:118)
at org.orbisgis.view.sqlconsole.actions.ExecuteScriptProcess.run(ExecuteScriptProcess.java:136)
at org.orbisgis.view.background.Job.run(Job.java:79)
at org.orbisgis.view.background.RunnableBackgroundJob.run(RunnableBackgroundJob.java:71)
at java.lang.Thread.run(Thread.java:744)
Caused by: java.sql.SQLException: Cannot create the CRS
at org.h2gis.h2spatial.internal.function.spatial.crs.ST_Transform.ST_Transform(ST_Transform.java:120)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.h2.engine.FunctionAlias$JavaMethod.getValue(FunctionAlias.java:467)
at org.h2.expression.JavaFunction.getValue(JavaFunction.java:39)
at org.h2.expression.Alias.getValue(Alias.java:37)
at org.h2.command.dml.Select.queryFlat(Select.java:533)
at org.h2.command.dml.Select.queryWithoutCache(Select.java:632)
at org.h2.command.dml.Query.query(Query.java:314)
at org.h2.command.dml.Insert.insertRows(Insert.java:167)
at org.h2.command.dml.Insert.update(Insert.java:114)
at org.h2.command.ddl.CreateTable.update(CreateTable.java:183)
at org.h2.command.CommandContainer.update(CommandContainer.java:79)
at org.h2.command.Command.executeUpdate(Command.java:253)
... 8 more
Caused by: org.cts.crs.CRSException: No datum definition. Cannot create the CoordinateReferenceSystem
at org.cts.CRSHelper.createCoordinateReferenceSystem(CRSHelper.java:104)
at org.cts.CRSFactory.getCRS(CRSFactory.java:101)
at org.h2gis.h2spatial.internal.function.spatial.crs.ST_Transform.ST_Transform(ST_Transform.java:96)
... 23 more
Overall execution time: 0,073 seconds

Add "operators" functions

The following functions from the GDMS operators package must be added to H2GIS:

  • ST_GeomUnion
  • ST_GeomUnionArg
  • ST_RingBuffer

If you decide to work on this, please specify in the comments which functions you plan to implement.

ST_Is3D Method

Implement the ST_Is3D method as ISO SQL MM proposes.

Purpose: Test if a Geometry has a z-coordinate.

Definition:

CREATE METHOD ST_Is3D()
RETURNS INTEGER
FOR ST_Geometry
RETURN SELF.ST_PrivateIs3D

Description

  1. The method ST_Is3D has no input parameters.
  2. The null-call method ST_Is3D returns the value of the ST_PrivateIs3D
    attribute.

Fix CTS warnings when compiling H2GIS

When compiling H2GIS, I get 86 different warnings from org.cts.CRSHelper that look like this:

104 [main] WARN org.cts.CRSHelper - A component has already been register for key EPSG:9602.

It would be nice to fix this so that it doesn't pollute the output.
Full stacktrace

@jparty

Delete the function ST_M

Could you delete the function ST_M? (H2GIS/h2spatial/src/main/java/org/h2gis/h2spatial/internal/function/spatial/properties/ST_M.java)
Because this function is not supported by JTS and does not run in H2GIS.

Add "simplify" functions

The following functions from the GDMS simplify package must be added to H2GIS:

  • ST_PrecisionReducer
  • ST_Simplify
  • ST_SimplifyPreserveTopology

If you decide to work on this, please specify in the comments which functions you plan to implement.

Add raster functions

The following functions from the GDMS raster package must be added to H2GIS:

  • ST_Count
  • ST_CropRaster -> ST_Crop
  • ST_D8Accumulation -> ST_D8FlowAccumulation
  • ST_D8AllOutlets
  • ST_D8ConstrainedAccumulation
  • ST_D8Direction -> ST_D8FlowDirection
  • ST_D8DistanceToTheOutlet
  • ST_D8RiverDistance
  • ST_D8Slope
  • ST_D8StrahlerStreamOrder
  • ST_D8Watershed
  • ST_FillSinks
  • ST_Interpolate
  • ST_LSFactor
  • ST_PixelValue
  • ST_RasterAlgebra
  • ST_RasterToPoints
  • ST_RasterToPolygons
  • ST_RasterToXYZ
  • ST_RasterizeLine
  • ST_Resample
  • ST_Shadow
  • ST_StreamPowerIndex
  • ST_VectorizeLine
  • ST_WetnessIndex

If you decide to work on this, please specify in the comments which functions you plan to implement.

Add "convert" functions

The following functions from the GDMS convert package must be added to H2GIS:

  • ST_Force_2D
  • ST_Force_3D
  • ST_Holes
  • ST_PointsToLine
  • ST_ToMultiLine
  • ST_ToMultiPoint
  • ST_ToMultiSegments

Note: ST_InteriorPoint correponds to the SFS function ST_PointOnSurface which was already implemented in h2spatial.

If you decide to work on this, please specify in the comments which functions you plan to implement.

Possible alignment to text descritpion

I think it's more aesthetic if we put the text description with justified alignment rather than left alignment in the H2Gis site (on description or note in examples).
Can you change the CSS to this alignment?
What do you think?

Document h2spatial/Process geometries functions

  • ST_Polygonize
  • ST_PrecisionReducer
  • ST_Simplify
  • ST_SimplifyPreserveTopology
  • ST_Snap
  • ST_Split

When you start working on the documentation of one of these functions,
please say so in the comments.

Add missing unit test for ST_Explode

The signature

public static ResultSet explode(Connection connection, String tableName, String fieldName) throws SQLException {

is not covered by a unit test.

This will affect #120.

Document h2spatial/Create geometries functions

  • ST_BoundingCircle
  • ST_Expand
  • ST_Extrude
  • ST_MakeEnvelope
  • ST_MinimumRectangle
  • ST_OctogonalEnvelope

When you start working on the documentation of one of these functions,
please say so in the comments.

Shapefile reader and writer

As Postgis proposes and H2 for the CSV file format two functions tables must be transposed from gdms to H2 to read and write shapefile.
The syntax could be

SELECT * FROM SHPRead('/tmp/myshp');

SELECT * FROM SHPRead('/tmp/myshp', 'charset=UTF-8');

CALL SHPWRITE('/tmp/myshp', 'SELECT * FROM TEST', 'charset=UTF-8'');

Add miscellaneous functions

The following functions from the indicated GDMS packages must be added to H2GIS:

export:

  • ST_PLYExporter

other:

  • ST_MainDirections
  • ST_MeanSpacing

polygonize:

  • ST_Polygonize

qa:

  • ST_InternalGapFinder

trigo:

  • ST_Azimut

If you decide to work on this, please specify in the comments which functions you plan to implement.

Add "distance" functions

The following functions from the GDMS distance package must be added to H2GIS:

  • ST_FurthestPoint
  • ST_LocateAlong
  • ST_NearestPoints
  • ST_ProjectTo

If you decide to work on this, please specify in the comments which functions you plan to implement.

Add TIN functions

The following functions from the indicated GDMS packages must be added to H2GIS:

tin/analysis:

  • ST_TriangleContouring

tin/create:

  • ST_TIN

If you decide to work on this, please specify in the comments which functions you plan to implement.

Add "edit" functions

The following functions from the GDMS edit package must be added to H2GIS:

  • ST_3DReverse
  • ST_AddZ
  • ST_AddZFromRaster
  • ST_LinearInterpolation
  • ST_Normalize
  • ST_RemoveHoles
  • ST_Reverse
  • ST_SetZToExtremities
  • ST_Snap
  • ST_Split
  • ST_SplitLine

If you decide to work on this, please specify in the comments which functions you plan to implement.

Add unit tests

@gpetit and @mlecoeuvre have been adding and will continue to add examples in
their documentation on h2gis.org.

In this ticket, we will keep track of the PR numbers which contain new unit
tests to be added.

At the time of writing, new unit tests are contained in PRs:

  • #119 ST_Difference
  • #120 ST_Explode
  • #121 ST_SymDifference
  • #124 ST_ConvexHull
  • #125 ST_Intersection
  • #138 ST_CompactnessRatio
  • #140 ST_Contains
  • #145 ST_Crosses
  • #147 ST_Equals
  • #148 ST_Touches
  • #163 St_GeomFromText
  • #165 ST_LineFromWKB
  • #167 ST_MPointFromText, ST_MPolyFromText, ST_PointFromText, ST_PolyFromText
  • #168 ST_PolyFromWKB
  • #171 ST_Overlaps
  • #173 ST_Intersects
  • #174 ST_Within
  • #176 ST_Disjoint
  • #178 ST_EnvelopesIntersect
  • #180 ST_Boundary
  • #182 ST_Centroid
  • #183 ST_Dimension
  • #184 ST_Distance
  • #185 ST_EndPoint
  • #187 ST_Envelope
  • #188 ST_ExteriorRing
  • #192 ST_GeometryN, ST_PointN, ST_InteriorRingN
  • #194 ST_GeometryType
  • #195 ST_IsRing, ST_IsSimple, ST_IsEmpty, ST_Closed
  • #196 ST_Lenght, ST_X, ST_Y, ST_Z
  • #199 ST_NumGeometries, ST_NumInteriorRing, ST_NumInteriorRings, ST_NumPoints
  • #207 ST_PointOnSurface
  • ST_AsKml

Optional

If you add unit tests in the documentation, please update this list and say so
in the comments.

Document h2spatial/properties functions

  • ST_Area
  • ST_Boundary
  • ST_Centroid
  • ST_Dimension
  • ST_Distance
  • ST_EndPoint
  • ST_Envelope
  • ST_ExteriorRing
  • ST_GeometryN
  • ST_GeometryType
  • ST_InteriorRingN
  • ST_IsClosed
  • ST_IsEmpty
  • ST_IsRing
  • ST_IsSimple
  • ST_Length
  • ST_M
  • ST_NumGeometries
  • ST_NumInteriorRing
  • ST_NumInteriorRings
  • ST_NumPoints
  • ST_PointN
  • ST_PointOnSurface
  • ST_SRID
  • ST_StartPoint
  • ST_X
  • ST_Y
  • ST_Z

When you start working on the documentation of one of these functions,
please say so in the comments.

Document h2spatial/geometry-conversion functions

The following h2spatial/geometry-conversion functions need
to be documented:

  • ST_AsBinary
  • ST_AsText
  • ST_AsWKT
  • ST_GeomFromText
  • ST_LineFromText
  • ST_LineFromWKB
  • ST_MLineFromText
  • ST_MPointFromText
  • ST_MPolyFromText
  • ST_PointFromText
  • ST_PolyFromText
  • ST_PolyFromWKB

When you start working on the documentation of one of these functions,
please say so in the comments.

Document h2spatial/Edit geometries functions

  • ST_AddPoint
  • ST_AddZ
  • ST_Densify
  • ST_Interpolate3DLine
  • ST_MultiplyZ
  • ST_Normalize
  • ST_RemoveHoles
  • ST_RemovePoint
  • ST_RemoveRepeatedPoints
  • ST_Reverse
  • ST_Reverse3DLine
  • ST_UpdateZ
  • ST_ZUpdateExtremities

When you start working on the documentation of one of these functions,
please say so in the comments.

Move non-SFS functions

The following functions had been mistakenly listed as SFSQL functions:

  • ST_Dimension
  • ST_EndPoint
  • ST_Envelope
  • ST_EnvelopesIntersect
  • ST_NumGeometries
  • ST_NumInteriorRings

We may need to reorganize the code to fix this. See #178.

Add shape parameter for ST_Buffer

Currently ST_Buffer does not have a shape parameter like it did in GDMS.

We should add a string parameter with 3 possibilities: but, square or round (default).

We should add a unit test for ST_Buffer.

Document h2spatial/operators functions

  • ST_Buffer
  • ST_ConvexHull
  • ST_Difference
  • ST_Intersection
  • ST_SymDifference
  • ST_Union

When you start working on the documentation of one of these functions,
please say so in the comments.

Add "create" functions

The following functions from the GDMS create package must be added to H2GIS:

  • ST_AddVertex
  • ST_BoundingCircle
  • ST_CreateGrid
  • ST_CreatePointsGrid
  • ST_CreateWebGrid
  • ST_Densify
  • ST_Expand
  • ST_Extrude
  • ST_MakeEllipse
  • ST_MakeEnvelope
  • ST_MakeLine
  • ST_MakePoint
  • ST_MinimumDiameter
  • ST_MinimumRectangle
  • ST_OctogonalEnvelope
  • ST_RandomGeometry
  • ST_RemoveDuplicateCoordinate

If you decide to work on this, please specify in the comments which functions you plan to implement.

Difference of memory space between .shp and database

I'm working with "orbisgis-dist-4.1.0-SNAPSHOT/orbisgis.sh"

I import a shape file weighing 78 MB into an empty H2 database. Now I can see that the corresponding "database.h2.db" file weighs 144 MB. So there is a big difference.

Is there a way to optimize this point? ... knowing that in this context, some workspaces could weigh many GB.

@ebocher @nicolas-f @agouge

Document h2spatial/predicates functions

  • ST_Contains
  • ST_Crosses
  • ST_Disjoint
  • ST_EnvelopesIntersect
  • ST_Equals
  • ST_Intersects
  • ST_Overlaps
  • ST_Relate
  • ST_Touches
  • ST_Within

When you start working on the documentation of one of these functions,
please say so in the comments.

OGC SQL Conformance

SQL in the OGC Conformance is not valid:

For Conformance 1&2, insert query is invalid for geometry_columns

INSERT INTO geometry_columns VALUES (
'bridges', 'position_gid',
'bridge_geom',1, 1, 2, 0);

There are fewer columns in comparison with the create table

-- Geometry Columns
CREATE TABLE geometry_columns ( f_table_schema CHARACTER VARYING,
f_table_name CHARACTER VARYING,
f_geometry_column CHARACTER VARYING,
g_table_schema CHARACTER VARYING,
g_table_name CHARACTER VARYING,
storage_type INTEGER,
geometry_type INTEGER,
coord_dimension INTEGER,
max_ppr INTEGER,
srid INTEGER REFERENCES spatial_ref_sys,
CONSTRAINT gc_pk PRIMARY KEY (f_table_schema, f_table_name,
f_geometry_column));

In C2:

A ) is missing in all sql queries on Hex conversion

-- Bridges
INSERT INTO bridge_geom VALUES(101, 44.0, 31.0, 44.0, 31.0,
HEXTOVARBINARY('010100000000000000000046400000000000003f40');

Insert statement refers to a non existing foreign key, this leads to NULL key value (in h2)

INSERT INTO geometry_columns VALUES (
'forests', 'boundary_gid',
'forest_geom',1, 11, 2, 0);

SRID is not given and it can be null then h2 sets it to null.

SHPRead path encoding (trouble with accents)

The SHPRead is not able to parse this kind of path: /home/toto/Téléchargements/Data/ZONE_VEGETATION.SHP

ERROR [AWT-EventQueue-0] (Catalog.java:230) - Cannot load dropped data source
org.h2.jdbc.JdbcSQLException: File not found: "/home/toto/T\u00e9l\u00e9chargements/Data/ZONE_VEGETATION.SHP"; SQL statement:
CREATE TABLE `ZONE_VEGETATION` COMMENT STRINGDECODE('/home/ebocher/T\u00e9l\u00e9chargements/Data/ZONE_VEGETATION.SHP') ENGINE "org.h2gis.drivers.shp.SHPEngine" WITH "/home/ebocher/T\u00e9l\u00e9chargements/Data/ZONE_VEGETATION.SHP" [90124-174]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:332)
    at org.h2.message.DbException.get(DbException.java:172)
    at org.h2.message.DbException.get(DbException.java:149)
    at org.h2gis.drivers.shp.SHPEngine.createTable(SHPEngine.java:54)
    at org.h2gis.drivers.shp.SHPEngine.createTable(SHPEngine.java:42)
    at org.h2.schema.Schema.createTable(Schema.java:584)
    at org.h2.command.ddl.CreateTable.update(CreateTable.java:135)
    at org.h2.command.CommandContainer.update(CommandContainer.java:79)
    at org.h2.command.Command.executeUpdate(Command.java:253)
    at org.h2.jdbc.JdbcStatement.executeInternal(JdbcStatement.java:181)
    at org.h2.jdbc.JdbcStatement.execute(JdbcStatement.java:156)
    at org.h2gis.drivers.DriverManager.openFile(DriverManager.java:92)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.h2.engine.FunctionAlias$JavaMethod.getValue(FunctionAlias.java:417)
    at org.h2.expression.JavaFunction.getValue(JavaFunction.java:39)
    at org.h2.command.dml.Call.query(Call.java:66)
    at org.h2.command.CommandContainer.query(CommandContainer.java:91)
    at org.h2.command.Command.executeQuery(Command.java:196)
    at org.h2.jdbc.JdbcPreparedStatement.execute(JdbcPreparedStatement

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.