1

I'm working with QGIS 3.4.3 and have a list of addresses (1500ish) that i need to map into lines. I have a CSV file having a start and end of each street and also have the same list separated in two CSVs, one for start and the other for ending. What I need is to put those addresses as lines into my map.

I also used mmqgis to geolocate the starting and ending points in order to join them with lines. So, I'm working with 2 options now.

My questions are:

  1. How can I geolocate lines with a start and end address?
  2. How can i join multiple points with a line?
  • Welcome on GIS SE. Does join by lines (hub lines) tool suit your question? You can find it in processing toolbox. If not, can you explain, maybe with an example, what you want to achieve? How does your data look like? – MrXsquared Jan 2 at 15:35
  • I tried, but it shows no results. Let's say i have street A n°100 to street A n°500, i need a line that connects those two addresses. The table looks like this: STREET | CITY | STATE | COUNTRY Street A 100| buenos aires|buenos aires| argentina The other table it's the same except it's Street A 500 Hope that helps – Juker92 Jan 2 at 15:41
1

Join by lines (hub lines) tool is what you are after.

You need your two separate files, one with start points and one with end points. Each street needs to have an ID, or unique matching field in both files.

enter image description here

If you do not have this unique field, you can generate it with Excel or QGIS. One idea would be to concatenate the fields STREET | CITY | STATE | COUNTRY. But not sure if this is unique in your case. However, you need to figure this out and in case its not, you will have to find another way to get an unique matching ID for your streets. To concatenate in QGIS, open the field calculator and create a new (virtual) field with the expression concat( "STREET", ' - ', "CITY", ' - ', "STATE", ' - ', "COUNTRY").

Edit: just seen your second table contains a different housenumber in STREET field. You need to remove these, e.g. with nested replace("STREET", 1, '') function.

enter image description here

  • Oh i think i understand now what to do with fields, thank you very much! – Juker92 Jan 2 at 16:45
  • 1
    I solved it by adding a new column named ID, then i connected both point layers using that tool and voilà! – Juker92 Jan 2 at 17:13

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.