-
Notifications
You must be signed in to change notification settings - Fork 0
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(Fmu): Download shapefiles from Admin #499
base: develop
Are you sure you want to change the base?
Conversation
When I was looking for some online shapefile tester, the second google search suggestion was "shapefile must die" haha. I wonder if actually simpler geojson is not enough for our case. Although, I tested and the exported shapefile was correctly imported into mapshaper.org. |
3fd4e3b
to
71e168f
Compare
@@ -19,6 +19,29 @@ def scoped_collection | |||
scope -> { I18n.t("active_admin.all") }, :all, default: true | |||
scope -> { I18n.t("active_admin.free") }, :filter_by_free_aa | |||
|
|||
batch_action :destroy, false | |||
batch_action :download_shapefiles do |ids| |
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.
Hmm, I tested it and it works great, but my concern is that it only download one page and not all filtered fmus, and that was the goal. Is it possible to download all?
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 see that feature is not planned for AA, which is weird as I think that very useful (activeadmin/activeadmin#2375), but there are other solutions like https://github.com/activeadmin-plugins/active_admin_scoped_collection_actions (or I did similar thing without any plugin which will be probably better, example here https://github.com/Vizzuality/laws_and_pathways/blob/develop/app/admin/cp_assessments.rb#L27)
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 see the plugin takes either selected items or all filtered records, so that would be the best behavior, giving enormous flexibility.
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.
But is it the goal? I can ask Sophie. I thought it was to select the FMUs they'd like to download.
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 she said to be able to download for example all FMU's for a country or filtered either way. Now, she will have to click through all pages and download them separately.
end | ||
|
||
def self.generate_prj_content | ||
'GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,' \ |
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.
What is that?
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.
Information for the prj file.
It sets up the geographical projection.
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.
Ahh, ok.
@tsubik but that was the requirement: to export into ESRI shapefiles. |
6af7858
to
ce14ce2
Compare
Allows downloading the FMU's shapefiles.
26a0bbd
to
22aaab2
Compare
Allows downloading the FMU's shapefiles.
It allows downloading it from the show page, the list page, and to bulk download.
I tested importing the zip into mapbox and everything works as expected.
Note: It requires installing GDAL on the computer.
Pull request checklist
Please check if your PR fulfills the following requirements:
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Issue Number: https://www.pivotaltracker.com/story/show/187271041
What is the new behavior?
Does this introduce a breaking change?
Other information