-
Notifications
You must be signed in to change notification settings - Fork 96
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 SpatialRef::to_projjson() #389
Conversation
b85800a
to
c39baff
Compare
} else { | ||
Ok(_string(c_projjsonstr)) | ||
}; | ||
unsafe { gdal_sys::VSIFree(c_projjsonstr.cast::<std::ffi::c_void>()) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't even know any more which one of .cast()
, .cast<c_void>()
or as _
is preferred 😃. At least this is consistent with the rest of the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it's mostly a copy/paste... The entire lib could do with some helper functions/macros to streamline stuff like this.
@@ -506,6 +506,22 @@ impl SpatialRef { | |||
res | |||
} | |||
|
|||
pub fn to_projjson(&self) -> Result<String> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hate this spelling, TBH, but...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me too, but it's consistent...
bors r+ |
389: Add SpatialRef::to_projjson() r=lnicola a=ttencate - [x] I agree to follow the project's [code of conduct](https://github.com/georust/gdal/blob/master/CODE_OF_CONDUCT.md). - [x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users. --- 390: Work around clippy lint bug r=lnicola a=lnicola - [x] I agree to follow the project's [code of conduct](https://github.com/georust/gdal/blob/master/CODE_OF_CONDUCT.md). - [x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users. --- Unblocks #389. Co-authored-by: Thomas ten Cate <ttencate@gmail.com> Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Build failed (retrying...): |
389: Add SpatialRef::to_projjson() r=lnicola a=ttencate - [x] I agree to follow the project's [code of conduct](https://github.com/georust/gdal/blob/master/CODE_OF_CONDUCT.md). - [x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users. --- Co-authored-by: Thomas ten Cate <ttencate@gmail.com>
bors r- |
Canceled. |
390: Work around clippy lint bug r=lnicola a=lnicola - [x] I agree to follow the project's [code of conduct](https://github.com/georust/gdal/blob/master/CODE_OF_CONDUCT.md). - [x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users. --- Unblocks #389. Co-authored-by: Laurențiu Nicola <lnicola@dend.ro>
Looks like we're still testing GDAL 3.0.4 on CI, and |
c39baff
to
4ed76c4
Compare
Thanks. Added a check. |
Please drop that PAM file. bors d+ |
✌️ ttencate can now approve this pull request. To approve and merge a pull request, simply reply with |
4ed76c4
to
ba0f283
Compare
Sorry, yeah, running |
bors r+ Thanks for the quick turnaround! |
389: Add SpatialRef::to_projjson() r=ttencate a=ttencate - [x] I agree to follow the project's [code of conduct](https://github.com/georust/gdal/blob/master/CODE_OF_CONDUCT.md). - [x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users. --- Co-authored-by: Thomas ten Cate <ttencate@gmail.com>
#[cfg(any(major_ge_4, all(major_ge_3, minor_ge_1)))] | ||
pub fn to_projjson(&self) -> Result<String> { | ||
let mut c_projjsonstr = ptr::null_mut(); | ||
let options = ptr::null(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the long run, I'd like us to support options where applicable:
https://gdal.org/doxygen/classOGRSpatialReference.html#a1a4b65b551d3a5ea91fb7fd8d9e1e4e8
I don't know, but I agree it's annoying :-). |
ba0f283
to
308d288
Compare
Canceled. |
308d288
to
5099745
Compare
|
bors r+ |
389: Add SpatialRef::to_projjson() r=ttencate a=ttencate - [x] I agree to follow the project's [code of conduct](https://github.com/georust/gdal/blob/master/CODE_OF_CONDUCT.md). - [x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users. --- Co-authored-by: Thomas ten Cate <ttencate@gmail.com>
bors r- |
Canceled. |
You've added the PAM file again when changing the assert message. |
5099745
to
dcb09ae
Compare
Just added it to |
bors r+ |
Build succeeded: |
Well, I was planning to fix |
That's great, but let's keep this thing from wasting everyone's time until you get round to it :) |
CHANGES.md
if knowledge of this change could be valuable to users.