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
As discussed here (and following comments) there may be an interest in filtering OSM files to only include relevant data, before adding to the repo. (I'm assuming this is more relevant as an issue here than under map-matching, though I assume it applies to both.)
I definitely recommend it for new OSM files - but filtering existing files will (I think) make the repo bigger, and probably not gain us much?
Objectives for this issue:
figure out (and document) how to do the appropriate filtering
Can you please describe a bit more what you mean by "repo"? Any why would somebody want to integrate such a functionality to graphhopper core? What is the goal (e.g. reduction of graph size,..)? From my perspective you are describing pre-processing steps one might to do and document for specific purposes. But shouldn't such steps be better kept out of scope for the graphhopper project?
Sorry @ratrun, I should've been clearer - we're not trying to add this functionality to the core (i.e. no code changes), it's just housekeeping. That is, why have full OSM files sitting in the (git) repo, when GH only needs road info, etc.? See the discussion linked above - it'd be nice to be able to add small OSM exports in as unit tests, but currently they're not small as they're full of extra junk. @karussell made the comment that it might be nice to apply this to existing OSM files in graphhoppper/map-matching.
Thanks @kodonnell, now I understand.
I agree that e.g. buildings could be filtered away, but I would not filter out any ways which potentially could be used. I would not change already checked in files as their pre-decessors would still remain in the git repro. So this idea should be only applied to new files.
I agree that e.g. buildings could be filtered away, but I would not filter out any ways which potentially could be used.
Agree. For context, the aforelinked OSM download was of only a few dozen roads, but was 6mb - in large part because of version/author information, but even things like tree species!
I would not change already checked in files as their pre-decessors would still remain in the git repro. So this idea should be only applied to new files.
There's probably a way to overwrite the history, but that scares me (and will probably cause problems) so yes, I agree.
I am adding this to this issue because it has the same reason.
I just cloned this repository to my local machine. Because I used a slow DSL connection, I wondered why it took so painfully long. The result of my researches is: This repository is blown up by a handful of of questionable binary files.
I looked which files cause the increased the huge size and have not been deleted yet using git ls-tree -r -t -l --full-name HEAD | sort -n -k 4. Here are the last lines of the output which contain the largest files:
One reason is commit 1960b0f which added the free road shape files of Malta by Geofabrik to the repository.
I think that these test data files should be downloaded from a third ressource (e.g. separate git repository as submodule for people really interested running unit tests of this part of the code) or should be replaced by a smaller shape file which also serves the needs or should be part of a Git submodule.
The Perl script published here also reveals other commits larger than 1000000 bytes. The SRTM tiles, the shape file and the OSM extracts are in current master branch.
bytes SHA1
2438830 b24950147b741375eae948abaabdc7716ec55cab -- move 2.3 MB large countries.geo.json
2439610 44e954b3163e79362905fa6a2507bcb35c5518da -- rename 2.3 MB large countries.geo.json
3270496 e085c0b3f3b1e8a3b5942d0938218bec40a357f3 -- many changes in source code files, ok
2446334 0b5a60da2364abe742074c0b50f229180b060ae1 -- changes in countries.geo.json
3800201 2b888dad71178c8d767ea210a9a17e605b262205 -- new large JavaScript file
3943020 2a621f4dee90b9d78bffb601bb182730b21828fc -- in gh-script branch (rename 3.6 MB OSM PBF and 3.6 MB zipped GTFS)
3730551 7be9ec05ba3ab35ded6a7f925d3d85f380760d5c -- in fix_gh_script branch add 3.6 MB OSM PBF for the area of RNV
3738709 048df0d2b35166d76c458dc74af4fdc76d9daee1 -- addition of the same file in branch "mz" a few minutes later (maybe a rebase?)
10389816 1960b0f6239cb66fd6847fb865880a10e78eb025 -- commit discussed above introducing a shape file of Malta
3938925 06971230dd314ae38edda0cb8d8e10a6743e60af -- addition of a large JavaScript file
2151838 7d345ae02d17f2ab30b9c8cc178d00c90bf9d1bb -- addition of 3.6 MB zipped GTFS file
2939935 712787ca00d45dfd0b5f4629277d2c98220418c5 -- addition of a large JavaScript file
1578408 ea1a8e207d02cb52f2b062712b2c7e9689830c5c -- change formatting of the source code
1392049 c6c18ce28ae1722bfb6338d517ca3093e205d1ac -- change copyright notices
1408226 311969a8084a581a92cee2deb8d81899cf5dfdee -- uppercase to lowercase, camelCase to under_score
3035434 2e60c80beb19f46c14d9d3b5cccc084b873e4944 -- add a 2.9 MB SRTM tile (core/files/N48W125.hgt.zip)
2713486 0259d12b51ec924f397cdcbf4d6f2f49cec6e562 -- move three SRTM tiles, add one, delete one
1070158 5ed7bd585e5ba8d6e397e89446c7a1e30fb1c3ee -- code formatting
1548479 8c08b8c5eca24c972b5e38eccd14158fa3bc2b8f -- delete two OSM PBF files, add one (1.4 MB large)
1495218 f0e21a63d2371bb3f949cdd4e6a4a6c8c619db10 -- add a SRTM tile (core/files/N50E011hgt.zip)
3311500 0738d1ddfc8e293656e153ea676cc40a9ab199b2 -- add several SRTM tiles
1363807 68575ca5c27bd5080c3413882186490d6937c2b7 -- add Andorra as OSM PBF and gzip compressed OSM XML
1975663 5594f7f9d98d932f365557dc37b4b2d3b7abf698 -- moving many files
1170075 4104b198a88296a5bef005e4fbad660494de4f9e -- renaming packages (and therefore renaming files)
1259045 644e0d0d2dd2c9f4c3829f371ce96b1816ff664d -- moving gzip compressed OSM XML of Andorra and Monaco
Deleting them using git rm is the wrong solution because that would not reduce the size of the Git history. Instead, you have to replace the bad commits which introduced this blobs by smaller ones and rebase all newer commits on them. git filter-branch does that. There is one disadvantage: All clones of this repository have to be rebase, too, if there latest commit is newer than the oldest modified commit.
There is one disadvantage: All clones of this repository have to be rebase, too, if there latest commit is newer than the oldest modified commit.
We cannot do this :(
For new files, which procedure do you suggest? E.g. at the moment I go to osm.org, select the area that I need, download and gzip. But when doing this at a border the file is >1MB even for a very tiny area. How could I remove the relations and everything associated in this case? With some osmosis or osmium magic?
Activity
ratrun commentedon Dec 8, 2016
Can you please describe a bit more what you mean by "repo"? Any why would somebody want to integrate such a functionality to graphhopper core? What is the goal (e.g. reduction of graph size,..)? From my perspective you are describing pre-processing steps one might to do and document for specific purposes. But shouldn't such steps be better kept out of scope for the graphhopper project?
kodonnell commentedon Dec 8, 2016
Sorry @ratrun, I should've been clearer - we're not trying to add this functionality to the core (i.e. no code changes), it's just housekeeping. That is, why have full OSM files sitting in the (git) repo, when GH only needs road info, etc.? See the discussion linked above - it'd be nice to be able to add small OSM exports in as unit tests, but currently they're not small as they're full of extra junk. @karussell made the comment that it might be nice to apply this to existing OSM files in graphhoppper/map-matching.
ratrun commentedon Dec 10, 2016
Thanks @kodonnell, now I understand.
I agree that e.g. buildings could be filtered away, but I would not filter out any ways which potentially could be used. I would not change already checked in files as their pre-decessors would still remain in the git repro. So this idea should be only applied to new files.
kodonnell commentedon Dec 10, 2016
Agree. For context, the aforelinked OSM download was of only a few dozen roads, but was 6mb - in large part because of version/author information, but even things like tree species!
There's probably a way to overwrite the history, but that scares me (and will probably cause problems) so yes, I agree.
Nakaner commentedon Apr 2, 2017
I am adding this to this issue because it has the same reason.
I just cloned this repository to my local machine. Because I used a slow DSL connection, I wondered why it took so painfully long. The result of my researches is: This repository is blown up by a handful of of questionable binary files.
I looked which files cause the increased the huge size and have not been deleted yet using
git ls-tree -r -t -l --full-name HEAD | sort -n -k 4. Here are the last lines of the output which contain the largest files:One reason is commit 1960b0f which added the free road shape files of Malta by Geofabrik to the repository.
I think that these test data files should be downloaded from a third ressource (e.g. separate git repository as submodule for people really interested running unit tests of this part of the code) or should be replaced by a smaller shape file which also serves the needs or should be part of a Git submodule.
The Perl script published here also reveals other commits larger than 1000000 bytes. The SRTM tiles, the shape file and the OSM extracts are in current master branch.
Deleting them using
git rmis the wrong solution because that would not reduce the size of the Git history. Instead, you have to replace the bad commits which introduced this blobs by smaller ones and rebase all newer commits on them.git filter-branchdoes that. There is one disadvantage: All clones of this repository have to be rebase, too, if there latest commit is newer than the oldest modified commit.karussell commentedon May 30, 2017
We cannot do this :(
For new files, which procedure do you suggest? E.g. at the moment I go to osm.org, select the area that I need, download and gzip. But when doing this at a border the file is >1MB even for a very tiny area. How could I remove the relations and everything associated in this case? With some osmosis or osmium magic?
karussell commentedon May 30, 2017
I'm using now this
update: we could remove everything building=yes or even building=*?
keywords: strip, remove, compact, osmosis
karussell commentedon Sep 10, 2018
This can be done for future files only.