Skip to main content
added 2 characters in body
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148

Assuming you're using QGIS >= 1.6.0. There is a geoalgorithm called "Polygons to lines" accessible via Vector > Geometry Tools > Polygons to Lines (otherwise search in the Processing Toolbox Ctrl+Alt+T), which will create a new shapefile with all the attributes of the original.

Vector_Menu

For PyQGIS it is native"native:polygonstolinespolygonstolines"

>>> processing.algorithmHelp("native:polygonstolines")
Polygons to lines (native:polygonstolines)

Converts polygons to lines.

Converts polygons to lines


----------------
Input parameters
----------------

INPUT: Input layer

    Parameter type: QgsProcessingParameterFeatureSource

    Accepted data types:
        - str: layer ID
        - str: layer name
        - str: layer source
        - QgsProcessingFeatureSourceDefinition
        - QgsProperty
        - QgsVectorLayer

OUTPUT: Lines

    Parameter type: QgsProcessingParameterFeatureSink

    Accepted data types:
        - str: destination vector file, e.g. 'd:/test.shp'
        - str: 'memory:' to store result in temporary memory layer
        - str: using vector provider ID prefix and destination URI, e.g. 'postgres:…' to store result in PostGIS table
        - QgsProcessingOutputLayerDefinition
        - QgsProperty

----------------
Outputs
----------------

OUTPUT:  <QgsProcessingOutputVectorLayer>
    Lines

Assuming you're using QGIS >= 1.6.0. There is a geoalgorithm called "Polygons to lines" accessible via Vector > Geometry Tools > Polygons to Lines (otherwise search in the Processing Toolbox Ctrl+Alt+T), which will create a new shapefile with all the attributes of the original.

Vector_Menu

For PyQGIS it is native:polygonstolines

>>> processing.algorithmHelp("native:polygonstolines")
Polygons to lines (native:polygonstolines)

Converts polygons to lines.

Converts polygons to lines


----------------
Input parameters
----------------

INPUT: Input layer

    Parameter type: QgsProcessingParameterFeatureSource

    Accepted data types:
        - str: layer ID
        - str: layer name
        - str: layer source
        - QgsProcessingFeatureSourceDefinition
        - QgsProperty
        - QgsVectorLayer

OUTPUT: Lines

    Parameter type: QgsProcessingParameterFeatureSink

    Accepted data types:
        - str: destination vector file, e.g. 'd:/test.shp'
        - str: 'memory:' to store result in temporary memory layer
        - str: using vector provider ID prefix and destination URI, e.g. 'postgres:…' to store result in PostGIS table
        - QgsProcessingOutputLayerDefinition
        - QgsProperty

----------------
Outputs
----------------

OUTPUT:  <QgsProcessingOutputVectorLayer>
    Lines

Assuming you're using QGIS >= 1.6.0. There is a geoalgorithm called "Polygons to lines" accessible via Vector > Geometry Tools > Polygons to Lines (otherwise search in the Processing Toolbox Ctrl+Alt+T), which will create a new shapefile with all the attributes of the original.

Vector_Menu

For PyQGIS it is "native:polygonstolines"

>>> processing.algorithmHelp("native:polygonstolines")
Polygons to lines (native:polygonstolines)

Converts polygons to lines.

Converts polygons to lines


----------------
Input parameters
----------------

INPUT: Input layer

    Parameter type: QgsProcessingParameterFeatureSource

    Accepted data types:
        - str: layer ID
        - str: layer name
        - str: layer source
        - QgsProcessingFeatureSourceDefinition
        - QgsProperty
        - QgsVectorLayer

OUTPUT: Lines

    Parameter type: QgsProcessingParameterFeatureSink

    Accepted data types:
        - str: destination vector file, e.g. 'd:/test.shp'
        - str: 'memory:' to store result in temporary memory layer
        - str: using vector provider ID prefix and destination URI, e.g. 'postgres:…' to store result in PostGIS table
        - QgsProcessingOutputLayerDefinition
        - QgsProperty

----------------
Outputs
----------------

OUTPUT:  <QgsProcessingOutputVectorLayer>
    Lines
added 1164 characters in body
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148

