Skip to content

Support for geospatial types - point, line, box, polygon etc #282

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

Closed
7 tasks done
avinash-anand opened this issue May 20, 2020 · 5 comments
Closed
7 tasks done

Support for geospatial types - point, line, box, polygon etc #282

avinash-anand opened this issue May 20, 2020 · 5 comments
Labels
status: ideal-for-contribution An issue that a contributor can help us with type: enhancement A general enhancement
Milestone

Comments

@avinash-anand
Copy link
Contributor

avinash-anand commented May 20, 2020

Feature Request

Please don't mind as I'm a beginner wrt requesting OSS features.
I would like to have support for geo-spatial types like point, line, polygon etc.

Is your feature request related to a problem? Please describe

Our current project is JDBC based and there we use postgis-jdbc to save our data along with geospatial data in postgresql. we save mostly coordinates (Points) or lines or polygons for some markings done on maps. We were wondering if we can use r2dbc, if it had the support for these data types.

Describe the solution you'd like

I would like to have support for geospatial types of postgresql.

Geometry type support

@mp911de mp911de added status: ideal-for-contribution An issue that a contributor can help us with type: enhancement A general enhancement labels May 20, 2020
@mp911de
Copy link
Collaborator

mp911de commented May 20, 2020

I'm not sure where the best place is for Postgres Geo functionality. The JDBC driver ships with Geo types (PGline and others), so likely we should follow the same model.

Feel free to submit a pull request containing this functionality.

@avinash-anand
Copy link
Contributor Author

I'm not sure where the best place is for Postgres Geo functionality. The JDBC driver ships with Geo types (PGline and others), so likely we should follow the same model.

Feel free to submit a pull request containing this functionality.

@mp911de , Thanks for your reply. If you could guide me little, I can give it a try. From where should I start?

@mp911de
Copy link
Collaborator

mp911de commented May 22, 2020

What seems required are two things:

  • Declaration of Geo-objects. Take a look at the geometric package of pgjdbc.
  • Creation of dynamic codecs per Geo object type. I'm not familiar with Postgres Geo types, but as it looks now, Geometry types require an OID lookup similar to the hstore support. Have a look at BuiltinDynamicCodecs that looks up Postgres types and registers codecs. See also the codec package for further reference.

Starting with a single codec for line, point or circle seems a good choice. Other than that, the contribution guide describes how to contribute by forking the repository and submitting a pull request.

mp911de pushed a commit that referenced this issue Jun 16, 2020
mp911de added a commit that referenced this issue Jun 16, 2020
Make Point final and reduce PointCodec visibility. Introduce factory method for Point type. Update documentation.

[resolves #283][#282]
mp911de added a commit that referenced this issue Jun 16, 2020
Make Point final and reduce PointCodec visibility. Introduce factory method for Point type. Update documentation.

[resolves #283][#282]
@mp911de
Copy link
Collaborator

mp911de commented Jun 16, 2020

Point support was added with #283.

mp911de pushed a commit that referenced this issue Jul 24, 2020
mp911de added a commit that referenced this issue Jul 24, 2020
Reformat code. Add null guards. Update readme.

[#282][closes #300]
mp911de pushed a commit that referenced this issue Jul 24, 2020
mp911de added a commit that referenced this issue Jul 24, 2020
Reformat code. Add null guards. Update readme.

[#282][closes #300]
avinash-anand pushed a commit to avinash-anand/r2dbc-postgresql that referenced this issue Jul 25, 2020
Make Point final and reduce PointCodec visibility. Introduce factory method for Point type. Update documentation.

[resolves pgjdbc#283][pgjdbc#282]
avinash-anand added a commit to avinash-anand/r2dbc-postgresql that referenced this issue Jul 25, 2020
avinash-anand pushed a commit to avinash-anand/r2dbc-postgresql that referenced this issue Jul 25, 2020
Reformat code. Add null guards. Update readme.

[pgjdbc#282][closes pgjdbc#300]
avinash-anand pushed a commit to avinash-anand/r2dbc-postgresql that referenced this issue Jul 25, 2020
Make Point final and reduce PointCodec visibility. Introduce factory method for Point type. Update documentation.

[resolves pgjdbc#283][pgjdbc#282]
mp911de added a commit that referenced this issue Jul 31, 2020
Add javadoc to factory methods. Add since tags. Use consistently String.format(…) for toString. Fix Path equals and hashCode. Add license headers.

Introduce TokenStream to avoid repeated Double.parse(…) calls.

Fix binary representation of Path.open as in Postgres the protocol transmits of the Path is closed so we need to negate the flag.

[closes #306][#282]
mp911de pushed a commit that referenced this issue Jul 31, 2020
Also, refactor geometry support by extracting common code into AbstractGeometryCodec

[resolves #282][#306]
mp911de added a commit that referenced this issue Jul 31, 2020
Add javadoc to factory methods. Add since tags. Use consistently String.format(…) for toString. Fix Path equals and hashCode. Add license headers.

Introduce TokenStream to avoid repeated Double.parse(…) calls.

Fix binary representation of Path.open as in Postgres the protocol transmits of the Path is closed so we need to negate the flag.

[closes #306][#282]
@mp911de mp911de added this to the 0.8.5.RELEASE milestone Jul 31, 2020
@mp911de
Copy link
Collaborator

mp911de commented Jul 31, 2020

We now support al geo-spatial types 🎉 as of 0.8.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ideal-for-contribution An issue that a contributor can help us with type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants