Hi,<br><br>I'm a long time Openstreetmap contributor trying to wrap my brain around understanding how to work with QGIS. Quite likely this means I follow the opposite path of most.<br><br>I managed to convert WFS to SHP, load that SHP in JOSM, the java openstreetmap editor and in PostGIS. Translating latin1 to UTF8 and Lambert72 to WGS84. Even , to . as the decimal operator.<br>
<br>I also found how to style the data in the shape files.<br><br> So far so good.<br><br><br>Now I read the chapter in the manual on how to work with OSM data directly in QGIS. What I'm missing is a way to work with the tags on the nodes and a way to visualise route relations.<br>
<br>The best way is probably to give a concrete example. We have cycle node networks. The nodes have rcn_ref tags, usually integers, sometimes START.<br><br>The nodes are members in network relations.<br><br>The ways between the nodes are members of route relations<br>
<br>The route relations are also members of the network relations.<br><br>I want the colour of the buffer around the nodes to be dependent on the network relation they belong to.<br><br>I want the caption along the routes to come from the note tag of the route relations. And I want to draw a buffer along their paths.<br>
<br>Is there a way to access the tags of the relations and the nodes?<br><br>Further down the line, I would love to be able to use QGIS to draw spiderlike network diagrams of public transportation networks. With ways coloured based on the bus lines passing there, 7 colours with an offset.<br>
<br><br><br>At some point I may write a Python plugin myself to work with OSM data. All the data would be stored in PostGIS. Only the nodes would have geometries, which can be uploaded to the OSM server. Ways would have geometries. Relations would have geometries based on their type. But if ways or relations are changed the geometry gets updated at the nodes level. Then all geometries which use those nodes will have to be recalculated (with a trigger function in PostGIS, I guess). I have no idea if such a solution would be able to scale. Especially as I would also like to store historic versions of the nodes, ways and relations in that DB.<br>
<br>The nodes layer would show all the nodes, not only the ones which have no tags. Labels can be queried from the tags in the relations table as well<br><br>The ways layer would show all the non closed ways, not sure about the roundabouts. Maybe all the ways which aren't areas.<br>
<br>The polygons layer would show all the closed ways (areas) and the multipolygon relations. The buildings, the landuse, the boundaries.<br><br>The routes layer would show all the route relations<br><br><br>I have been giving this some thought:<br>
<br>CREATE TABLE users<br>(<br>  userid integer PRIMARY KEY,<br>  username text<br>)<br>WITH (<br>  OIDS=FALSE<br>);<br>ALTER TABLE users<br>  OWNER TO "Jo";<br><br>CREATE TABLE changesets<br>(<br>  csid integer PRIMARY KEY,<br>
  cs_userid integer REFERENCES users,<br>  csts timestamp<br>)<br>WITH (<br>  OIDS=FALSE<br>);<br>ALTER TABLE changesets<br>  OWNER TO "Jo";<br><br>CREATE TABLE nodes<br>(<br>  nodeid bigint PRIMARY KEY,<br>  nd_csid integer REFERENCES changesets,<br>
  ndversion integer,<br>  --ndts timestamp,<br>  geog geography<br>)<br>WITH (<br>  OIDS=FALSE<br>);<br><br>CREATE TABLE ways<br>(<br>  wayid integer PRIMARY KEY,<br>  wy_csid integer REFERENCES changesets,<br>  wyversion integer<br>
  --wyts timestamp<br>)<br>WITH (<br>  OIDS=FALSE<br>);<br><br>CREATE TABLE rels<br>(<br>  relid integer PRIMARY KEY,<br>  rl_csid integer REFERENCES changesets,<br>  rlversion integer<br>  --rlts timestamp<br>)<br>WITH (<br>
  OIDS=FALSE<br>);<br><br>CREATE TABLE keys<br>(<br>  keyid bigserial PRIMARY KEY,<br>  k text<br>)<br>WITH (<br>  OIDS=FALSE<br>);<br>CREATE TABLE vals<br>(<br>  valueid bigserial PRIMARY KEY,<br>  v text<br>)<br>WITH (<br>
  OIDS=FALSE<br>);<br>CREATE TABLE tags<br>(<br>  tagid bigserial PRIMARY KEY,<br>  tg_nodeid bigint REFERENCES nodes,<br>  tg_wayid bigint REFERENCES ways,<br>  tg_relid bigint REFERENCES rels,<br>  tg_keyid bigint REFERENCES keys,<br>
  tg_valueid bigint REFERENCES vals<br>)<br>WITH (<br>  OIDS=FALSE<br>);<br><br>CREATE TABLE waynodes<br>(<br>  wnid bigserial PRIMARY KEY,<br>  wn_way bigint REFERENCES ways,<br>  wn_node bigint REFERENCES nodes<br>)<br>
WITH (<br>  OIDS=FALSE<br>);<br><br>CREATE TABLE relnodes<br>(<br>  rnid bigserial PRIMARY KEY,<br>  rn_rel bigint REFERENCES rels,<br>  rn_node bigint REFERENCES nodes<br>)<br>WITH (<br>  OIDS=FALSE<br>);<br><br>CREATE TABLE relways<br>
(<br>  rwid bigserial PRIMARY KEY,<br>  rw_rel bigint REFERENCES rels,<br>  rw_way bigint REFERENCES ways<br>)<br>WITH (<br>  OIDS=FALSE<br>);<br><br>CREATE TABLE relrelations<br>(<br>  rrid bigserial PRIMARY KEY,<br>  rr_parent bigint REFERENCES rels,<br>
  rr_child bigint REFERENCES rels<br>)<br>WITH (<br>  OIDS=FALSE<br>);<br><br><br>Until now I was considering to program this as stored procedures in PostGIS and with Python from the command line, but it may make a lot more sense to write a QGIS plugin in Python.<br>
<br>My goal is not only to be able to work with the data and visualise it. I also need to find a way to prepare open data, available as shape files and WFS, for integration in Openstreetmap and subsequently to do quality control on it and to assure we keep current with changes coming from upstream and the ability to create feedback reports on changes coming from the OSM contributors, once they are vetted as genuine.<br>
<br>I'd love to hear your thoughts on all this. I wouldn't be surprised if there's something I didn't think about.<br><br>Kind regards,<br><br>Polyglot<br>