Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ST_GeoHash, ST_Box2dFromGeoHash, ST_PointFromGeoHash #947

Merged
merged 1 commit into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rust/geodatafusion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ arrow-schema = "53.3"
async-stream = { version = "0.3", optional = true }
async-trait = { version = "0.1", optional = true }
geo = "0.29.3"
geohash = "0.13.1"
geo-traits = "0.2"
geoarrow = { path = "../geoarrow", features = ["flatgeobuf"] }
thiserror = "1"
Expand Down
6 changes: 3 additions & 3 deletions rust/geodatafusion/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,15 @@ Spatial extensions for [Apache DataFusion](https://datafusion.apache.org/), an e

| Name | Implemented | Description |
| -------------------------- | ----------- | ------------------------------------------------------------------------------------------------------ |
| ST_Box2dFromGeoHash | | Return a BOX2D from a GeoHash string. |
| ST_Box2dFromGeoHash | | Return a BOX2D from a GeoHash string. |
| ST_GeomFromGeoHash | | Return a geometry from a GeoHash string. |
| ST_GeomFromGML | | Takes as input GML representation of geometry and outputs a PostGIS geometry object |
| ST_GeomFromGeoJSON | | Takes as input a geojson representation of a geometry and outputs a PostGIS geometry object |
| ST_GeomFromKML | | Takes as input KML representation of geometry and outputs a PostGIS geometry object |
| ST_GeomFromTWKB | | Creates a geometry instance from a TWKB ("Tiny Well-Known Binary") geometry representation. |
| ST_GMLToSQL | | Return a specified ST_Geometry value from GML representation. This is an alias name for ST_GeomFromGML |
| ST_LineFromEncodedPolyline | | Creates a LineString from an Encoded Polyline. |
| ST_PointFromGeoHash | | Return a point from a GeoHash string. |
| ST_PointFromGeoHash | | Return a point from a GeoHash string. |
| ST_FromFlatGeobufToTable | | Creates a table based on the structure of FlatGeobuf data. |
| ST_FromFlatGeobuf | | Reads FlatGeobuf data. |

Expand Down Expand Up @@ -212,7 +212,7 @@ Spatial extensions for [Apache DataFusion](https://datafusion.apache.org/), an e
| ST_AsSVG | | Returns SVG path data for a geometry. |
| ST_AsTWKB | | Returns the geometry as TWKB, aka "Tiny Well-Known Binary" |
| ST_AsX3D | | Returns a Geometry in X3D xml node element format: ISO-IEC-19776-1.2-X3DEncodings-XML |
| ST_GeoHash | | Return a GeoHash representation of the geometry. |
| ST_GeoHash | | Return a GeoHash representation of the geometry. |

### Operators

Expand Down
4 changes: 4 additions & 0 deletions rust/geodatafusion/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ pub(crate) enum GeoDataFusionError {

#[error(transparent)]
GeoArrow(#[from] GeoArrowError),

#[error(transparent)]
GeoHash(#[from] geohash::GeohashError),
}

/// Crate-specific result type.
Expand All @@ -28,6 +31,7 @@ impl From<GeoDataFusionError> for DataFusionError {
GeoDataFusionError::Arrow(err) => DataFusionError::ArrowError(err, None),
GeoDataFusionError::DataFusion(err) => err,
GeoDataFusionError::GeoArrow(err) => DataFusionError::External(Box::new(err)),
GeoDataFusionError::GeoHash(err) => DataFusionError::External(Box::new(err)),
}
}
}
Loading
Loading