Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

354
Visualizações
How can I create an OSRM file from geojson data?

I have a geojson datafile containing highway=footway paths, and I'd like to use OSRM to find routings between multiple points (i.e., not just the most efficient path from A to B, but something like the travelling salesman).

From the OSRM documentation, I see that to use custom data rather than data from OpenStreetMap I would need an OSRM file, which I can apparently make "by running the OSRM binaries [shipped] in node_modules/osrm/lib/binding/ and default profiles".

I find that very vague and I don't know how to proceed. The documentation linked above refers to the OSRM-backend documentation, but I didn't find anything related to creating OSRM files there. I got the node_modules/osrm directory through npm, but there's nothing in the osrm/lib/binding directory...

How can I proceed to use my data for OSRM routing? Or if there is an easier solution to what I'm trying to implement, what would it be?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I was able to create an osrm file by following this "pipeline":

  1. Convert the geojson file to osm using JOSM (or start with an osm file to begin with). You can do this by opening the geojson file and clicking on File > Save As... and then selcting OSM file format.
  2. Add the version, timestamp and changeset tags with osmconvert:
$ osmconvert64 intput_file.osm --fake-author -o=output_file.osm
  1. Make the osm file into a binary file with osmosis:
$ osmosis --rx input_file.osm --wb output_file.osm.pbf omitmetadata=true
  1. Use the OSRM Docker container to create the osrm file. With Docker desktop installed:
$ docker run -t -v "absolute/path/to/data":/data osrm/osrm-backend osrm-extract -p /opt/profile.lua /data/file_name.osm.pbf
$ docker run -t -v "absolute/path/to/data":/data osrm/osrm-backend osrm-contract /data/file_name.osrm

Notes:

  • For the docker step, you must create a data directory and the absolute path to data should link to that directory.
  • The file_name used must be the same for the osrm-extract input as for the osrm-contract output, as OSRM will make some other files using that name, which it will try to find in the contract step.
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda