-1

I'm trying to convert a polygon layer into a polyline layer using a free open source tool. I have been able to perform this task in ArcGIS but can't find any free tools that will do the same thing.

Has anyone come across a tool that can do this?

closed as too broad by PolyGeo Dec 18 '17 at 8:53

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • The term would be LineString or MultiLineString in many tools. ;) – bugmenot123 Dec 18 '17 at 8:48
  • Now that you have an answer about how to do this using ogr2ogr, I think that you should re-word your question to ask that as a more focused question. If you are seeking more software recommendations then don't forget that there is a Software Recommendations Stack Exchange. – PolyGeo Dec 18 '17 at 8:55
2

ogr2ogr can do it:

I have some tectonic plates polygons:

$ ogrinfo PB2002_plates.shp
INFO: Open of `PB2002_plates.shp'
      using driver `ESRI Shapefile' successful.
1: PB2002_plates (Polygon)

Convert:

$ ogr2ogr -nlt MULTILINESTRING linear.shp PB2002_plates.shp

What have I got?

$ ogrinfo linear.shp
INFO: Open of `linear.shp'
      using driver `ESRI Shapefile' successful.
1: linear (Line String)

The attributes are preserved and the geometry is now LINESTRING:

 PlateName (String) = Africa
  LINESTRING (-0.4379 -54.8518,-0.914655 -54.4535,-1.3822 -54.0533,-2.37231 -54.3274,-2.91952 -53.5469,-3.44688 -52
.764,-3.95559 -51.9788,-4.23767 -52.0486,-4.47762 -51.5912,-4.71279 -51.1333,-4.94334 -50.6749,-5.16942 -50.2161,-6
.1

Note this converts each feature to a polyline so most borders are still present twice, once for each feature on either side of the border. If you want to convert polygons into a network line data set, that's another problem...

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