Assuming you're using QGIS >= 1.6.0. There is a geoalgorithm called "Polygons to lines" accessible via Vector > Geometry Tools > Polygons to Lines (otherwise search in the Processing Toolbox Ctrl+Alt+T), which will create a new shapefile with all the attributes of the original.

Vector_Menu

For PyQGIS it is native:polygonstolines

>>> processing.algorithmHelp("native:polygonstolines")
Polygons to lines (native:polygonstolines)

Converts polygons to lines.

Converts polygons to lines


----------------
Input parameters
----------------

INPUT: Input layer

    Parameter type: QgsProcessingParameterFeatureSource

    Accepted data types:
        - str: layer ID
        - str: layer name
        - str: layer source
        - QgsProcessingFeatureSourceDefinition
        - QgsProperty
        - QgsVectorLayer

OUTPUT: Lines

    Parameter type: QgsProcessingParameterFeatureSink

    Accepted data types:
        - str: destination vector file, e.g. 'd:/test.shp'
        - str: 'memory:' to store result in temporary memory layer
        - str: using vector provider ID prefix and destination URI, e.g. 'postgres:…' to store result in PostGIS table
        - QgsProcessingOutputLayerDefinition
        - QgsProperty

----------------
Outputs
----------------

OUTPUT:  <QgsProcessingOutputVectorLayer>
    Lines

Assuming you're using QGIS >= 1.6.0. There is a geoalgorithm called "Polygons to lines" accessible via Vector > Geometry Tools > Polygons to Lines (otherwise search in the Processing Toolbox Ctrl+Alt+T), which will create a new shapefile with all the attributes of the original.

Vector_Menu

Assuming you're using QGIS >= 1.6.0. There is a geoalgorithm called "Polygons to lines" accessible via Vector > Geometry Tools > Polygons to Lines (otherwise search in the Processing Toolbox Ctrl+Alt+T), which will create a new shapefile with all the attributes of the original.

Vector_Menu

For PyQGIS it is native:polygonstolines

>>> processing.algorithmHelp("native:polygonstolines")
Polygons to lines (native:polygonstolines)

Converts polygons to lines.

Converts polygons to lines


----------------
Input parameters
----------------

INPUT: Input layer

    Parameter type: QgsProcessingParameterFeatureSource

    Accepted data types:
        - str: layer ID
        - str: layer name
        - str: layer source
        - QgsProcessingFeatureSourceDefinition
        - QgsProperty
        - QgsVectorLayer

OUTPUT: Lines

    Parameter type: QgsProcessingParameterFeatureSink

    Accepted data types:
        - str: destination vector file, e.g. 'd:/test.shp'
        - str: 'memory:' to store result in temporary memory layer
        - str: using vector provider ID prefix and destination URI, e.g. 'postgres:…' to store result in PostGIS table
        - QgsProcessingOutputLayerDefinition
        - QgsProperty

----------------
Outputs
----------------

OUTPUT:  <QgsProcessingOutputVectorLayer>
    Lines
added 105 characters in body
Source Link
Taras
  • 34k
  • 4
  • 73
  • 148

Assuming you're using QGIS >= 1.6.0, the menu option you need. There is Vector|Geometry Tools|Polygons to Linesa geoalgorithm called "Polygons to lines" accessible via Vector > Geometry Tools > Polygons to Lines (otherwise search in the Processing Toolbox Ctrl+Alt+T), which will create a new shapefile with all the attributes of the original.

Vector_Menu

In QGIS 2

Vector > Geometry Tools > Polygons to lines

In QGIS 3

Processing Toolbox > Vector Geometry > Polygons to lines

Assuming you're using QGIS >= 1.6.0, the menu option you need is Vector|Geometry Tools|Polygons to Lines, which will create a new shapefile with all the attributes of the original.

Vector_Menu

In QGIS 2

Vector > Geometry Tools > Polygons to lines

In QGIS 3

Processing Toolbox > Vector Geometry > Polygons to lines

Assuming you're using QGIS >= 1.6.0. There is a geoalgorithm called "Polygons to lines" accessible via Vector > Geometry Tools > Polygons to Lines (otherwise search in the Processing Toolbox Ctrl+Alt+T), which will create a new shapefile with all the attributes of the original.

Vector_Menu

Source Link
MerseyViking
  • 14.6k
  • 1
  • 43
  • 76
Loading