1

I have installed QGIS and I would like to upload a .xls-file (or Access database) with 2 GPS points (starting point and ending point), a road name and some distances from the starting point, for instance, every 500m from the starting point until the ending one.

I would like to have a route in QGIS and to give a colour to every single segment (in the example each 500m of the route coloured in a different way). Is it possible? How the .xls-file should be to allow the upload?

3

This is a very broad question, so I won't go into details on every step. Instead, I summarized the basic process you would want to follow, along with proper terminology to help you locate instructions elsewhere.

Step One: Find a route between two known points

This process is called routing. Here's an excellent blog post by Anita Graser summarizing the different routing tools in QGIS. You can find other resources by searching for "QGIS routing" in this forum and elsewhere on the internet. There are two types of routing tools:

  • The first type assumes you have a road network that you want to route along. To use this type of routing, you would need to acquire a road network dataset (eg from Open Street Map).
  • The second type uses web-based services like Google Maps, Open Street Map, etc. (You probably want this type.)

The proper formatting of your input data will depend on the routing method you choose. There are services that let you directly type in the lat/long of the starting and ending points. Other services may let you input a point layer or CSV. Read the documentation for the specific routing tool to find out how to format the input file. In any case it's unlikely the expected format will be .xls, but know that any spreadsheet program (eg, Excel) can create a file in .csv format.

Once you generate a route, the output will be a line layer.

Step Two: Split the route line into segments of specified lengths

Depending on how you generated the route line, it may be a single line or it may be in separate segments. You'll probably want it to be a single line for this step, so use the dissolve tool to merge it into a single line if necessary.

Split a line into segments of the same length, using the tool v.split as explained here.

Use this search term to find other tutorials and methods: "qgis split line into equal segments."

Step Three: Give a different color to each route segment

This is called styling or symbology. Have a look at the QGIS Manual: Symbology Properties section.

You will probably want to apply a categorized style.

  • Thanks, I'll take a look and let you know :-) – michele vietri Sep 16 at 19:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.