https://github.com/sheinbergon/dremio-udf-gis
OGC/GIS functions and extensions for Dremio
https://github.com/sheinbergon/dremio-udf-gis
dremio dremio-arrow epsg esri geometry geospatial geotools gis java jts jts-topology-suite postgis proj4
Last synced: 2 months ago
JSON representation
OGC/GIS functions and extensions for Dremio
- Host: GitHub
- URL: https://github.com/sheinbergon/dremio-udf-gis
- Owner: sheinbergon
- License: apache-2.0
- Created: 2022-04-09T19:22:43.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-11-02T22:08:11.000Z (12 months ago)
- Last Synced: 2025-07-11T21:37:22.823Z (3 months ago)
- Topics: dremio, dremio-arrow, epsg, esri, geometry, geospatial, geotools, gis, java, jts, jts-topology-suite, postgis, proj4
- Language: Java
- Homepage:
- Size: 297 KB
- Stars: 27
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/sheinbergon/dremio-udf-gis/blob/master/LICENSE)
[](https://github.com/sheinbergon/dremio-udf-gis/actions?query=workflow%3Arelease-actions)
[](https://github.com/sheinbergon/dremio-udf-gis/releases/latest)
[](https://search.maven.org/search?q=g:org.sheinbergon%20a:dremio-udf-gis*)
[](https://coveralls.io/github/sheinbergon/dremio-udf-gis)
[](https://liberapay.com/sheinbergon/donate)# Dremio Geo-Spatial Extensions
### What you get
- Widespread OGC implementation for SQL (adheres to PostGIS standards)
- Supported input formats: `WKT`, `WKB (HEX or BINARY)`
- Supported output formats: `WKT`, `WKB`, `GeoJSON`
- Easily installable Maven-Central/Github artifacts shaded jar artifact
- Dremio CE version compatibility (new versions will be released with each community edition)
- Up-2-date Proj4J & JTS geometry based implementation### Sponsorship
Enjoying my work? A show of support would be much obliged :grin:
### Installation
- Take the shaded jar for the desired version and place inside your Dremio installation (`$DREMIO_HOME/jars/3rdparty`)
- Restart your Dremio server(s)
- Rejoice! (and see the [WIKI](https://github.com/sheinbergon/dremio-udf-gis/wiki) for detailed usage instructions)#### Version Compatibility
##### Actively Maintained
| Library Version | Dremio Version |
|-----------------|----------------|
| 0.16.x | 25.0.5 |
| 0.18.x | 25.1.1 |##### Legacy
| Library Version | Dremio Version |
|-----------------|----------------|
| 0.2.x | 20.1.x |
| 0.3.x | 21.1.x |
| 0.4.x | 21.2.x |
| 0.5.x | 22.0.x |
| 0.6.x | 22.1.x |
| 0.7.x | 23.0.x |
| 0.8.x | 23.1.x |
| 0.9.x | 24.0.x |
| 0.10.x | 24.1.x |
| 0.11.x | 24.2.x |
| 0.12.x | 24.3.x |
| 0.14.x | 25.0.0 |### Usage Notes
As opposed to PostGIS, Dremio is only a query engine based on existing/projected data sources/lakes.
That means that `Geometry` is not a natively supported data type, and you can only access it if
it's being properly projected from the data sources (For example, PostGIS Geometry is read as an `EWKB` HEX encoded string).In order to successfully use the provided GIS functions, you must first make sure the geometry is in `WKB (BINARY)` format.
If it's not, you need to decode it:- if the input is in `WKT` format, use `ST_GeomFromText`
- if the input is a HEX encoded`WKB`, use Dremio's `FROM_HEX`This library uses Dremios' Arrow buffers (`ArrowBuf`) to maintain geometry data in binary (`WKB`) format (for performance and efficiency)
when interchanging it between GIS functions, which is of course undecipherable for the naked eye. When running queries from the UI,
`WKB` output will always be base64 encoded.In order to resolve Data back to human-readable format (`WKT`), use `ST_AsText`/`ST_AsGeoJson`
Example:
```sql
SELECT ST_AsText(
ST_Difference(
ST_GeomFromText('LINESTRING(50 100, 50 200)'),
ST_GeomFromText('LINESTRING(50 50, 50 150)')
))
```### Roadmap
- Frequent version/dependency updates
- Add more OGC/PostGIS matching functionality
- Add Geography type support### Noteworthy Mentions
Work in this repository was originally based on the following sources:
- [Apache Drill GIS Functionality](https://github.com/apache/drill/tree/master/contrib/udfs/src/main/java/org/apache/drill/exec/udfs/gis)
- [Christy Haragan's initial port](https://github.com/christyharagan/dremio-gis)