RUBclim / LCZ-Generator-Issues

Issue-only Repository for the LCZ-Generator
5 stars 0 forks source link

Problem with shapefiles at available LCZ maps #35

Closed rodrigolustosa closed 2 years ago

rodrigolustosa commented 2 years ago

Hello! I'm not sure if here is the best place to report this possible problem as I think it's a problem with the webpage, not the code itself. The problem is that when I try to download the suspicious training areas (polygon or point) of any submitted LCZ Map (at this link, for example the city of São Paulo) only the .shp file is downloaded, but as far as I know a .dbf and .shx file are also needed to open the shapefile. After I submitted my training areas, I received all those files by e-mail, so I could access my suspicious areas but I'm not able to access those files of submissions made by other people. Could you check if it is possible to download this other files, and fix the webpage if really needed? Or if this is not the right place for this kind of report, could you tell me the correct place to report this problem?

Best regards! Rodrigo

jkittner commented 2 years ago

Hi Rodrigo, thanks for the report, this is definitely the right place. You are absolutely correct, the other files are missing to get a usable shp file. Currently the submission pages and all contents are fully static and so are the files that are accessed. All files are theoretically accessible, but not linked. If you change the file type in the link you can download it, but that's of course very awkward and not a solution.

For now a workaround is to download the full zip-archive of the submission (/download/<submission_id>) or via the download button in the submission table. Inside this, the .shp should be present with the .dbf, .prj, .cpg and .shx.

At some point we plan to make the factsheets dynamic, meaning at each request the database is queried and the factsheet is compiled for the corresponding submission_id. This would allow us to easily make changes which apply to every factsheet of every submission ever made. The same mechanism would need to be build for the /download API so the contents of the zip archive do not differ from the ones viewed. Serving the shp with all corresponding files should probably be as an individual zip archive. Maybe we can already implement this for new submissions and backport it to all older submissions, when the major changes are made to the factsheets.

rodrigolustosa commented 2 years ago

Hi Jonas, Ah! I hadn't seen the download button! Thank you very much, it's a perfect workaround and makes the problem smaller. The zipped shapefile and the dynamic factsheet will be a nice solution. Thanks for your reply.

jkittner commented 2 years ago

Hi Rodrigo, Just to give you an update on this. We implemented a new endpoint providing a zip file (with all shp parts) for the point based QC or the polygon based QC. All old links e.g. https://lcz-generator.rub.de/factsheets/0bfdaea97fd38ce5409abe4d874b1ddb98f07d4e/data/0bfdaea97fd38ce5409abe4d874b1ddb98f07d4e_auto_qc_polygon.shp will be automatically rewritten and the user is redirected to the new endpoint where the zip file is served instead of only the .shp file.

The fix should be available in a couple of days or next week when version 1.3.0 is released. All other points, i.e. the dynamic factsheet will be addressed in upcomming future releases.

rodrigolustosa commented 2 years ago

Hi Jonas, Thank you for the update!

jkittner commented 2 years ago

This should be fixed now @rodrigolustosa, please have a try. Thanks for the report again! We will address the more structural changes mentioned above in a later release. The url-redirect setup now for fixing the issue will remain in place so all old links will continue working, but new links will be generated in the new format only. Once the new factsheet system is in place all links will be consistent. But a user should not notice any of this, besides now being able to download the full contents of the shp files.

rodrigolustosa commented 2 years ago

Hi Jonas, I tested it here and it was working as you said. thank you again!