{"id":13733929,"url":"https://github.com/orbisgis/h2gis","last_synced_at":"2026-01-23T08:48:28.004Z","repository":{"id":7709593,"uuid":"9074548","full_name":"orbisgis/h2gis","owner":"orbisgis","description":"A spatial extension of the H2 database.","archived":false,"fork":false,"pushed_at":"2025-04-10T10:01:11.000Z","size":53059,"stargazers_count":213,"open_issues_count":45,"forks_count":65,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-10T10:52:32.811Z","etag":null,"topics":["database","ogc","spatial","standards"],"latest_commit_sha":null,"homepage":"http://www.h2gis.org","language":"PLpgSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/orbisgis.png","metadata":{"files":{"readme":"docs/README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-03-28T10:12:05.000Z","updated_at":"2025-04-10T10:01:16.000Z","dependencies_parsed_at":"2023-09-24T01:34:04.330Z","dependency_job_id":"f160f528-9057-417d-bbaa-2e813114c6c0","html_url":"https://github.com/orbisgis/h2gis","commit_stats":{"total_commits":2386,"total_committers":30,"mean_commits":79.53333333333333,"dds":0.7657166806370495,"last_synced_commit":"35d32ca15c39a149dc664dfe8b636e602e36cc4b"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbisgis%2Fh2gis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbisgis%2Fh2gis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbisgis%2Fh2gis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/orbisgis%2Fh2gis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/orbisgis","download_url":"https://codeload.github.com/orbisgis/h2gis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253045526,"owners_count":21845718,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","ogc","spatial","standards"],"created_at":"2024-08-03T03:00:51.027Z","updated_at":"2026-01-11T17:48:22.137Z","avatar_url":"https://github.com/orbisgis.png","language":"PLpgSQL","funding_links":[],"categories":["Database","Java"],"sub_categories":[],"readme":"# H2GIS\n[![GitHub](https://img.shields.io/github/license/orbisgis/h2gis.svg)](https://github.com/orbisgis/h2gis/blob/master/LICENSE.md) \n\n![](./images/banner/laptop_documentation.png)\n\nH2GIS is a spatial extension of the [H2](http://www.h2database.com/) database engine in the spirit of [PostGIS](http://postgis.net/). It adds support for managing spatial features and operations on the new `Geometry` type of H2, the [Open\nGeospatial Consortium](http://www.opengeospatial.org/) (OGC) [Simple Features for SQL](http://www.opengeospatial.org/standards/sfs) (SFSQL) functions and additional spatial functions that we (the [CNRS](http://www.cnrs.fr/))\ndevelop. \n\nH2GIS is the root project for the [OrbisGIS](http://www.orbisgis.org/) data management library. It contains tools to run geometry analysis and read/write geospatial file formats.\n\nH2GIS is licensed under the [LGPL 3](https://www.gnu.org/licenses/lgpl-3.0.fr.html) license terms.\n\n## Official website \u0026 documentation\n\nTo find out more about this tool, including detailed documentation, please visit the official website [www.h2gis.org](http://www.h2gis.org/).\n\n## Download\n\nTo download the last H2GIS stable release:\n\n* Go to [http://www.h2gis.org](http://www.h2gis.org)\n* Or, if you are familiar with GitHub, you can directly have a look to the [\"Releases\" page](https://github.com/orbisgis/h2gis/releases).\n\n## `GEOMETRY` data type\n\nSince H2 2.2.X version, the [geometry](https://h2database.com/html/datatypes.html?highlight=geometry\u0026search=geometry#geometry_type) encoding to store the value in H2 is the EWKB (extended well-known binary) format. The [EWKB](https://postgis.net/docs/using_postgis_dbmanagement.html#EWKB_EWKT) format is not an OGC standard, but a PostGIS specific format that includes the spatial reference system (SRID) identifier.\nIts textual representation using the WKT (well-known text) uses the pattern :\n\n```\n'SRID=4326;POINT(0 0)'\n```\nH2 supports `POINT`, `LINESTRING`, `POLYGON`, `MULTIPOINT`, `MULTILINESTRING`, `MULTIPOLYGON`, and `GEOMETRYCOLLECTION` geometries with the following coordinate dimension 2D (`XY`), Z (`XYZ`), M (`XYM`), and ZM (`XYZM`).\n\nH2 provides the same syntax as PostGIS to build a table with a geometry data type. Below are some examples:\n\n```sql\nCREATE TABLE mygeometrytable (ID INTEGER, GEOM GEOMETRY);\nCREATE TABLE mygeometrytable (ID INTEGER, GEOM GEOMETRY(POINT));\nCREATE TABLE mygeometrytable (ID INTEGER, GEOM GEOMETRY(POINT, 4326));\nCREATE TABLE mygeometrytable (ID INTEGER, GEOM GEOMETRY(POINTZ, 4326));\nCREATE TABLE mygeometrytable (ID INTEGER, GEOM GEOMETRY(POINTZM, 4326));\nCREATE TABLE mygeometrytable (ID INTEGER, GEOM GEOMETRY(POINTM, 4326));\n```\n\n## Spatial functions\n\n`h2gis-functions` is the main module of the H2GIS distribution. \nIt extends H2 by adding analysis capabilities,including:\n* spatial operators (`ST_Intersection`, `ST_Difference`, *etc.*)\n* spatial predicates (`ST_Intersects`, `ST_Contains`, *etc.*)\n* additional custom spatial SQL functions that are not defined in [Simple Features for SQL](http://www.opengeospatial.org/standards/sfs) (SFSQL), such as `ST_Extent`, `ST_Explode`, `ST_MakeGrid`\n\nH2GIS contains a set of driver functions (I/O) to read/write file formats such as `.shp`, `.dbf`, `.geojson`, `.gpx`.\n\nThis I/O package include 2 implementations of `TableEngine` that allow you to immediatly 'link' a table with a shape file.\n\nIt include also file copy functions (import):\n* `SHPREAD()` and `SHPWRITE()` to read and write Esri shape files,\n* `DBFREAD()` and `DBFWRITE()` to read and write DBase III files,\n* `GeoJsonRead()` and `GeoJsonWrite()` to read and write GeoJSON files,\n* `GPXRead()` to read GPX files.\n\n## Usage\n\nH2GIS requires Java 11. Run `maven clean install -P standalone` in the H2GIS's root directory.\nIf you want to build the native version of H2GIs (lib and executable), you need [GraalVM 22.3.5](https://www.oracle.com/downloads/graalvm-downloads.html#license-lightbox). For more informations, open the [detailed documentation](./NATIVE-COMPILATION.md)\n\nIn the folder `h2gis-dist/target/` you will find a zip file `h2gis-standalone-bin.zip`. Unzip the file and then open `h2gis-dist-xxx.jar`. It will open a browser based console application.\n\n```bash\n~ $ unzip h2gis-standalone-bin.zip\n~ $ cd h2gis-standalone\n~/h2gis-standalone $ java -jar h2gis-dist-xxx.jar\n```\nClick `Connect` in the web interface.\n\nYou can now [create a database](http://www.h2database.com/html/quickstart.html) and run the following commands to add spatial features (do it only after the creation of a new database):\n\n#### Compiling in native code\n\nH2GIS uses graalvm to be compiled in native code. To compile h2gis in native code, you need to run 'maven clean install -P native'. This will build the native version of H2GIS for the OS you're currently running.\n\n\n### Initialize the H2GIS extension\n\nTo initialize the H2GIS extension apply the SQL syntax:\n\n```sql\nCREATE ALIAS IF NOT EXISTS H2GIS_SPATIAL FOR \"org.h2gis.functions.factory.H2GISFunctions.load\";\nCALL H2GIS_SPATIAL();\n```\n\n### Start playing with H2GIS\n\nWhen the functions are installed you can open a shapefile by calling the following SQL query:\n\n```sql\nCALL FILE_TABLE('/home/user/myshapefile.shp', 'tablename');\n```\nThis special table will be immediatly created (no matter the file size). The content will allways be synchronized with the file content.\n\nYou can also copy the content of the file into a regular H2 table:\n\n```sql\nCALL SHPREAD('/home/user/myshapefile.shp', 'tablename');\n```\n\nOr copy the content of a spatial table in a new shape file:\n\n```sql\nCALL SHPWRITE('/home/user/newshapefile.shp', 'tablename');\n```\n\n## Support - contribute\n\nH2GIS is open, so we welcome all contributions to this project! You can contribute in many ways:\n* bug report,\n* code optimization / correction,\n* new function implementation,\n* documentation,\n* participation to discussions / questions on H2GIS GitHub repo or anywhere else,\n* ...\n\n### Contributor License Agreement\n\nFor legal reasons, (code / documentation) contributors are asked to provide a **Contributor License Agreement** (CLA). \n\nTo do so, contributors just have to **add the following statement in the description of their Pull Request** (PR):\n\n\u003e \"I wrote the code, it's mine, and I'm providing it to H2GIS for distribution licensed under the [LGPL 3.0](http://www.gnu.org/copyleft/lgpl.html).\"\n\n\n## Include H2GIS into projects\n\nYou can include H2GIS in your project thanks to Maven repositories.\n\nFrom maven central, check https://search.maven.org/artifact/org.orbisgis/h2gis/2.2.3/bundle\n\nTo use the current snapshot, just add the following lines in your `pom.xml` file\n\n```xml\n\u003crepository\u003e\n  \u003cid\u003eorbisgis-snapshot\u003c/id\u003e\n  \u003cname\u003eOrbisGIS sonatype snapshot repository\u003c/name\u003e\n  \u003curl\u003ehttps://oss.sonatype.org/content/repositories/snapshots/\u003c/url\u003e\n\u003c/repository\u003e\n```\n\n## Acknowledgements\n\nMany thanks to those who have reported bugs or provided patches. It helps us a lot!\n\nH2GIS is based on amazing open source softwares. So we would like to thank:\n\n* [Thomas Mueller](https://github.com/thomasmueller), [Noel Grandin](https://github.com/grandinj) and [Evgenij Ryazanov](https://github.com/katzyn) from the [H2 database community](http://www.h2database.com),\n* [Martin Davis](https://github.com/dr-jts) from the [JTS Topology Suite community](https://github.com/locationtech/jts),\n* Michaël Michaud from [IGN](https://www.ign.fr/) and [OpenJump community](https://github.com/openjump-gis), for creating JTransfoCoord, the father of [CTS](https://github.com/orbisgis/cts) used to manage projections in H2GIS\n\n## Team\n\nH2GIS is leaded by scientists and engineers in GIS and computer sciences from [CNRS](https://www.cnrs.fr/) within the French [Lab-STICC](https://labsticc.fr/fr) laboratory ([DECIDE](https://labsticc.fr/fr/equipes/decide) team of [Vannes](https://www.openstreetmap.org/relation/192306)).\n\nH2GIS is also actively supported by the french [UMRAE](https://www.umrae.fr/) laboratory, which contribute to code and the documentation. \n\nYou can contact the team through GitHub, or by email at `info` at `h2gis` dot `org`\n\n\n## Fundings\n\nH2GIS is funded by public research programs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbisgis%2Fh2gis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forbisgis%2Fh2gis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forbisgis%2Fh2gis/lists"}