Changes the database engine to django.contrib.gis.db.backends.postgis
@MajidBenam as far as I can see this doesn't break any existing functionality of the db and django app, but this could be something to check
Adds map model and db migration
This is currently specific to one test dataset, so I may end up removing this model and replacing with another, or multiple, with one for each spatial dataset
Adds map view
Instructions on how to add PostGIS extension to database
Command file used for populating spatial data table, with instructions
Again, this is specific to the test dataset and model, but the same approach can be followed for subsequent datasets
Template for page that displays the map
Dropdowns to select which polities to display by start and end year
All shapes where the polity start or end year overlaps with the selected range will be displayed
Clicking a shape will show the basic info from the test dataset
Reviewer
@MajidBenam Up to you, but if you wanted you could test this by following the local setup instructions and test whether the map view works for you
A few things to bear in mind:
As mentioned above, a lot of this code is specific to the test dataset "Macrostate shapefiles" - the download link is included in the doc
Currently there is a hardcode to the local installation of the required GDAL and GEOS libraries in the local settings file
There are some macOS specific parts in the local setup instructions, which I have made clear, but if you're using a different OS you could add some suggestions there
Changes
django.contrib.gis.db.backends.postgis
Reviewer
@MajidBenam Up to you, but if you wanted you could test this by following the local setup instructions and test whether the map view works for you
A few things to bear in mind: