OSM Route administration interface
Osm Route Screenshot

OSM Route enables routing calculation from a list of georeferenced entities using

A typical usage scenario for this module is building automatically a path for a node itinerary through its list of referenced POIs.
The retrieved path is written on a desired geofield and can be used to display the itinerary as a map layer.

There are no modules, nor workaround or easily patchable modules aimed at achieving the desired result.
In fact there are no route planning modules in the Drupal cauldron, except a few ones that are not enough versatile. For instance the interesting project routeplanner provides the possibility to build a only two points path, one of which is fixed.

The OSM Route Module also provides the automatic multi-segment driving directions retrieval, both as a long-text multi field autofill, and in form of an on-fly rendered block.

As reported in OpenStreetMap Wiki, the Gosmore Routing Engine is not designed for generating very long routes (> 200km). It is suggested to use the module for shortest path not to experience too heavy computational lags.



To work with OSM Route you need to have this configuration:

  • A content type (e.g., POI) containing a field of type geofield (e.g., field_waypoints), to host the waypoints of the path. The field can be multi-value; in this case OSM Route
    will connect also the waypoints inside the entity.
  • A content type (e.g., Itinerary) containing (1) an entity reference to the POI
    and (2) a field of type geofield (e.g., field_path) where to store the
    retrieved path (3, optional) a long text field where to save the driving

Thus you must:

  1. Create/configure the POI content type/entity. Any entity with a geofield will work.
  2. Create/configure the Itinerary content type.
    1. Add a field reference to the POI entities.
    2. Add the path field to the itinerary. It must be of type geofield.
    3. Optionally, you can add a long text field where the module can store the driving instructions.
  3. Configure "OSM route" settings (/admin/config/services/osm_route) to let the module use these entities and fields.

If everything is configured correctly the path will be built when saving the itinerary, ready to be shown on a map.

Project sponsored by Infora.

Project information