Launch OSRM server on large area - openstreetmap

in the tutorial it is shown how to start an OSRM server with this example :
wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf
osrm-extract berlin-latest.osm.pbf -p profiles/car.lua
osrm-contract berlin-latest.osrm
osrm-routed berlin-latest.osrm
I would like to start a server not only on Berlin dataset, but on a full country dataset. For instance all German country roads. Maybe there is something to do with the contract, but i don't really know what king of .osrm i should put as argument to tell it to use a larger dataset that would be the combination of several dataset.
I think the answer should be really obvious when we know it, but it still feel a bit wooly.
Thank you.

According to an OSRM issue it is not possible to merge .osrm files. However you can merge multiple PBF files before generating your .osrm files.
Merging of OSM XML or PBF files can be done with osmium:
osmium merge file1.osm.pbf file2.osm.pbf -o merged.osm.pbf.
Or with osmosis:
osmosis --rb file1.osm.pbf --rb file2.osm.pbf --m --wb merged.osm.pbf

wget http://download.geofabrik.de/europe/germany-latest.osm.pbf
osrm-extract germany-latest.osm.pbf -p profiles/car.lua
osrm-contract germany-latest.osrm
osrm-routed germany-latest.osrm
Should work, but please note it will require around 16GB of RAM and probably a similar amount of disk space.
EDIT:
After clarification what you will need to do is merge the .osm.pbf files using the osmium tool.
./osmium merge first.osm.pbf second.osm.pbf third.osm.pbf -o result.osm.pbf

Related

Best way to merge mbTiles files together

I have generated mbtiles for different sub regions of USA map from openMapTiles. Now, I wanted to merge all the generated mbTiles files together. What's the better way to do this?
Thanks!
Once you have tile-join ( https://github.com/mapbox/tippecanoe ) tool, it should be easy. I am just patching version so it is easy to reuse same styles right away (for klokantech/tileserver-gl)
so my mixing script now :
rm mix.mbtiles
tile-join -o mix.mbtiles *.mbtiles
sqlite3 mix.mbtiles 'UPDATE "main"."metadata" SET value="3.8" where name ="version";`

Why are there tag keys missing when downloading OSM data to Postgis / Postgresql?

I'm working on a routing application using OSM data in pgrouting. I'm using overpass-api to access the data from a specific bounding box. However, after downloading the data, there seem to be tag_keys missing from the data.
When inspecting the data using postgis or QGIS, certain tag_keys are there, like "highway", "oneway" or "maxpeed". However, others seem to be missing. In particular the tag keys "bicycle" (with possible values like "yes" or "no") or "access" are not included in the data. These tag keys are available on OSM online, however.
The following code is used to retrieve the data from OSM through Overpass-API and put it into PGrouting
CITY="Utrecht_west"
BBOX="4.9926,52.0698,5.0772,52.1172"
wget --progress=dot:mega -O "$CITY.osm" "http://www.overpass-api.de/api/xapi?*[bbox=${BBOX}][#meta]"
OSM2pgrouting converter
cd ~/Desktop/Utrecht
osm2pgrouting \
-f Utrecht_west.osm \
-d utrecht_west \
-U user
I expect these lines to download all data in the bounding box, but some tag keys seem to be missing. What am I doing wrong here?
edit: it seems to be a similar issue to this post, however, I cannot find another answer to a similar issue
I'm not familiar with osm2pgrouting. However it looks like mapconfig.xml doesn't include "bicycle" and "access" tags. You either need to add them or create your own config file. If you want osm2pgrouting to consider these tags during routing this might not be enough, though.

proper tools for pcap file analysis in ELK stack?

I'm sure this is a softball for those who are familiar with the Elastic Stack, but the docs I've read havent left it super clear.
I essentially am trying to push pcap files through the ELK stack to visualize packet information using Kibana.
I am not looking to monitor this real time, but rather have the following behavior:
I drop a pcap into a directory, and something picks it up (FileBeat? PacketBeat -I? LogStash?)
Since a pcap file isn't really useful, I might need to run it through tshark to produce readable json
I want this information in ElasticSearch
Use Kibana to make pretty graphs
From what I read PacketBeat allows for the -I option to take a pcap file as an input, but doesn't that only ship that single file? I want it to watch a directory as I drop pcaps. I guess what confused me is most of the docs talk about configuring an interface device to sniff in the packetbeat.yml
Anyway ideally I was thinking it would look something like this
packetbeat(watching for pcaps, spits out json) -> logstash (filters)-> elasticsearch (indexes)-> kibana (visualizes)
Is there a way to configure packetbeat to watch a dir for pcaps rather than an interface?
As of March 2021, you still can't do this natively with Packetbeat.
But you can easily "outsource" the watching of a directory tree to another tool, and have it call Packetbeat. Watchman (released by Facebook) is a good choice - it will keep track of files that have been processed. Then you could do something like the following to a) watch a directory and then b) take action when files are changed/added:
watchman watch /path/to/pcaps
watchman -- trigger ~/path/to/pcaps pcaptrigger '*.pcap' -- 'packetbeat -I'

