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

feat!: add location #114

Merged
merged 13 commits into from
Jan 25, 2025
Merged

feat!: add location #114

merged 13 commits into from
Jan 25, 2025

Conversation

sthelemann
Copy link
Contributor

A new table location is created to accommodate location data of an account or an event based on GPS coordinates. The new function `distance' calculates the linear distance between two locations.

A new table `location` is created to accommodate location data of an account or an event based on GPS coordinates. The new function `distance' calculates the linear distance between two locations.
@sthelemann sthelemann requested a review from dargmuesli January 16, 2025 16:46
Copy link
Member

@dargmuesli dargmuesli left a comment

Choose a reason for hiding this comment

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

Thank you for the submission, there are just a few lines that likely weren't intended to be submit as is.

What do you think about the earthdistance module?

src/deploy/table_event.sql Outdated Show resolved Hide resolved
src/deploy/table_location.sql Outdated Show resolved Hide resolved
src/deploy/table_location.sql Outdated Show resolved Hide resolved
src/sqitch.plan Outdated Show resolved Hide resolved
src/deploy/table_location.sql Outdated Show resolved Hide resolved
src/deploy/table_location.sql Outdated Show resolved Hide resolved
@dargmuesli dargmuesli changed the title feat(location): add location data feat: add location Jan 17, 2025
src/deploy/table_location.sql Outdated Show resolved Hide resolved
src/deploy/table_location.sql Outdated Show resolved Hide resolved
src/deploy/table_location.sql Outdated Show resolved Hide resolved
Copy link
Member

@dargmuesli dargmuesli left a comment

Choose a reason for hiding this comment

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

Approved by mistake

@dargmuesli dargmuesli force-pushed the feat/gps-coordinates branch from 7f8948f to 6a75845 Compare January 19, 2025 19:46
@dargmuesli dargmuesli changed the base branch from master to beta January 19, 2025 20:04
sthelemann and others added 4 commits January 21, 2025 12:12
Instead of working with the original GPS coordinates we use the data type GEOMETRY from the PostGIS extension. Table `maevs.location`was dropped in favor of GEOMETRY typed columns in tables `maevsi_private.account' and `maevsi.event'. A collection of location related functions was added in a single source code file `function_package_location.sql`similar to the package feature in Oracle which is missing in PostgreSQL.
Necessary for the Postgraphile PostGIS module.
src/verify/index_account_location.sql Outdated Show resolved Hide resolved
src/revert/table_location.sql Outdated Show resolved Hide resolved
src/verify/table_location.sql Outdated Show resolved Hide resolved
@dargmuesli
Copy link
Member

I'm working on providing a postgraphile image that includes its PostGIS plugin over at https://github.com/maevsi/postgraphile. Also, in my testing, the geography gave way better results than geometry so I switched those.

@sthelemann
Copy link
Contributor Author

What do you think about the earthdistance module?

I found https://hashrocket.com/blog/posts/juxtaposing-earthdistance-and-postgis and recommend staying with PostGIS.

@sthelemann
Copy link
Contributor Author

Also, in my testing, the geography gave way better results than geometry so I switched those.

Calculations using GEOMETRY instead of GEOMETRY are slower, so I thought we couild live with a trade-off in accuracy. I have been assuming that distances between e.g. New York and Berlind are irrelevent because we focus on a local/regional scope.

See https://postgis.net/docs/manual-3.5/using_postgis_dbmanagement.html#PostGIS_Geometry, section 4.3.3, for more details.

Queries on dictionary tables were added to the  verification scripts for spatial indexes.
@dargmuesli
Copy link
Member

Assuming your mean GEOGRAPHY is slower than GEOMETRY, I chose GEOGRAPHY over GEOMETRY still as I see the case of an incorrect distance to events outside of Germany to be more confusing and obvious to users than a response time increase of apparently 1-20 milliseconds.

@dargmuesli dargmuesli changed the title feat: add location feat!: add location Jan 25, 2025
@dargmuesli dargmuesli force-pushed the feat/gps-coordinates branch from 8fdd930 to c8f1a9f Compare January 25, 2025 20:16
src/sqitch.plan Show resolved Hide resolved
src/sqitch.plan Outdated Show resolved Hide resolved
Copy link
Member

@dargmuesli dargmuesli left a comment

Choose a reason for hiding this comment

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

Looking good!

@dargmuesli dargmuesli merged commit 8d9a9d1 into beta Jan 25, 2025
5 checks passed
@dargmuesli dargmuesli deleted the feat/gps-coordinates branch January 25, 2025 20:20
maevsi-bot pushed a commit that referenced this pull request Jan 25, 2025
## [5.0.0-beta.3](5.0.0-beta.2...5.0.0-beta.3) (2025-01-25)

### ⚠ BREAKING CHANGES

* add location (#114)
* **event:** add full text search (#121)
* **extension:** add postgis (#119)
* **grafana:** remove (#107)
* **timestamp:** add time zone (#92)

### Features

* **account:** add login using email address ([#112](#112)) ([937d255](937d255))
* **account:** add possibility to block ([#73](#73)) ([4ab872e](4ab872e))
* **achievement:** add early bird achievement ([#111](#111)) ([0238bea](0238bea))
* add language enumeration ([76a1465](76a1465))
* add location ([#114](#114)) ([8d9a9d1](8d9a9d1))
* **contact:** add language ([669570f](669570f))
* **contact:** add nickname ([8b7169a](8b7169a))
* **contact:** add timezone ([02da0f9](02da0f9))
* **event_upload:** adjust policies. ([23eb8f4](23eb8f4))
* **event-category-mapping:** check if invited ([4ba7dac](4ba7dac))
* **event:** add full text search ([#121](#121)) ([83533e9](83533e9))
* **event:** add visibility unlisted ([#126](#126)) ([759c4d4](759c4d4))
* **event:** assign images to events ([f4822f8](f4822f8))
* **event:** mark events as favourite ([#109](#109)) ([7b75524](7b75524))
* **extension:** add postgis ([#119](#119)) ([5a24dfa](5a24dfa))
* **grafana:** remove ([#107](#107)) ([960b978](960b978))
* **invitation:** add update metadata ([f493fe4](f493fe4))
* **invitation:** column names prefixed ([2e29431](2e29431))
* **invitation:** provide flattened invitations ([119b0dd](119b0dd))
* **policy:** add policy to recommendation tables ([280f47b](280f47b))
* **recommendation:** add enum and tables needed for event recommendation ([7fb5e21](7fb5e21))
* **recommendation:** several modifications to db schema ([8581ad0](8581ad0))
* **revert:** add revert for recommendation tables ([cff0b7f](cff0b7f))
* **schema:** fix small errors and build schema ([3183da0](3183da0))
* **table:** add creation timestamps ([d8d142d](d8d142d))
* **timestamp:** add time zone ([#92](#92)) ([d36d378](d36d378))
* **verify:** add verification for event recommendation tables ([1d6bb59](1d6bb59))

### Bug Fixes

* **account-block:** remove bug in function, create new table function ([#125](#125)) ([35b22b4](35b22b4))
* **build:** commit forgotten files ([d554d0f](d554d0f))
* **event-upload:** work in feedback ([678ddfc](678ddfc))
* **invitation-flat:** work in feedback ([6ac75ac](6ac75ac))
* **invoker-account-id:** grant execute for tusd ([#123](#123)) ([7245225](7245225))
* **legal-term-acceptance:** omit update and delete ([555e031](555e031))
* omit update for creation timestamps ([084ad1e](084ad1e))
* **policy:** fix user check in event category mapping policy ([3dfd96a](3dfd96a))
* **role:** drop before creation ([#106](#106)) ([fecd16e](fecd16e))
* schedule release ([6e32e10](6e32e10))
* schedule release ([7dbc9bb](7dbc9bb))
* **schema:** remove table prefix so schema can be build ([cc5be2d](cc5be2d))
@maevsi-bot
Copy link

🎉 This PR is included in version 5.0.0-beta.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants