Plot square or cube by default for OGR/GMT files with Point/MultiPoint types#1438
Plot square or cube by default for OGR/GMT files with Point/MultiPoint types#1438
Conversation
|
I am falling here on 5 tests: all 5 tests do not involve |
Maybe try to run |
There is only 1 test failing on CI ( if "S" in kwargs and kwargs["S"][0] in "vV" and direction is not None:
extra_arrays.extend(direction)
if "S" not in kwargs and kind == "file":
> with open(data, "r") as file:
E FileNotFoundError: [Errno 2] No such file or directory: '@Table_5_11.txt'The problem is that your code tries to open the However, users may want to plot OGR/GMT files from https://github.com/GenericMappingTools/gmtserver-admin/tree/master/cache, so we'll need to handle files like |
|
We can use
will plot a line instead of squares. as I understand from the code the import of files from the server is done on the GMT side so we can't support it anyway. |
|
Another option that we can use is to do something like that: We do not import os in that solution, but we still do not support remote files, as I mentioned that's up to GMT. |
|
I like the try-except style, could you make the change please? Another thing we could do (if we want to support remote OGR/GMT files) is to use |
I think this way is better. It's not only about supporting remote files. GMT users can store their data (e.g., faults.gmt, plate_boundary.gmt) in any directory and set the environment variable even though the file |
|
I changed the code to use |
|
@yohaimagen Need to resolve the conflicts first. |
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
|
O.K I added the encoding to the And we passing the style check :) Let me know if there is something else to do over here. |
weiji14
left a comment
There was a problem hiding this comment.
Just some more typos, otherwise good for a final round of reviews! We'll merge in 24 hours if there are no other issues 😁
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
|
We have one error: the docs were unable to build on windows, where it falls on something unrelated to this pull request. |
seisman
left a comment
There was a problem hiding this comment.
Looks good, except a few minor edits
This error can be ignored, because we already know that sometimes GMT API on Windows may crash. |
michaelgrund
left a comment
There was a problem hiding this comment.
Except the minor suggestions this PR looks good to me!
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>
|
Appreciate your help @yohaimagen, thanks again! 🥳 |
|
Thanks to all three reviewers for reviewing my code. |
…t types (GenericMappingTools#1438) Set default behavior for plotting OGR/GMT files with Point/Multipoint type geometry as points (-Sp0.2c) for `plot` and cubes (-Su0.2c) for `plot3d`, instead of GMT's default line style plot. Co-authored-by: Dongdong Tian <seisman.info@gmail.com> Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com> Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com>
To keep consistency with default style plotting of
geoDataFramewith Point or MultiPoint geometry see #1405 adding the same behavior for.gmtfiles that are saved from geoDataFrame with.to_file('some/path', driver="OGR_GMT", mode="w")Fixes #1373
Reminders
Add the same if statement to
plot3d.pyAdd tests for new features or tests that would have caught the bug that you're fixing.