1

I am about to create a QGIS file on which it should be visible which companies are working together. As source I have got two Excel tables.

  1. Table = Distribution Centers
  2. Table = Point of sales

I like to connect The point of sales (always several) with the associated distribution center. In the tables of the distribution centers you have the ID, and some (x/y) coordinates. In the Point of sale table you can find a ID, also (x/y) coordinates + a ID and which allows you to connect the Point of sales and the distribution centers (the second ID is the same like any of the distribution centers).

I want to separate the group of the distribution center and the related point of sales as one shapefile without searching manually in my Excel tables and creating 1 shape manually for every group...

I hope you will be able to understand my problem although my English is horrible.


My Lines are like this...

TDLinx-DC|TDLinx_-POS|Geometrie 
00421362|00421362|LINESTRING (2.30567 48.7321) 
00421362|00611434|LINESTRING (0.89378 46.4288)
00421362|00409507|LINESTRING (6.45527 46.359952) 

Now it is like this. Might it be impossible to have a mixed point AND polylines layer?

TDLinx-DC|TDLinx-POS|Geo
00421102|00617429|LINESTRING (6.06043 48.70638, 7.34101 47.7495)
00421102|00256888|LINESTRING (6.06043 48.70638, 6.1812365 48.6876425)
00421102|00264459|LINESTRING (6.06043 48.70638, 5.0379298 47.3211782)
00421102|00264472|LINESTRING (6.06043 48.70638, 6.4946471 48.591343)
00421102|00264483|LINESTRING (6.06043 48.70638, 6.1618809 48.6763621)
00421102|00264501|LINESTRING (6.06043 48.70638, 7.7577037 48.5677807)
00421102|00264502|LINESTRING (6.06043 48.70638, 5.5904536 47.4484859)
00421102|00264503|LINESTRING (6.06043 48.70638, 6.1550176 47.6202079)
00421102|00264758|LINESTRING (6.06043 48.70638, 6.4474578 48.1758391)
00421102|00269360|LINESTRING (6.06043 48.70638, 6.0215766 47.2392361)
00421102|00269382|LINESTRING (6.06043 48.70638, 5.384374 49.1602425)
00421102|00269399|LINESTRING (6.06043 48.70638, 7.3564671 48.0791666)
00421102|00269478|LINESTRING (6.06043 48.70638, 6.8588071 47.6378244)
00421102|00429683|LINESTRING (6.06043 48.70638, 7.7465095 48.5839322)
00421102|00421102|MULTIPOINT (6.06043 48.70638, 7.34101 47.7495, 6.1812365 48.6876425)
1
  • No, you can not mix points and lines in one shapefile. That`s aganist the definition of shapefiles.
    – AndreJ
    Commented Jun 20, 2013 at 10:56

1 Answer 1

2

Using Excel, you can create a CSV file with lines encoded in WKT, e.g.

dist_center; pt_of_sale; wkt
center1; pt1; LINESTRING (30 10, 10 30)
center1; pt2; LINESTRING (40 30, 20 50)
...

Use Excel formulas to automatically generate the WKT text.

Load the CSV into QGIS using Add Delimited Text layer tool.

4
  • Hello Underdark, i guess this will be a good solution for my problems. The only problem actually is that Qgis dont want to open the text file I created as a Shape file: Der Layer file:///C:/Documents%20and%20Settings/maue/Bureau/Versuch_Shape_Vorlage2.txt?delimiter=%7C&delimiterType=plain&wktField=Geom ist ungültig und kann der Karte nicht hinzugefügt werden --> The layer file is invalid and can not be added to the existing map. Any suggestions? Commented Jun 19, 2013 at 14:15
  • @RouvenMaue Please paste the first few lines of your text file. (You can edit the question).
    – underdark
    Commented Jun 19, 2013 at 14:18
  • @RouvenMaue Well, two coordinates don't make a line. It needs at least start and end point - therefore 4 coordinates.
    – underdark
    Commented Jun 19, 2013 at 15:46
  • Oh well, I thought there will be a connection between the rows/lines. But it was excactly the problem. That works right now. It also works to have several lines in one shapefile. But one thing does not work: to combine in one text file POINT and STRINGLINE. --> TDLinx-DC|TDLinx-POS|Geo 00421102|00617429|LINESTRING (6.06043 48.70638, 7.34101 47.7495) 00421102|00256888|LINESTRING (6.06043 48.70638, 6.1812365 48.6876425) 00421102|00421102|POINT (6.06043 48.70638) is the problem, that I can not use stringlines and points as 1 layer? And how to solve that prob? Rouven Commented Jun 20, 2013 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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