refactor: store OSM node IDs only for tower nodes using a compact array - #118
Merged
Conversation
The previous `<Integer, Long>` hash map approach was unscalable for larger datasets like the full planet file. This optimization reduces memory usage via two key insights: 1. It is not necessary to store the mapping for pillar nodes. 2. Tower node IDs are sequentially assigned from zero, allowing them to serve as direct indices into a primitive long[] array of OSM IDs. A smaller <Long, Long> auxiliary hash map handles the mapping of artificial OSM IDs back to their original counterparts.
aoles
enabled auto-merge (squash)
July 24, 2026 11:14
jhaeu
approved these changes
Jul 24, 2026
jhaeu
left a comment
There was a problem hiding this comment.
LGTM - one optional renaming suggestion
|
|
||
| // ORS-GH MOD START - additional methods | ||
| private void addOsmNodeIdById(int id, long osmId) { | ||
| private void addOsmNodeIdById(int towerId, long osmId) { |
There was a problem hiding this comment.
how about renaming to addOsmNodeIdByTowerNodeId ?
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.
The previous
<Integer, Long>hash map approach was unscalable for larger datasets like the full planet file. This optimization reduces memory usage via two key insights:long[]array of OSM IDs.A smaller
<Long, Long>auxiliary hash map handles the mapping of artificial OSM IDs back to their original counterparts.