Conversation
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.
dargmuesli
left a comment
There was a problem hiding this comment.
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?
7f8948f to
6a75845
Compare
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.
|
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. |
I found https://hashrocket.com/blog/posts/juxtaposing-earthdistance-and-postgis and recommend staying with PostGIS. |
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.
|
Assuming your mean |
8fdd930 to
c8f1a9f
Compare
## [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))
|
🎉 This PR is included in version 5.0.0-beta.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
## [5.0.0](4.13.5...5.0.0) (2025-02-27) ### ⚠ BREAKING CHANGES * **role:** read usernames from secrets (#49) * **event:** allow to mark upload as header image (#144) * **index:** merge into table definitions (#147) * **address:** correct reference columns' name suffix (#140) * **invitation:** rename to guest (#122) * **event-favorite:** align to general schema (#135) * add address (#134) * **contact:** add note (#133) * add location (#114) * **event:** add full text search (#121) * **extension:** add postgis (#119) * **grafana:** remove (#107) * **timestamp:** add time zone (#92) * **notification:** align timestamp column name * **account:** rename `created` column to `created_at` ### Features * **account:** rename `created` column to `created_at` ([df18548](df18548)) * add address ([#134](#134)) ([97a8645](97a8645)) * add location ([#114](#114)) ([8d9a9d1](8d9a9d1)) * **address:** add location ([55fc3e5](55fc3e5)) * **address:** correct reference columns' name suffix ([#140](#140)) ([9039aee](9039aee)), closes [#138](#138) [#141](#141) [#138](#138) * **address:** simplify policies ([cd4787e](cd4787e)) * **contact:** add note ([#133](#133)) ([153fd3f](153fd3f)) * **device:** add ([27c156c](27c156c)) * **device:** prevent token value updates ([4bd0d0f](4bd0d0f)) * **device:** work in feedback ([9b7c451](9b7c451)) * **event-favorite:** align to general schema ([#135](#135)) ([87d45df](87d45df)) * **event:** add full text search ([#121](#121)) ([83533e9](83533e9)) * **event:** add visibility unlisted ([#126](#126)) ([759c4d4](759c4d4)) * **event:** allow to mark upload as header image ([#144](#144)) ([25e76dd](25e76dd)) * **extension:** add postgis ([#119](#119)) ([5a24dfa](5a24dfa)) * **friend:** complete the friend feature ([50c7644](50c7644)) * **friend:** draft ([c972eb1](c972eb1)) * **friends:** add tests ([93cf92d](93cf92d)) * **friends:** add tests ([df1fa0c](df1fa0c)) * **friends:** add tests ([54de3f8](54de3f8)) * **friends:** add tests ([12914f5](12914f5)) * **friends:** add tests ([8c9dbb4](8c9dbb4)) * **friends:** give names to check constraints ([eb46d17](eb46d17)) * **friendship:** improve constraint names ([24309dc](24309dc)) * **friendship:** rename `pending` enum to `requested` ([667e475](667e475)) * **friendship:** restrict update depending on friendship state ([bf599b9](bf599b9)) * **friendship:** work in feedback ([18f894e](18f894e)) * **grafana:** remove ([#107](#107)) ([960b978](960b978)) * **invitation:** rename to guest ([#122](#122)) ([49b20ed](49b20ed)) * **metadata:** rename author to creator ([#136](#136)) ([55381ff](55381ff)) * **notification:** align timestamp column name ([92b2ec2](92b2ec2)) * **role:** read usernames from secrets ([#49](#49)) ([2a413f6](2a413f6)), closes [#154](#154) * **timestamp:** add time zone ([#92](#92)) ([d36d378](d36d378)) ### Bug Fixes * **account-block:** bug fixes in functions and policies ([#139](#139)) ([8d71f87](8d71f87)) * **address:** expose creator id for insertion ([514f6bb](514f6bb)) * **device:** correct permissions ([bccfe40](bccfe40)) * **device:** tune policies ([14ca9cc](14ca9cc)) * **friendship:** add missing not-null constraint ([2119a5e](2119a5e)) * **friendship:** add usage of enum type to `sqitch.plan` ([329de43](329de43)) * **friendship:** remove status `rejected` and function `friendship_account_ids` ([c083f6c](c083f6c)) * **location:** move test function to appropriate schema ([#130](#130)) ([e5b4a36](e5b4a36)) ### Performance Improvements * **event:** early return search trigger function ([#132](#132)) ([697da38](697da38)) * **index:** merge into table definitions ([#147](#147)) ([20b8c5d](20b8c5d)), closes [#149](#149)
|
🎉 This PR is included in version 5.0.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
A new table
locationis 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.