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

v.out.ogr: Fix exporting vector layers from a location whose CRS has no EPSG code #3869

Open
wants to merge 32 commits into
base: main
Choose a base branch
from

Conversation

ldesousa
Copy link
Contributor

@ldesousa ldesousa commented Jun 17, 2024

This PR addresses issue #2187: the v.out.ogr module fails to export vector layers from a location whose CRS does not have an entry in the EPSG registry. The root cause is the inadequate discarding of the Ogr_projection object in vector/v.out.ogr/main.c. In addition a new test is provided for this module verifying the correct creation of layers from such locations. This test fails with the current master branch (release 8.3).

This PR is incremental on PR #3848. Please merge that one before merging this one.

@github-actions github-actions bot added vector Related to vector data processing Python Related code is in Python C Related code is in C module tests Related to Test Suite labels Jun 17, 2024
@ldesousa ldesousa requested a review from wenzeslaus June 17, 2024 13:53
@veroandreo veroandreo changed the title Issue#2187 v.out.ogr: add basic unit test (cont.) Jun 18, 2024
@veroandreo veroandreo added this to the 8.5.0 milestone Jun 18, 2024
@ldesousa ldesousa changed the title v.out.ogr: add basic unit test (cont.) v.out.ogr: fixes #2187 and expands unit tests Jun 18, 2024
@echoix echoix changed the title v.out.ogr: fixes #2187 and expands unit tests v.out.ogr: fixes ERROR: Unable to create OGR spatial reference with Shapefile export and expands unit tests Jun 19, 2024
ldesousa and others added 5 commits July 31, 2024 17:43
…tion

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…tion

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

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

I suppose OSRDestroySpatialReference is still missing, but the issue was there before. I'm fine with this PR just fixing the issue and adding a test for that.

vector/v.out.ogr/testsuite/test_v_out_ogr.py Show resolved Hide resolved
vector/v.out.ogr/testsuite/test_v_out_ogr.py Outdated Show resolved Hide resolved
@wenzeslaus
Copy link
Member

@ldesousa Can you please:

  1. update the description to include what this is fixing and how and when it is failing (I suppose that the new test is failing without the change and passing with it, correct?)
  2. shorten the title

@ldesousa ldesousa changed the title v.out.ogr: fixes ERROR: Unable to create OGR spatial reference with Shapefile export and expands unit tests v.out.ogr: fixes #2187 and expands unit tests Aug 29, 2024
Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

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

My comments are in my previous review (see the review and unresolved comments).

@echoix
Copy link
Member

echoix commented Sep 3, 2024

Once it will be ready for merging, the title isn't clear to me what it does (an issue number is great for PR descriptions, but less as a changelog entry and PR titles). Our PR titles are changelog entries, and are what we will see in the code in for the rest of the lifetime of the project

@ldesousa
Copy link
Contributor Author

ldesousa commented Sep 6, 2024

Once it will be ready for merging, the title isn't clear to me what it does (an issue number is great for PR descriptions, but less as a changelog entry and PR titles). Our PR titles are changelog entries, and are what we will see in the code in for the rest of the lifetime of the project

@echoix I already lengthened/shortened the title a few times. Could you confer with @wenzeslaus which kind of title you wish for this PR?

@rouault
Copy link
Member

rouault commented Sep 6, 2024

@rouault I already lengthened/shortened the title a few times. Could you confer with @wenzeslaus which kind of title you wish for this PR?

maybe "v.out.ogr: fix exporting vector layers from a location whose CRS has no EPSG code" ?

@ldesousa
Copy link
Contributor Author

ldesousa commented Sep 6, 2024

@rouault Sorry, wrong tag. Let's wait for all the internal GRASS procedures to be ready. Then I will ask for your review again. Thanks.

@echoix
Copy link
Member

echoix commented Sep 7, 2024

@rouault I already lengthened/shortened the title a few times. Could you confer with @wenzeslaus which kind of title you wish for this PR?

maybe "v.out.ogr: fix exporting vector layers from a location whose CRS has no EPSG code" ?

I actually find that great, I can't reword it any better way that doesn't end up sounding weird

@echoix echoix changed the title v.out.ogr: fixes #2187 and expands unit tests v.out.ogr: fix exporting vector layers from a location whose CRS has no EPSG code Sep 7, 2024
@echoix echoix changed the title v.out.ogr: fix exporting vector layers from a location whose CRS has no EPSG code v.out.ogr: Fix exporting vector layers from a location whose CRS has no EPSG code Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C module Python Related code is in Python tests Related to Test Suite vector Related to vector data processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] v.out.ogr: ERROR: Unable to create OGR spatial reference with Shapefile export
5 participants