New answers tagged geometry
1
vote
Accepted
Set point geometry of a list of points in PYQGIS
You need to define a Coordinate Reference System for your layer.
You can do this when you define your QgsVectorLayer object like this:
vl = QgsVectorLayer('Point?crs=EPSG:3857', 'Error_point', 'memory'...
0
votes
Accepted
Clip lower value polygons with larger value polygons in shapefile
I had to do something like this a long time ago, here is the repo and a description.
https://github.com/debboutr/overlapTopoTool
If you identify the column you want to use as the weight on line 84 of ...
3
votes
Deleting small holes in polygons with PostGIS
Based on dr_jts response, I propose the following version of the design and name of the new spatial SQL function:
Create a spatial custom SQL function:
CREATE OR REPLACE FUNCTION ...
7
votes
Deleting small holes in polygons with PostGIS
Just to add a little less convoluted solution in SQL, shifting construction logic to ST_BuildArea - the LATERAL join predicate is an elegant method to expand and iterate over sets of rows returned ...
13
votes
Accepted
Deleting small holes in polygons with PostGIS
This is one of those processes which are simple in an iterative language, but trickier in set-oriented SQL. But the ST_DumpX set-returning functions in PostGIS and the array handling in Postgres make ...
3
votes
Deleting small holes in polygons with PostGIS
Based on your example, just extract the interior ring of your geom, calculate it's area and use it as condition in where clause as:
SELECT gid, ST_Collect(ST_MakePolygon(geom)) As geom
FROM (
...
1
vote
How do you flip/invert/reverse the order of the coordinates of shapely geometries?
The substring operation in Shapely can be used for this.
From the substring docs:
If the start distance is actually past the end distance, then the reversed substring is returned such that the start ...
1
vote
Updating feature geometry from attribute fields in QGIS
Another option is to use the make_point() function together with updated fields "x" and "y".
before change :
window :
after change :
0
votes
Invalid geometry in QGIS vs ArcGIS
It could be that those programs on your machine are set with different defaults for rounding decimals. If one rounds to the 7th decimal and one to the 8th decimal then you may have occasions where ...
0
votes
What are Definition, Algorithms and Practical Solutions for Concave Hull?
JTS now has a Concave Hull implementation. This is based on erosion of the Delaunay triangulation of the input points. It supports creating holes, and provides both absolute and scale-free length ...
5
votes
Finding change between two sets of polygon data in QGIS
Run Menu Processing > Toolbox > Geometry by expression with this expression with Input Layer the polygon layer representing the boundaries in 2020. In the expression at the end of line 2, ...
2
votes
"Has no attribute geometry" error when creating polygon with Shapely
I have seen your previous question, where I would like to extend @KadirŞahbaz's answer:
from shapely.geometry import Polygon
...
for steps in range(numVertices):
pt = geom.vertexAt(steps)
...
1
vote
Filter by bounding box in GeoPandas
A quick solution to this if the shape you want to clip by is a box:
from shapely.geometry import box
bbox = box(*df_sussex.total_bounds)
df_clipped = gpd.mask(df, mask=bbox)
It uses the shapely....
0
votes
MMQGIS export shapefile to KML not working, error message: 'Unknown geometry type 0'. But Point data being used?
Before you will use the KML export by the MMQGIS plugin you should reproject your layer. The quickest way to do it is using the "Reproject layer" option in your processing toolbox.
As the ...
2
votes
Accepted
Retrieve polygon smallest MBR
Some 11 years late to the party, but I think this does what you want (well, from v2.5.0 which was probably after you asked!)
https://postgis.net/docs/ST_OrientedEnvelope.html
Top 50 recent answers are included
Related Tags
geometry × 1640qgis × 354
postgis × 255
python × 166
polygon × 165
arcpy × 159
arcgis-desktop × 115
postgresql × 105
shapefile × 87
coordinate-system × 69
sql × 68
pyqgis × 66
sql-server × 66
intersection × 50
arcmap × 44
point × 43
qgis-3 × 42
line × 42
shapely × 42
ogr × 37
arcobjects × 36
vector × 35
geojson × 34
cursor × 34
algorithm × 34