1

I am trying to convert a few polygons to polylines so I can save them as a .GPX file.

I'm using QGIS 2.8.1 (Wein) on the Mac.

It seems to be hanging. I only have a few small polygons (see screenshot) but it's taking forever. I can't tell if it's actually processing them or if it's crashed. I usually give up after waiting 10-15 minutes.

Has anyone else run into this problem before?

Link to shapefile: https://ucdavis.box.com/shared/static/lhnqypkphlma4y1h4hw76gd29m8mdets.zip

QGIS Polygons to Lines

EDIT: I found a workaround by using GDAL ogr2ogr in the Terminal to directly convert the shapefile to a .gpx file. I used this command:

ogr2ogr -f GPX -dsco GPX_USE_EXTENSIONS=YES FPS_buildings.gpx FPS_buildings.shp -nlt MULTILINESTRING

This is a good workaround but I still don't have an answer about my original question.

  • Can you share your source data as shp or GML or something? – user30184 May 11 '15 at 20:53
  • Yes @user30184! Here is the shp: ucdavis.box.com/shared/static/… – MattSidor May 11 '15 at 20:56
  • I don't have QGIS available but conversion with GDAL seemed to work ogr2ogr -f gpx FPS_buildings.gpx FPS_buildings.shp -nlt linestring. If direct output to GPX does not give a desired result you can use shp as an interim format. However, QGIS should really be able to do the job within a second as well. – user30184 May 11 '15 at 21:05
  • Thanks @user30184, I will try the command line. I can't direct output to GPX because the shapefile has polygons, so QGIS throws an error. That's why I'm trying to convert to lines. – MattSidor May 11 '15 at 21:06
  • 1
    Not sure if it's the cause or not, but your shapefile has some issues. I ran a check geometry (ArcGIS) on it and found three of the records have null geometry. I suspect this is what's causing the tool to hang. I believe the equivalent check in QGIS is Check Geometry Validity. I also note there are two 'extra' polygons where three buildings overlap, which may or may not be intentional. – Chris W May 11 '15 at 23:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.