-
Notifications
You must be signed in to change notification settings - Fork 17
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
WIP: [8472] Migrate project point to GeoDjango and add a new serializer mixin to convert between gis and geojson #1765
base: main
Are you sure you want to change the base?
Conversation
3599699
to
f89db5d
Compare
@goapunk what's your concern at this point? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this surgical operation :)
It needs a good docs, with payload example and an explanation on why we keep both paradigms, and maybe in the future all map based modules should migrate to django gis
name="point", | ||
), | ||
migrations.AddField( | ||
model_name="project", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think once data has migrated wth migrate_project_point_field
and old point
filed is removed you can just rename the field from geos_point
back to point
, but safer in a new migration. And no need for migrate_project_geos_point_field
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sadly the RenameField
migration doesn't work. It just gives a cryptic error. I assume it's because the old field is a normal sqlite field and the new one is a spatialite gis field, but that's more of a guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will have a look again just in case I missed something
+ ": " | ||
+ str(geojson_point) | ||
) | ||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this log warning be showing in sentry? otherwise i am afraid we will forget to check when deloying to prod/stage
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, it won't show up in sentry
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd locally test the migration with the prod db though
@partizipation this PR, introducing django.gis for storing geopoints in the database |
points as GeoDjango to the database for better filtering capabilites and serializes them as geojson features. - add PointInPolygon validator which validates that a given point is in the provided polygon.
f89db5d
to
5cbff12
Compare
@m4ra landing this means we have to enable postgis on all our platforms using a4, this also means we need changes in the admin repo |
This is a first attempt to move geographical locations from being stored as plain json/geojson to GeoDjango. This will allow us to filter for locations on a database level.
Tasks