Skip to content
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

improving performance of big polygons parsing #127

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexandru-popescu
Copy link

This is a functional fix for polygon parsing; the bug that is addressed by the fix is that polygons with > 1000 lines take a long time to parse.
This is because the loop goes through the polygon parsing for each coordinate entry: this is unnecessary and degrades performance a lot: more coordinates results in more unnecessary loops.
The fix cuts the loop for polygons after the first parsing.
Of course, this is a sort of a hack ... the correct way to fix this would be to follow the top-down structure of the kml instead of looping directly over all coordinates, just to go back to the parent, parse the parent and then do it all over again ...

This is a functional fix for polygon parsing; the bug that is addressed by the fix is that polygons with > 1000 lines take a long time to parse.
This is because the loop goes through the polygon parsing for each coordinate entry: this is unnecessary and degrades performance a lot: more coordinates results in more unnecessary loops. 
The fix cuts the loop for polygons after the first parsing.
Of course, this is a sort of a hack ... the correct way to fix this would be to follow the top-down structure of the kml instead of looping directly over all coordinates, just to go back to the parent, parse the parent and then do it all over again ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants