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

GEOMETRY type #30

Open
bkanuka opened this issue Sep 17, 2022 · 8 comments
Open

GEOMETRY type #30

bkanuka opened this issue Sep 17, 2022 · 8 comments

Comments

@bkanuka
Copy link

bkanuka commented Sep 17, 2022

Both BigQuery and Postgres (with postgis extension) support a GEOMETRY data type. Will bigquery_fdw work with this?

@gabfl
Copy link
Owner

gabfl commented Sep 17, 2022

Hi @bkanuka , if they both have the data type and they work the same way, it's easy to add and I am happy to do it but would you be able to test the pull request on your hand?

@bkanuka
Copy link
Author

bkanuka commented Sep 17, 2022

Absolutely I would test. They are the same type and are 90% the same. There's some implementation details of geometric functions that differ, but reading/writing wise should be identical

@gabfl
Copy link
Owner

gabfl commented Sep 17, 2022

@bkanuka I can see the data type on PostGIS here: https://postgis.net/docs/reference.html#PostGIS_Types

However on BQ I checked https://cloud.google.com/bigquery/docs/reference/standard-sql/data-types and https://cloud.google.com/bigquery/docs/geospatial-data and I do not see GEOMETRY, only GEOGRAPHY, are they interchangeable in this instance? Or am-I missing something?

@bkanuka
Copy link
Author

bkanuka commented Sep 17, 2022

So sorry on my phone opening tickets late at night...
You're right. It's GEOGRAPHY for both.

@gabfl
Copy link
Owner

gabfl commented Sep 17, 2022

@bkanuka

Ok Sounds good! I created this PR: #30

I mapped both PostGIS types geometry and geography to BigQuery's GEOGRAPHY data type.

Can you try it and let me know?

The steps should be:

  1. Clone the repo and checkout the branch PostGIS-datatypes-support
  2. Follow the steps here: https://github.com/gabfl/bigquery_fdw/blob/main/README.md#installation-on-debianubuntu
  3. Instead of pip3 install bigquery-fdw, run pip3 install .

Give me some feedback on the results and I will push the new version to Pypi

@gabfl
Copy link
Owner

gabfl commented Oct 18, 2022

@bkanuka did you get a chance to review this?

@mbyrne00
Copy link

Hi @bkanuka @gabfl - is there any appetite to continue with PostGIS Geometry -> BQ Geography?

@bkanuka
Copy link
Author

bkanuka commented Nov 11, 2024

Sorry, no 😕 I'm no longer at the company that was considering using this

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

No branches or pull requests

3 participants