[osmosis-dev] Merge huge count of files
Igor Podolskiy
igor.podolskiy at vwi-stuttgart.de
Fri Sep 30 19:24:25 BST 2011
Hi,
> > What is the best strategy to merge a huge count (e.g. 100x100 matrix)
> > together with a minimum of needed memory?
>
> You don't say what kind of files you are merging but it is possible that
> the best strategy is not using Osmosis at all for this task.
>
> If you have plain simple OSM XML files then the following will merge
> them super fast:
>
> (echo '<osm version="0.6">'; cat *osm|grep -v "<osm"|grep -v
> "</osm"|grep -v "<?xml"; echo '</osm>') > newfile.osm
yes, except that you will want to grep out the <bound> elements too
since having more than one of them is not good at all (some tools might
trip over it, Osmosis will for sure):
(echo '<osm version="0.6">'; \
cat *osm|grep -v "<osm"|grep -v </osm"| \
grep -v "<?xml"; \
grep -v "<bound"; \
echo '</osm>') > newfile.osm
Of course, if you don't have <bound>s in the source files, it isn't a
problem.
Bye
Igor
More information about the osmosis-dev
mailing list