New argument to process OGR JSON blocks#4573
Merged
hobu merged 3 commits intoPDAL:masterfrom Dec 26, 2024
Merged
Conversation
hobu
reviewed
Dec 12, 2024
789ad7f to
d0987cc
Compare
abellgithub
reviewed
Dec 13, 2024
| void parse(); | ||
|
|
||
| template <typename T> | ||
| void assignJSON(const NL::json& field, T& to) |
Contributor
There was a problem hiding this comment.
More natural is to return the item from the function call. So then it's like what you're calling below field.get<T>().
| s = s.substr(pos + 1); | ||
| std::stringstream msg; | ||
|
|
||
| msg << "Failed to parse JSON field with error: " << s; |
Contributor
There was a problem hiding this comment.
Do you know the field name? Can you tell someone?
Contributor
Author
There was a problem hiding this comment.
I tried to get it to do that, but I think the function would have to take both item.key() & item.value() for that. unless there's some other way to dereference the json iterator that I missed.
Contributor
There was a problem hiding this comment.
I guess I should see what an actual error looks like :)
hobu
requested changes
Dec 16, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Creating a new class that resolves #4548; the OGRSpec class processes a JSON specification for reading geometry with OGR at the time an argument is added, rather than during a stage's execution.
Right now, the class
Polygons, stores themThis covers the needs of most stages that could potentially use an OGR datasource, like
readers.eptandreaders.copc. It's implemented there, as well as infilters.geomdistance(where it only uses a single polygon from the container we create). It still needs to be added tofilters.crop,readers.tindexandbut that should be trivial.filters.overlayRight now, it could use some reworking to allow non-
Polygongeometries to be specified. This might be nice for consistency's sake, for the few times this gets used currently (or maybe future additions, like 2.5D polygons?). I've been having some trouble designing a good solution for that, though.