Handling Invalid Geometries ( Qgis Geometry Class Reference, Class: Qgsgeometry

Add geometry attributes¶

Computes geometric properties of the features in a vector layer andincludes them in the output layer.

Đang xem: Qgis geometry

It generates a new vector layer with the same content as the input one,but with additional attributes, containing geometric measurementsbased on a selected CRS.

The attributes added to the table depend on the geometry type anddimension of the input layer:

for point layers: X (xcoord), Y (ycoord), Z (zcoord)coordinates and/or M value (mvalue)

for line layers: length and, for the LineString andCompoundCurve geometry types, the feature sinuosity and straightdistance (straightdis)

for polygon layers: perimeter and area

Default menu: Vector ‣ Geometry Tools

Parameters¶

Label

Name

Type

Description

Input layer

INPUT

Input vector layer

Calculate using

CALC_METHOD

Default: 0

Calculation parameters to use for the geometric properties.One of:

0 — Layer CRS

1 — Project CRS

2 — Ellipsoidal

Added geom info

OUTPUT

Default:

Specify the output (input copy with geometry) layerOne of:

Create Temporary Layer (TEMPORARY_OUTPUT)

Save to File…

Save to Geopackage…

Save to PostGIS Table

The file encoding can also be changed here.

Outputs¶

Label

Name

Type

Description

Added geom info

OUTPUT

Copy of the input vector layer with the addition of the geometry fields

Aggregate¶

Takes a vector or table layer and creates a new layer by aggregatingfeatures based on a group by expression.

Features for which group by expression returns the same value aregrouped together.

It is possible to group all source features together using constantvalue in group by parameter, example: NULL.

It is also possible to group features by multiple fields using Arrayfunction, example: Array(“Field1”, “Field2”).

Geometries (if present) are combined into one multipart geometry foreach group.Output attributes are computed depending on each given aggregatedefinition.

This algorithm allows to use the defaultaggregates functions of the wnyrails.org Expression engine.

See also

Collect geometries, Dissolve

Parameters¶

Label

Name

Type

Description

Input layer

INPUT

Input vector layer

Group by expression

GROUP_BY

Default: ‘NULL’

Choose the grouping field.If NULL all features will be grouped.

Aggregates

AGGREGATES

List of output layer field definitions.Example of a field definition:

{‘aggregate’: ‘sum’, ‘delimiter’: ‘,’, ‘input’: ‘ $area’,‘length’: 10, ‘name’: ‘totarea’, ‘precision’: 0, ‘type’: 6}

By default, the list contains all the fields of the input layer.In the GUI, you can edit these fields and their definitions,and you can also:

For each of the fields you’d like to retrieve information from,you need to define the following:

Input expression (input)

Field or expression from the input layer.

Aggregate function (aggregate)

Function to use on the inputexpression to return the aggregated value.

Default: concatenate (for string data type), sum (fornumeric data type)

Delimiter (delimiter)

Text string to separate aggregated values, for example incase of concatenation.

Default: ,

Output field name (name)

Name of the aggregated field in the output layer.By default input field name is kept.

Type (type)

Data type of the output field. One of:

1 — Boolean

2 — Integer

4 — Integer64

6 — Double

10 — String

14 — Date

16 — DateTime

Length (length)

Length of the output field.

Precision (precision)

Precision of the output field.

Load fields from layer

GUI only

You can load fields from another layer and use them for theaggregation

Aggregated

OUTPUT

Default:

Specify the output (aggregate) layerOne of:

Create Temporary Layer (TEMPORARY_OUTPUT)

Save to File…

Save to Geopackage…

Save to PostGIS Table…

The file encoding can also be changed here.

Outputs¶

Label

Name

Type

Description

Aggregated

OUTPUT

Multigeometry vector layer with the aggregated values

Boundary¶

Returns the closure of the combinatorial boundary of the inputgeometries (i.e. the topological boundary of the geometry).

Only for polygon and line layers.

For polygon geometries , the boundary consists of all the linesmaking up the rings of the polygon.

*

Boundaries (black dashed line) of the source polygon layer¶

For lines geometries, the boundaries are their end points.

*

Boundary layer (red points) for lines. In yellow a selected feature.¶

Parameters¶

Label

Name

Type

Description

Input layer

INPUT

Input line or polygon vector layer

Boundary

OUTPUT

Default:

Specify the output (boundary) layer.One of:

Create Temporary Layer (TEMPORARY_OUTPUT)

Save to File…

Save to Geopackage…

Save to PostGIS Table…

The file encoding can also be changed here.

Xem thêm: Geometry Of Nh3 – Ammonia, Nh3 Molecular Geometry & Polarity

Outputs¶

Label

Name

Type

Description

Boundary

OUTPUT

Boundaries from the input layer (point for line, and linefor polygon)

Bounding boxes¶

Calculates the bounding box (envelope) of each feature in an input layer.Polygon and line geometries are supported.

*

Black lines represent the bounding boxes of each polygon feature¶

Allowsfeatures in-place modification

See also

Minimum bounding geometry

Parameters¶

Label

Name

Type

Description

Input layer

INPUT

Input line or polygon vector layer

Bounds

OUTPUT

Default:

Specify the output (bounding box) layer.One of:

Create Temporary Layer (TEMPORARY_OUTPUT)

Save to File…

Save to Geopackage…

Save to PostGIS Table…

The file encoding can also be changed here.

Outputs¶

Label

Name

Type

Description

Bounds

OUTPUT

Bounding boxes of input layer

*

Buffer (in yellow) of points, line and polygon¶

Allowsfeatures in-place modification

Default menu: Vector ‣ Geoprocessing Tools

Parameters¶

Label

Name

Type

Description

Input layer

INPUT

Input vector layer

Distance

DISTANCE

Default: 10.0

Buffer distance (from the boundary of each feature).You can use the Data Defined button on the right to choosea field from which the radius will be calculated.This way you can have different radius for each feature(see Variable distance buffer (Graphical Modeler only)).

Segments

SEGMENTS

Default: 5

Controls the number of line segments to use to approximatea quarter circle when creating rounded offsets.

End cap style

END_CAP_STYLE

Default: 0

Controls how line endings are handled in the buffer.One of:

0 — Round

1 — Flat

2 — Square

*

Round, flat and square cap styles¶

Join style

JOIN_STYLE

Default:

Specifies whether round, miter or beveled joins should beused when offsetting corners in a line.Options are:

0 — Round

1 — Miter

2 — Bevel

Miter limit

MITER_LIMIT

Default: 2.0

Controls the maximum distance from the offset curve to usewhen creating a mitered join (only applicable for miterjoin styles).Minimum: 1.

Dissolve result

DISSOLVE

Default: False

Dissolve the final buffer. If True (checked), overlappingbuffers will be dissolved (combined) into a new feature.

*

Standard and dissolved buffer¶

Buffered

OUTPUT

Default:

Specify the output (buffer) layer.One of:

Skip output

Create Temporary Layer (TEMPORARY_OUTPUT)

Save to File…

Save to Geopackage…

Save to PostGIS Table…

The file encoding can also be changed here.

Outputs¶

Label

Name

Type

Description

Buffered

OUTPUT

Output (buffer) polygon layer

*

The red stars represent the centroids of the features of theinput layer.¶

Allowsfeatures in-place modification

Default menu: Vector ‣ Geometry Tools

Parameters¶

Label

Name

Type

Description

Input layer

INPUT

Input vector layer

Create centroid for each part

ALL_PARTS

Default: False

If True (checked), a centroid will be created for each partof the geometry

Centroids

OUTPUT

Default:

Specify the output (centroid) layer.One of:

Create Temporary Layer (TEMPORARY_OUTPUT)

Save to File…

Save to Geopackage…

Save to PostGIS Table…

The file encoding can also be changed here.

Check validity¶

Performs a validity check on the geometries of a vector layer.

The geometries are classified in three groups (valid, invalid anderror) and for each group, a vector layer with its features isgenerated:

The Valid output layer contains only the valid features (withouttopological errors).

The Invalid output layer contains all the invalid features foundby the algorithm.

The Error output layer is a point layer that points to where theinvalid features were found.

The attribute tables of the generated layers will contain someadditional information (“message” for the error layer, “FID” and“_errors” for the invalid layer and only “FID” for the validlayer):

The attribute table of each generated vector layer will contain someadditional information (number of errors found and types of error):

*

Left: the input layer. Right: the valid layer (green), the invalidlayer (orange)¶

Default menu: Vector ‣ Geometry Tools

See also

Fix geometries and the core pluginGeometry Checker Plugin

Parameters¶

Label

Name

Type

Description

Input layer

INPUT_LAYER

Input vector layer

Method

METHOD

Default: 2

Method to use to check validity.Options:

0: The one selected in digitizing settings

1: wnyrails.org

2: GEOS

Ignore ring self intersection

IGNORE_RING_SELF_INTERSECTION

Default: False

Ignore self intersecting rings when checking for validity.

Valid output

VALID_OUTPUT

Default:

Specify the vector layer to contain a copy of the validfeatures of the source layer. One of:

Skip output

Create Temporary Layer (TEMPORARY_OUTPUT)

Save to File…

Save to Geopackage…

Save to PostGIS Table…

The file encoding can also be changed here.

Invalid output

INVALID_OUTPUT

Default:

Vector layer containing copy of the invalid features ofthe source layer with the field _errors listing thesummary of the error(s) found. One of:

Skip output

Create Temporary Layer (TEMPORARY_OUTPUT)

Save to File…

Save to Geopackage…

Save to PostGIS Table…

The file encoding can also be changed here.

Error output

ERROR_OUTPUT

Default:

Point layer of the exact position of the validityproblems detected with the message field describingthe error(s) found. One of:

Skip output

Create Temporary Layer (TEMPORARY_OUTPUT)

Save to File…

Save to Geopackage…

Save to PostGIS Table…

The file encoding can also be changed here.

Outputs¶

Label

Name

Type

Description

Count of errors

ERROR_COUNT

The number of geometries that caused errors.

Error output

ERROR_OUTPUT

Point layer of the exact position of the validityproblems detected with the message field describingthe error(s) found.

Count of invalid features

INVALID_COUNT

The number of invalid geometries.

Invalid output

INVALID_OUTPUT

Vector layer containing copy of the invalid features ofthe source layer with the field _errors listing thesummary of the error(s) found.

Count of valid features

VALID_COUNT

The number of valid geometries.

Xem thêm: Women'S Lab Uniform S, Shop All Unisex & Women&#39S Lab Coats

Valid output

VALID_OUTPUT

Vector layer containing a copy of the valid features ofthe source layer.

Types of error messages and their meanings¶

If the GEOS method is used the following error messages can occur:¶

Error message

See more articles in category: Geometry
See also  3 Geometric Means Between 6 And 96? Geometric Progression

Leave a Reply

Back to top button