Questions tagged [geometry]
(1) abstract geometry; (2) storing geographic data in projected coordinates; (3) a generic ESRI term for vector features; a class for "geometry" objects.
1,815
questions
4
votes
2
answers
237
views
Smoothing corners in polyline using PyQGIS
I have an array of QgsPointXY that makes a line with lots of vertices.
How can I round the corners?
Here is what I mean:
The code is:
def __round(line: list[QgsPoint], radius: float) -> ...
4
votes
2
answers
2k
views
Connecting two nodes with line to close segment in QGIS
I have a line that I drew where the ends are not connected. I now want to select the two end nodes and hit a button to have QGIS connect them with a line segment. How do I do this?
1
vote
0
answers
20
views
Direction of lines in relation to coastline
In ArcMap 10.7, I would wish to calculate an orientation of some linear off shore features in relation to the coast line. I don't really want to create a classic wind/rose diagram in relation to North/...
0
votes
0
answers
29
views
Saving a GeoJSON file with UUID [closed]
I would like to save a .geojson file with a geometry information as well as uuid column.
The .geojson file is saved successfully when it has no uid column but when I add a uid column i get an error (...
1
vote
1
answer
566
views
Creating a Point with SRID - MariaDB
I have a table containing a longitude and latitude (as doubles) in MariaDB. What I'm trying to do is create a point with a specific SRID - 4326. The current way that I create a point is by using the ...
2
votes
1
answer
75
views
Generating offset line from MultiLineString in QGIS
I have a MULTILINESTRING in my CSV file, and I want to generate a copy of it offset to the right by a few meters. I've run Single Sided Buffer, and Offset Lines, and neither of them seem to generate ...
0
votes
1
answer
503
views
Geo search MySQL table for rows that are within proximity
I have an sql table that has some data on retail locations with lat, long coordinates. My application queries the table to pull the data using python. Here's some sample data:
table1
id name lat ...
0
votes
1
answer
325
views
Unable to insert geometry point using TypeScript and MassiveJS
I am trying to simply trying to validate a point before I actually insert it into the db.
I am using the following:
TypeScript: 3.5.2
MassiveJS: 6.4.0
PostgreSQL: 11
PostGIS: 2.5
const ...
4
votes
1
answer
6k
views
"No features were split:" error when using Split Features tool in QGIS
I want to split a fairly large polygon with the Split Features tool from the Advanced Digitizing Toolbar in QGIS. However, I get an error:
No features were split: If there are selected features, the ...
1
vote
1
answer
372
views
Automatically running an ST_AsText query over multiple rows in QGIS
After my SpatiaLite database got corrupted, I used a recovery tool to recover what was lost. I now do have the database, but I can't visualise the features on a map.
I figured out that with SELECT ...
6
votes
2
answers
96
views
Is there a common method for measuring "curviness" of a line?
I have a bunch of GPS tracks in a Postgres+PostGIS database and want to extract a single metric as a measure of turns shown in the data. Some of the GPS targets travel in almost straight lines while ...
1
vote
1
answer
569
views
ST_SnapToGrid doesn't work properly, e.g. 41.94186153740355 -> 41.941861499999995
I'm using ST_SnapToGrid: ST_SnapToGrid(somePoint, 0.0000001) and I get strange result on many points, such as:
- POINT (21.619820510769063 41.94186153740355) -> POINT (21.6198205 41....
141
votes
14
answers
72k
views
What are Definition, Algorithms and Practical Solutions for Concave Hull?
Convex Hull
A convex hull of a shape is defined as:
In mathematics, the convex hull or convex envelope for a set of points X in a real vector space V is the minimal convex set containing X (Wikipedia)...
1
vote
1
answer
1k
views
Finding intersection length between two polygons using PyQGIS?
I have two polygons and I want to find the intersection line length between these polygons.
for geom1, geom2 in itertools.permutations(selection, r=2):
intersection =geom1.geometry().intersection(...
1
vote
0
answers
66
views
How to recognise building type from polygons?
I have a number of building polygons which are extracted from the aerial images, along with their postal address. (The aerial images are not available in my case.) For example, the polygon of a square ...
7
votes
1
answer
196
views
Check Geometries Plugin - attribute value in results
What does the real value of Sliver polygon represent?
it's not the area of the polygon
it's not the perimeter
is not the area of the bounding box
so I ask if anyone can tell me what it represents, I ...
2
votes
0
answers
34
views
QGIS converting MultiPolygon to MultiSurface - can I disable QGIS from doing this?
I have MultiPolygon data stored in a PostgreSQL DB (13.9) and am editing this through QGIS (using 3.28.3-Firenze). Occasionally when editing, some features are saved back as MultiSurface features. ...
0
votes
1
answer
27
views
How to find if a point feature is snapped to a line using ArcObjects
Background to the problem:
When I use the Editor Split tool on a line, the line gets split into 2, and a junction is placed between the two lines. When I use the Editor merge tool, the 2 lines are ...
1
vote
1
answer
2k
views
Adding and filling GEOMETRY column in new spatialite
I have three tables. One has no geometry. The second is POINT type, and shows up correctly on the map. The third is, for the moment, a simple checker table, don't worry about it.
I am able to perform ...
1
vote
1
answer
399
views
Align set of satellite images
I have a problem my set of four satellite images (4 different years of observations) of the same area are not aligned and more than that I see that there is a distortion problem also.
I found this ...
32
votes
1
answer
50k
views
Storing GeoJSON FeatureCollection to PostgreSQL with PostGIS?
I am new to GeoJSON. I have a GeoJSON features collection as shown and would like to store it in postgres table (testtable). My postgres table has a serial id and geometry column.
{
"type": "...
0
votes
1
answer
26
views
Error in gpd.join related to 'PyGEOSSTRTreeIndex'
I have an error related to gpd.sjoin which shows as follows
NameError: name 'PyGEOSSTRTreeIndex' is not defined
Here is the code:
alltitresQuartiers = gpd.sjoin(left_df=transactions_located, right_df=...
0
votes
1
answer
360
views
Forced to work with a Geometry with too many edges in GEE
I want to perform an unsupervised classification on a feature collection that has many small geometries.
I know it will create problems for GEE to work on such many small geometries but I cannot find ...
5
votes
3
answers
519
views
Finding the name of the geometry column for QgsVectorLayers using PyQGIS
I have a QgsVectorLayer whose data source is a vector GeoPackage file. How can I find the name of its geometry column?
It is possible to use ogr to get it, but I am looking for a native PyQGIS ...
0
votes
1
answer
62
views
Calculating distance between two points on line string
I have a line string and two points with me. I need to understand how to calculate the distance between two points along the provided line string. Also, note that in some cases, the provided points ...
2
votes
1
answer
177
views
Data matching between 2 layers which do not overlap
I would like to know how a vector layer can takes attributes of a field, of another vector layer which is not overlapping.
For example, there are 2 vector layers, test_1 (2 records A,B) and test_2 (3 ...
0
votes
1
answer
16
views
City Suburbs Polygon using OSMNX
I am trying to do something similar to the question OSMNX - City Suburbs Polygons. The city of Panama, in the Republic of Panama, is composed of corregimientos (like a borough). I am trying to get the ...
1
vote
1
answer
43
views
How to extract polygon attribute based on point location using QGIS expressions
I'm using QGIS 3.34. I have a point layer that contains a single point showing a site location (called "Site Location"). I have a polygon layer covering the UK with 12km squares containing ...
2
votes
1
answer
69
views
Multiple operations within Field Calculator using the same IF statement
I have 2 layers (Point_Orien_Vert - red points and Point_Centroides - green points), both are Point Geometry.
I need first to check if the distance between one feature in Point_Orien_Vert and one ...
0
votes
0
answers
40
views
QGIS Convert Polygon ZM to Polygon
QGIS Convert Polygon ZM to Polygon
Received files that have Shape > PolygonZM I need to attach to Polygon. QGIS: Geometry >< Polygon (MultiPolygonZ)
I managed to get it to Geometry >>&...
1
vote
2
answers
7k
views
Python library or algorithm to generate arc geometry from three coordinate pairs?
I'm trying to write code to generate fixtures for a django/geodjango project. I need to generate geometry for arcs (line string) given three lat/long pairs; start of arc, end of arc and centre of arc. ...
0
votes
1
answer
1k
views
Intersect points with polygons using SQL Server query from ArcGIS Enterprise Geodatabase
I have 2 databases in ArcGIS Enterprise Geodatabase in SQL Server. One database (DB_A) contains a feature class with points and the other database (DB_B) contains a feature class with polygons. I'd ...
16
votes
2
answers
4k
views
Difference between QgsPoint, QgsPointXY and QgsGeometry.fromPointXY() in PyQGIS
I am using PyQGIS. What is the difference between:
QgsGeometry.fromPointXY(QgsPointXY(x, y))
QgsPointXY(x, y)
QgsPoint(x, y)
When I print these three options, I get:
print(QgsGeometry.fromPointXY(...
6
votes
2
answers
1k
views
Creating geometry less memory layer using PyQGIS
I'm writing a QGIS plugin and I need to create a table with some attributes that, in a second moment, I'll load in a SpatiaLite database.
The table is created as a memory layer, but as I said, it is ...
8
votes
4
answers
4k
views
How to determine if an object is a circle
I have a polygon shapefile that consists of many different shaped features. I would like to identify only those shapes that are circles. Is there a way to do this? Is it a calculation I could do in ...
2
votes
1
answer
240
views
Overlaps function in GeoPandas/GeoSeries is not working
There seems to be wrong with the overlaps function. Suppose I have this GeoDataFrame consisting of LineString geometries only with crs='EPSG:3347:
Then I went ahead to extract only the first row's ...
3
votes
1
answer
332
views
Optimising Large Spatial Queries in SQL
I'm sure similar answers have been given elsewhere but no matter what I have tried I am unable to optimise this query.
Details: TableA has 3.5mill records TableB Had 57000 records but I have ...
0
votes
1
answer
22
views
Apply Edits on ArcGIS not updating geometry
I am using this command on ArcGIS
curl --location 'https://services8.arcgis.com/xxxx/arcgis/rest/services/SM2/FeatureServer/0/applyEdits' \
--header 'X-Esri-Authorization: Bearer ...
6
votes
2
answers
2k
views
Calculating shortest distance between multiple Polygon borders to a common Polygon border?
I have 2 sets of Polygons and I need to calculate the shortest distance between the polygons on one layer to the single polygon (one feature) on the other layer! How can I do that? Any help on how to ...
1
vote
1
answer
847
views
T-SQL convert a string to geometry data type
I want to convert a string to geometry data type using the following statement:
ALTER TABLE tablename ALTER COLUMN geometrie TYPE geometry(Point) USING st_astext(geometrie);
I get error:
Msg 102, ...
1
vote
1
answer
227
views
ST_Intersects AND ST_Touches combination is much slower with large geometry input
I am trying to geom columns from multiple table and later combining with a table which only has linestrings, I am finding lines which are not intersecting OR just touching the union of geom columns. ...
4
votes
1
answer
137
views
Removing duplicates geometry rows in PostGIS
I am maintaining a table which has geometry datatype and it's possible that the table can contain duplicate geometries.
If I want to remove duplicate rows or select only non-duplicate one, will both ...
2
votes
1
answer
266
views
Dissolving overlapping multipolygon geometries into new multipolygons and keeping non-overlapping features intact
I want to merge (multi)polygon geometries any time they overlap partly or fully. For example the Dissolve function in QGIS does not fit my case, since I also want to:
Include all parts of the ...
1
vote
0
answers
35
views
How QGIS's "Remove duplicate nodes" actually works
I am working on digitizing a large number of polygons using stream digitizing, which sometimes creates duplicate nodes. I noticed that in "Layer Properties>Digitizing>Automatic Fixes" ...
1
vote
2
answers
940
views
Delete vertices on polygon feature class, based on the intersection with point shp with python
I need to delete some vertices from some polygon fc that are unnecessary for the geometry. I have a point shapefile that contains all unnecessary vertices as points - but how can I access the vertices ...
2
votes
1
answer
757
views
Converting native point datatype into Geometry(Point,4326) using PostGIS
I have a table with "coordinate" column in it of data_type POINT (native postrgresql point). I want to convert it into Geometry(Point,4326)
I am using psycopg2 to connect to my database.
I ...
0
votes
2
answers
1k
views
Converting the shapefile of google drive to geometry of GEE in Colab
I uploaded district's shapefile into google drive, and then read it from google drive using the below method:
import geopandas as gpd
shapefile = gpd.read_file("shapefile.shp")
But I want ...
3
votes
1
answer
2k
views
geometryType property of Vector Layers in OpenLayers
ORIGINAL:
I have a couple questions that are focused around the geometryType property with vector layers. When you create a vector layer you can set the geometryType property to limit the geometry ...
12
votes
4
answers
34k
views
QGIS: "Invalid geometry" even after using validity checker and v.clean
I'm trying to intersect two layers in QGIS, similar to this unanswered question. I've performed Vector > Geometry Tools > Check Geometry Validity and I've run GRASS's v.clean, per these questions.
I'...
9
votes
4
answers
7k
views
Removing green Xs and red lines in QGIS
I'm using QGIS 2.18.15 and have somehow ended up with the following on my screen. I've deselected every layer and these green X's and red lines persist. I cannot "undo" to remove them.
What ...