You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See this StackOverflow question. I'm parsing large GeoJSON files and would like to produce Document objects without the coordinates arrays, which can easily take up 75+% of the space.
I implemented a GenericValue subclass which uses the SAX parser callbacks and its own stack to pull this off. It winds up roughly doubling parsing performance, so this is a very worthwhile optimization. It leaves much to be desired, however: it duplicates large amounts of code from GenericDocument and it's unable to build up objects in exactly the same manner, since methods like GenericValue::SetObjectRaw are private.
@miloyip suggested on StackOverflow that a better way to do this would be with the GenericDocument::Populate method, and that I should file an issue asking for an example. So here I am :)
The text was updated successfully, but these errors were encountered:
I have created two examples in #615. Both examples do the same thing, they filter a user-specified key, and then output the filtered results. filterkey just uses SAX API, while filterkeydom firstly populates a DOM, and then output the DOM.
The core thing is the FilterKeyHandler, which receives SAX events, filters them, and forward to the output handler. Both examples uses the same FilterKeyHandler. I think you may implement your own filter for your requirements.
See this StackOverflow question. I'm parsing large GeoJSON files and would like to produce
Document
objects without thecoordinates
arrays, which can easily take up 75+% of the space.I implemented a
GenericValue
subclass which uses the SAX parser callbacks and its own stack to pull this off. It winds up roughly doubling parsing performance, so this is a very worthwhile optimization. It leaves much to be desired, however: it duplicates large amounts of code fromGenericDocument
and it's unable to build up objects in exactly the same manner, since methods likeGenericValue::SetObjectRaw
are private.@miloyip suggested on StackOverflow that a better way to do this would be with the
GenericDocument::Populate
method, and that I should file an issue asking for an example. So here I am :)The text was updated successfully, but these errors were encountered: