Skip to content
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

Add .qpj and .qmd Extensions to Shapefile Handling #8134 #10305

Merged
merged 5 commits into from
Mar 1, 2024

Conversation

Saixel
Copy link
Contributor

@Saixel Saixel commented Feb 7, 2024

What this PR does / why we need it:

This PR includes .qpj and .qmd in the list of file extensions handled by ShapefileHandler, ensuring that QGIS project files and metadata are correctly processed and included in the zipped shapefile packages. The documentation has been updated to reflect these changes, and a new test has been added to confirm the proper handling of these file types.

Which issue(s) this PR closes:

Special notes for your reviewer:

Please note that .qpj files are crucial for QGIS users as they contain projection information.

Suggestions on how to test this:

  1. Upload a zipped shapefile containing .qpj and .qmd files.
  2. Ensure the files remain within the zip after upload and are not extracted.

Does this PR introduce a user interface change? If mockups are available, please link/include them here:

N/A

Is there a release notes update needed for this change?:

Yes, it has been noted that Dataverse now retains .qpj and .qmd files in zipped shapefile uploads.

Additional documentation:

https://dataverse-guide--10305.org.readthedocs.build/en/10305/developers/geospatial.html

@Saixel Saixel requested a review from pdurbin February 7, 2024 14:35
@Saixel Saixel self-assigned this Feb 7, 2024
@coveralls
Copy link

coveralls commented Feb 7, 2024

Coverage Status

coverage: 20.139% (-0.002%) from 20.141%
when pulling aa94532 on 8134-add-qpj-qmd-extensions
into 08cf9a8 on develop.

@pdurbin
Copy link
Member

pdurbin commented Feb 7, 2024

@Saixel this is a great start. Next, can you please review this page and consider if any changes should be made? https://dataverse-guide--10305.org.readthedocs.build/en/10305/developers/geospatial.html . As I may have mentioned, I'm not especially familiar with this feature so we'll need to learn together about it. 😅

The source is doc/sphinx-guides/source/developers/geospatial.rst

Also, once we're sure of the direction we're taking, we'll want to add a release note snippet. Please read this: https://preview.guides.gdcc.io/en/develop/developers/version-control.html#writing-a-release-note-snippet

Unfortunately, I don't see any tests being run by Jenkins (this is a recent problem where the webhook isn't delivered). Maybe if we push another commit, they will start. We'll want to check that the tests are passing. Speaking of tests, can you add any assertions of the new behavior to existing tests?

Finally, please add this PR to https://github.com/orgs/IQSS/projects/34 . For now the "in progress" column is a good place. You can assign yourself. Once that's done, you can remove the issue from the board (we do this to avoid duplicates).

Thanks!

This comment has been minimized.

@qqmyers
Copy link
Member

qqmyers commented Feb 7, 2024

Re: standup discussion: The code is just rezipping when a zip is a shapefile, but it is only including files with a known extension in doing so, so I agree that the one commit should do it.

FWIW: I think at one point SEAD had a shapefile previewer that showed the contents on a map ala the geoJson previewer. I'm not sure if something like that would be useful for the group with these files or not (or whether opensource code to preview shapefiles would understand the qpj file, etc.)

This comment has been minimized.

1 similar comment

This comment has been minimized.

Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Saixel I'd say you can safely switch this from draft to non-draft.

The tests are passing, which is great: https://jenkins.dataverse.org/job/IQSS-Dataverse-Develop-PR/job/PR-10305/3/testReport/

Do you plan to add or modify any tests?

doc/release-notes/8134-add-qpj-qmd-extensions.md Outdated Show resolved Hide resolved
Co-authored-by: Philip Durbin <philip_durbin@harvard.edu>
@Saixel
Copy link
Contributor Author

Saixel commented Feb 8, 2024

@Saixel I'd say you can safely switch this from draft to non-draft.

The tests are passing, which is great: https://jenkins.dataverse.org/job/IQSS-Dataverse-Develop-PR/job/PR-10305/3/testReport/

Do you plan to add or modify any tests?

Yes! I was thinking of adding one for the specific case, do you think it's worth it? @pdurbin

@Saixel Saixel marked this pull request as ready for review February 8, 2024 16:31

This comment has been minimized.

@pdurbin
Copy link
Member

pdurbin commented Feb 8, 2024

@Saixel yes, I think it would be great to add a test, especially if it doesn't involve adding any large test files.

@Saixel Saixel added Feature: Geospatial NIH CAFE Issues related to and/or funded by the NIH CAFE project Type: Bug a defect User Role: Depositor Creates datasets, uploads data, etc. Size: 10 A percentage of a sprint. 7 hours. labels Feb 9, 2024
@Saixel Saixel requested a review from pdurbin February 9, 2024 16:01
Copy link

github-actions bot commented Feb 9, 2024

📦 Pushed preview images as

ghcr.io/gdcc/dataverse:8134-add-qpj-qmd-extensions
ghcr.io/gdcc/configbaker:8134-add-qpj-qmd-extensions

🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name.

@Saixel Saixel removed their assignment Feb 9, 2024
@pdurbin pdurbin self-assigned this Feb 16, 2024
@pdurbin
Copy link
Member

pdurbin commented Feb 16, 2024

The code looks good. API tests are passing.

I also tested it. I used the shape_with_qpj.zip file provided by @mathieu-massaviol at #8134 (comment)

When you unzip this file, its contents are:

shape_with_qpj/test.cpg
shape_with_qpj/test.dbf
shape_with_qpj/test.prj
shape_with_qpj/test.qmd
shape_with_qpj/test.qpj
shape_with_qpj/test.shp
shape_with_qpj/test.shx

Here's the before and after when uploading this file to Dataverse

before: https://demo.dataverse.org server running Dataverse 6.1

Screenshot 2024-02-14 at 4 56 57 PM

If you download test.zip and unzip it, it contains:

shape_with_qpj/test.cpg
shape_with_qpj/test.dbf
shape_with_qpj/test.prj
shape_with_qpj/test.shp
shape_with_qpj/test.shx

after: this pull request

Screenshot 2024-02-16 at 9 11 17 AM

If you download test.zip and unzip it, it contains:

shape_with_qpj/test.cpg
shape_with_qpj/test.dbf
shape_with_qpj/test.prj
shape_with_qpj/test.qmd
shape_with_qpj/test.qpj
shape_with_qpj/test.shp
shape_with_qpj/test.shx

That is to say, the .qpj and .qmd files stay in the zip. Seems like a good fix. Approved!

Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! See above for my writeup while testing.

@pdurbin pdurbin removed their assignment Feb 16, 2024
@stevenwinship stevenwinship self-assigned this Mar 1, 2024
@stevenwinship stevenwinship merged commit aa9c6b0 into develop Mar 1, 2024
20 checks passed
@stevenwinship stevenwinship removed their assignment Mar 1, 2024
@pdurbin pdurbin added this to the 6.2 milestone Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Geospatial NIH CAFE Issues related to and/or funded by the NIH CAFE project Size: 10 A percentage of a sprint. 7 hours. Type: Bug a defect User Role: Depositor Creates datasets, uploads data, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

".qpj" file taken out of QGIS Shapefile zip
5 participants