Skip to content

Conversation

@aykut-bozkurt
Copy link
Member

We already write postgis geometry column as WKB formatted binary, as specified by geoparquet spec.

With this PR, we also write basic geoparquet metadata to key value metadata of the parquet file. We support only basic info (required by the spec) to be interoperable with duckdb.

@codecov
Copy link

codecov bot commented Jan 13, 2025

Codecov Report

Attention: Patch coverage is 98.02956% with 4 lines in your changes missing coverage. Please review.

Project coverage is 92.65%. Comparing base (fcb5036) to head (7e55c36).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/type_compat/geometry.rs 93.93% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #94      +/-   ##
==========================================
+ Coverage   92.54%   92.65%   +0.10%     
==========================================
  Files          75       75              
  Lines        9621     9813     +192     
==========================================
+ Hits         8904     9092     +188     
- Misses        717      721       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

We already write postgis geometry column as WKB formatted binary, as specified by
[geoparquet spec](https://geoparquet.org/releases/v1.0.0-rc.1/).

With this PR, we also write basic geoparquet metadata. We support only basic info
to be interoperable with duckdb.

impl GeometryType {
fn from_typmod(typmod: i32) -> Option<Self> {
// taken from Postgis source code
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could have taken it from wikipedia :)
https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry

(postgis source code is GPL, so this comment might raise some eyebrows, though it's obviously not copied)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

although I guess you're referring to the first line, maybe just "see postgis:"

Copy link
Collaborator

@marcoslot marcoslot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does the reader need support as well?

@aykut-bozkurt
Copy link
Member Author

does the reader need support as well?

Yep, when the attribute (in tupledesc) is geometry, we convert bytes to it.

@aykut-bozkurt aykut-bozkurt merged commit 30fb0c6 into main Jan 20, 2025
6 checks passed
@aykut-bozkurt aykut-bozkurt deleted the aykut/geoparquet branch January 20, 2025 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants