I must admit I don't know sqlite nor spatialite. Is it possible to create indexes, foreign key relations, stored procedures, triggers in it?<br><br>I get the impression QGIS is already very much integrated with PostGIS, so for most people it shouldn't be a problem to install it. Once the connection is set up, all the rest can be scripted.<br>
<br>I did have a look at the existing plugin and although I already noticed that the ways layer contains the nodes with tags and it seems to know what relations these nodes belong to, I can't seem to use the value of the rcn_ref tag for the label.<br>
<br>Is the bug related to high node ids still in there? Can you point me to the source code of the plugin? Who knows, maybe I can fix that.<br><br>Jo<br><br><div class="gmail_quote">2013/5/18 Stefan Keller <span dir="ltr"><<a href="mailto:sfkeller@gmail.com" target="_blank">sfkeller@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Polyglot<br>
<br>
Just to be sure I'd like to point to the existing OSM plugin for QGIS<br>
[1], which deserves an evaluation and probably needs some care.<br>
<br>
Then, although I'm an active PostGIS (Postgres) supporter, I would<br>
recommend Spatialite (SQLite) instead, given you use case.<br>
It's more lightweight because it does not need a server installation<br>
and you probably only use it as a temporary store.<br>
<br>
Yours, Stefan<br>
<br>
<br>
[1] <a href="http://wiki.openstreetmap.org/wiki/QGIS_OSM_Plugin" target="_blank">http://wiki.openstreetmap.org/wiki/QGIS_OSM_Plugin</a><br>
<br>
2013/5/18 Jo <<a href="mailto:winfixit@gmail.com">winfixit@gmail.com</a>>:<br>
<div><div class="h5">> Hi,<br>
><br>
> I'm a long time Openstreetmap contributor trying to wrap my brain around<br>
> understanding how to work with QGIS. Quite likely this means I follow the<br>
> opposite path of most.<br>
><br>
> I managed to convert WFS to SHP, load that SHP in JOSM, the java<br>
> openstreetmap editor and in PostGIS. Translating latin1 to UTF8 and<br>
> 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<br>
> in QGIS. What I'm missing is a way to work with the tags on the nodes and a<br>
> way to visualise route relations.<br>
><br>
> The best way is probably to give a concrete example. We have cycle node<br>
> 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<br>
> network relation they belong to.<br>
><br>
> I want the caption along the routes to come from the note tag of the route<br>
> 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<br>
> spiderlike network diagrams of public transportation networks. With ways<br>
> 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<br>
> the data would be stored in PostGIS. Only the nodes would have geometries,<br>
> which can be uploaded to the OSM server. Ways would have geometries.<br>
> Relations would have geometries based on their type. But if ways or<br>
> relations are changed the geometry gets updated at the nodes level. Then all<br>
> geometries which use those nodes will have to be recalculated (with a<br>
> trigger function in PostGIS, I guess). I have no idea if such a solution<br>
> would be able to scale. Especially as I would also like to store historic<br>
> 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<br>
> 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<br>
> roundabouts. Maybe all the ways which aren't areas.<br>
><br>
> The polygons layer would show all the closed ways (areas) and the<br>
> 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<br>
> and with Python from the command line, but it may make a lot more sense to<br>
> 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<br>
> also need to find a way to prepare open data, available as shape files and<br>
> WFS, for integration in Openstreetmap and subsequently to do quality control<br>
> on it and to assure we keep current with changes coming from upstream and<br>
> the ability to create feedback reports on changes coming from the OSM<br>
> 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<br>
> there's something I didn't think about.<br>
><br>
> Kind regards,<br>
><br>
> Polyglot<br>
><br>
</div></div>> _______________________________________________<br>
> Qgis-user mailing list<br>
> <a href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/qgis-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
><br>
</blockquote></div><br>