# Tag Info

Accepted

### Finding distance between two first vertexes of line in QGIS

This Expression calculates the distance between the first and second vertex in the units of the layers coordinate reference system: distance(point_n(\$geometry, 1), point_n(\$geometry, 2))
• 560

### Extracting coordinates from shapely geometry polygon with PyQGIS

If you want to avoid the dependency on Shapely etc then you can do it entirely with in the PyQGIS framework using vertexAt: for i in range(bounds_rotated.vertexCount() - 1): print(bounds_rotated....
• 82.6k

### Extracting coordinates from shapely geometry polygon with PyQGIS

With the code below, I could also get the same shapely.geometry.polygon.Polygon-object: from qgis.core import QgsProject layer = QgsProject.instance().mapLayersByName("polygon")[0] ext = ...
• 33.7k
1 vote

### Creating new and separate layer from hole(s) in multiple layers in QGIS

My start layer: Delete holes: Difference the delete hole layer with your start layer to create polygons where there were holes: If you want to you can Merge the difference layer with your start ...
• 76.2k

### Filtering polygons by name in one column of QGIS Attribute Table

This is a fairly simple task and the perfect use case for Python if you are up for trying a PyQGIS solution. The advantage here is that you don't even need to load your csv file into QGIS, you can ...
• 22.6k

### Filtering polygons by name in one column of QGIS Attribute Table

You can import your csv as an non geographic table by choosing the No geometry option in the Geometry Definition section in the delimited text data manager window as shown below Also note that ...
Accepted

### Filtering polygons by name in one column of QGIS Attribute Table

The expression is syntactically incorrect: string literals should be enclosed by single quotes, not double quotes; the SQL IN operator is usually used to specify multiple values and should be followed ...
• 1,811
Accepted

### Calculating area of intersection of two segmented polygons in QGIS

If you have many features QGIS processing tools will be fast. My farms can overlap so I start with Dissolve (advanced option: keep disjoint features separate) Intersect farms with villages Field ...
• 76.2k

### Calculating area of intersection of two segmented polygons in QGIS

You can perform this calculation in an expression rather than using the sequence you have described. Using your villages layer this expression will calculate the area of intersection you can use this ...
• 1,850
1 vote

### Creating buffer in QGIS without including surface of original polygon?

Geometry By Expression: single_sided_buffer(geometry:=boundary( force_rhr( \$geometry)), distance:=30) Force right hand rule Forces a geometry to respect the Right-Hand-Rule, in which the area that ...
• 76.2k
Accepted

### ST_ReducePrecision PostGIS function throwing an error

As mentioned in the comments... a grid size/tolerance of 0.0001 in WGS84 coordinates isn't very precise anymore (~11 meter, depending on where on earth you are, overview of precisions: openstreetmap ...
• 3,804

### Convert polyline features to polygons given the attributes using ArcGIS Pro

This is reverse of what you are doing. Input: Use feature to polygon: Create a copy of output and remove holes inside each polygon using field calculator on field Shape: def outRing(shp): part=shp....
• 23.2k

### Removing thin rectangles from a shapely polygon

If you want to try to keep the original shape as good as possible, you can shrink and grow the polygon again using e.g. "mitre" style buffers. poly.buffer(-d, join_style="mitre")....
• 3,804

### KML polygon crossing 180th/anti-mederian

I was having the same problem in a program in python. It happens when the difference between the longitudes values are bigger then 180. In this case, just add 360 to the negative longitude. def ...

### Dissolving polygons within other polygons and accumulated one of their values in QGIS

One possible approach is to first intersect the buildings with the cadastral units using the Intersection tool. This will give you the attributes from the cadastral layer in a new building layer. You ...
• 131

### Rounding vertices of polygon to fixed number of decimal places in QGIS

You can use the "Snap points to grid" (native:snappointstogrid) processing algorithm https://docs.qgis.org/3.34/en/docs/user_manual/processing_algs/qgis/vectorgeometry.html#snap-points-to-...
• 1,811
Accepted

### Rounding vertices of polygon to fixed number of decimal places in QGIS

THIS WILL OVERWRITE YOUR DATA (MAKE A COPY) That's easy: Open Field Calculator. Insert this code: geom_from_wkt(geom_to_wkt(@geometry, 0)) Replace 0 with precision you need. Check box Update existing ...
• 7,476