How can I create in Gehpi directed tree graph instead of sphererical

I want to make a network graph which shows the distribution of our documents in our folder structure.
I have the nodefile, edgefile and gephi graph file in this location:
https://1drv.ms/f/s!AuVfRBdVHkO7hgs5K9r9f7jBBAUH
What I do is:
Run the algorithm ForceAtlas2 with scaling 10-20, dissuade hub marked and prevent overlap marked, all other standard setting.
What I get is a graph with groups radial/spherical distributed. However, what I want is a tree directed network graph.
Anyone know how I can adjust Gephi to make this?
Thanks!
I just found a solution.
I tested the file format as shown on the Yed site "import excel file" page
http://yed.yworks.com/support/manual/import_excel.html
This gave me the Yed import dialog (took a life time to figure out that it's a pop up menu and not selectable through the standard menu)
Anyway, it worked and I've adjusted the test files with the data prepared for the Gehpi. This was pretty easy, I could used the source target ID's etc. Just copy paste.
I load it into Yed and used some directed and radial clustering algorithms on it. Works fine!
Below you can find the excel node/edge file used to import in Yed and the graph file you can open with Yed to see the final radial result.
https://1drv.ms/f/s!AuVfRBdVHkO7hg6DExK_eVkm5_mR
Only thing to figure out is how to combine the weight (which represents the number of documents) with the node size.
Unfortunately, as of version 0.9.0, Gephi no longer supports hierarchical graphs. Maybe try using a previous version?
Other alternatives involve more complex software, such as Graphviz, but you need a .dot file instead of your .csv. I looked all over, but could not find an easy-to-use csv to dot converter.
You could try looking at d3-hierarchy, a node.js program, but then again you need to use the not-so-user-friendly npm. If you look at the link, it looks like it can produce the kind of diagram you're looking for.

Use OSM Map in SUMO

I want to export a Munich map from OSM for SUMO Simulator. I've managed to download such a map from bbbike.de(472MB), but when I'm converting it to .net.xml with netconvert I'm getting a lot of warnnings and the simulator cannot import the map ("Loading error"). Do you have any idea how can I convert correctly the map (or do you think it is because the big volume of the file?), or where could I get such a map(in a properly sumo format = xml, I acctualy need just the highways, I've tried to select just highways with osmosis but I have the same problem in the end)?
Ok to summarize our experience and to close this question :)
SUMO has problems with parsing big full OSM files. So you need to cut the area and filter for highways with osmosis:
Get the state of bavaria or of the surrounding http://download.geofabrik.de/europe/germany/bayern/oberbayern.html
osmosis --read-pbf ./oberbayern-latest.osm.pbf --bounding-box top=48.3298 left=11.2699 bottom=48.0460 right=11.8948 --write-xml ./munich.xml
osmosis --read-xml ./munich.xml --tf accept-ways highway=* --used-node --write-xml ./munich_streets.xml
This can be loaded to SUMO, esp. with the eWorld GUI.