Ensure geographic datasets passed by memory files are seen as geographic #5092
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Externals (in this case PyGMT) may pass data into GMT modules. These may be created and data added, and the creator may know the data are geographic and may flag that via the bit-flag GMT_GRID_IS_GEO in GMT_Create_Data. Unfortunately, this was not honored. Furthermore, this concept should not be restricted to grids: The user may know that the created dataset, grid, image, matrix, or vector is geographic and would like to pass that information into the data structure. This PR allows for that while fixing the grid-specific bug. Now,
With these changes, a memory file passed that is known to be geographic will trigger an automatic geographic projection if none had been selected explicitly with -J.
Note: Tested with the original PyGMT problem. I assume it will work similarly for images and grids, as well as data sets and vectors, but there are no such external tests (yet). I also updated the API doc to mention the purpose of the GMT_DATA_IS_DATA flag under GMT_Create_Data.