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

Feature: Support more formats for latitude and longitude #98

Open
2 tasks done
rushmorem opened this issue Sep 2, 2022 · 9 comments
Open
2 tasks done

Feature: Support more formats for latitude and longitude #98

rushmorem opened this issue Sep 2, 2022 · 9 comments
Labels
feature New feature or request good first issue Good for newcomers topic:surrealql This is related to the SurrealQL query language

Comments

@rushmorem
Copy link
Collaborator

Is your feature request related to a problem?

Currently these only support floats. We may want to support more formats like:-

40° 26′ 46″ N 79° 58′ 56″ W
N 40° 26′ 46″ W 79° 58′ 56″
40° 26.767' N 79° 58.933' W
40° 26′ 46″ 79° 58′ 56″, 40° 26′ 46″, 79° 58′ 56″, ...
N 40° 26.767' W 79° 58.933'
40° 26.767' 79° 58.933', 40° 26.767', 79° 58.933', ...
N 40.446° W 79.982°
40.446° N 79.982° W
40.446° 79.982°, 40.446,79.982, etc.

Describe the solution

From Tobie's comment:

We would need to write it in the parser (as opposed to defer to the that crate though, as that will be more performant. Similar to how we are parsing datetimes/durations...

Alternative methods

Using the linked crate latlon. See Tobie's comment above on this.

SurrealDB version

surreal 1.0.0-beta.7 for linux on x86_64

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@tobiemh tobiemh added feature New feature or request good first issue Good for newcomers labels Sep 2, 2022
@Hirdey-1999
Copy link

Hirdey-1999 commented Sep 18, 2022

I can help with the issue but can you please expand with the issue

@Adithya2907
Copy link

I would like to contribute to the project, and I feel that this issue would be a great place to start. Can I work on this problem, and how do I get started with it?

@koobitor
Copy link

Hi Guy,

That i understand right now surrealdb is not support string containing a pair of coordinates input should parse to Point with longitude as X and latitude as Y (natural map orientation) will enable to query.

Ref issue on #91 able to query with multipolygon right now.

This issue need to write parser form latlon string to coordinates format.

Can see more example on this
Screen Shot 2565-09-28 at 14 05 37

Best regards,
Koobitor

@Adithya2907
Copy link

Thank you for pointing me to the necessary files @koobitor. I'll get started with implementing the parser so that more formats for latitudes and longitudes are accepted.

@Adithya2907
Copy link

@tobiemh, @rushmorem I've gone through the codebase, and have a good understanding of the database engine now. I would like to get started with creating the parser to support more formats as mentioned before.
For this, do I create a new file, similar to datetime.rs and duration.rs, or do I define it inside the geometry.rs file itself?

@drdozer
Copy link

drdozer commented Nov 23, 2022

Hi - i saw this issue and thought it may be bite-sized. I've got surrealdb to compile. Is there a partial solution for this already implemented that I can help with or should I start from scratch?

@tobiemh tobiemh added the topic:surrealql This is related to the SurrealQL query language label Mar 26, 2023
clarkmcc added a commit to clarkmcc/surrealdb that referenced this issue May 1, 2023
@clarkmcc
Copy link

clarkmcc commented May 1, 2023

Hi @rushmorem, I've added support for parsing two of the example formats you specified (decimal degrees, or degree decimals). It would be great if I could get an intermediate review to make sure I'm on the right track before I add support for the remaining formats.

clarkmcc added a commit to clarkmcc/surrealdb that referenced this issue May 1, 2023
@clarkmcc
Copy link

clarkmcc commented May 1, 2023

I've added support for DD and DMS formats. Should be ready for review!

@rushmorem
Copy link
Collaborator Author

/cc @tobiemh

clarkmcc added a commit to clarkmcc/surrealdb that referenced this issue May 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request good first issue Good for newcomers topic:surrealql This is related to the SurrealQL query language
Projects
None yet
Development

No branches or pull requests

7 participants