2

I'm attempting to use OSM data in QGIS 2.8.2. I've imported my data into SpatiaLite layers using the following steps:

  1. Vector -> OpenStreetMap -> Download Data...
  2. Vector -> OpenStreetMap -> Import Topology from XML...
  3. Vector -> OpenStreetMap -> Export Topology to SpatiaLite...

For the last step, I imported the polylines. I noticed that some of the primary highways have gaps in the middle. This isn't a case of a segment going outside my region--the gap is right in the middle of the region.

You'll notice that I put the primary highway on its own layer by selecting polylines with attributes I wanted. The light-blue lines beneath the primary highway are every single polyline. Notice that there is no polyline connecting the disjoint highway segments.

I'm assuming that when I chose "Vector -> OpenStreetMap -> Export Topology to SpatiaLite...", all polylines are exported no matter which attributes I check. Is that right? If not, is this a symptom of me not selecting "tunnels", for instance?

This is not a duplicate of this question. The aforementioned question is asking how to import OSM data. I've already demonstrated that I can import the data. The steps I listed are the same as in the accepted answer to 1. My question is about missing polylines.

enter image description here

watkipet
  • 209
  • 1
  • 7

2 Answers2

1

This is a known issue: OSM plugin fails to download all data within given extent

I've provided a different working solution at the related question How do I load OSM vector data in QGIS 2.x?

underdark
  • 84,148
  • 21
  • 231
  • 413
  • Thanks! I thought this issue only applied to polylines that extended outside the region. However, Note 4 mentions the issue I'm having. – watkipet Jun 22 '15 at 16:03
1

Another related bug ticket is https://hub.qgis.org/issues/12727 (not dealing with lines crossing the bounding box).

My workaround is to load the OSM data from the first import step with Add vector layer.

AndreJ
  • 76,698
  • 5
  • 86
  • 162
  • Do I still get a Spatialite DB if I use your workaround? What If I only want primary roads in a certain zip code? Can I filter on the vector layer like I can with the Spatialite DB? – watkipet Jun 22 '15 at 16:07
  • Add vector layer uses a spatialite database internally. You can save the layers to a new spatialite database. You may also use ogr2ogr to create a spatialite DB directly, see http://osgeo-org.1560.x6.nabble.com/OSM-data-gaps-td5204902.html for an example. For filtered data, I suggest to use the QUICKOSM plugin. This seems to work without data loss. You can get geojson or shapefile output. – AndreJ Jun 22 '15 at 16:53