Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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 1 shape file 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)
share|improve this question
    
No, you can not mix points and lines in one shapefile. That`s aganist the definition of shapefiles. –  Andre Joost Jun 20 '13 at 10:56

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
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?del‌​imiter=%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? –  Rouven Maue Jun 19 '13 at 14:15
    
@RouvenMaue Please paste the first few lines of your text file. (You can edit the question). –  underdark Jun 19 '13 at 14:18
    
@RouvenMaue Well, two coordinates don't make a line. It needs at least start and end point - therefore 4 coordinates. –  underdark Jun 19 '13 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 –  Rouven Maue Jun 20 '13 at 13:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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