Questions tagged [geometry-conversion]
A change from a geometry type to another, e.g., points to lines, lines to polygons, polygons to points, and the like.
166
questions
5
votes
3
answers
200
views
Converting multipart MultiPolygon to self-intersecting polygon in PostGIS
Is it possible to convert a MultiPolygon to a polygon when the result is a self-intersecting polygon?
I have a bunch of MultiPolygons that are essentially originally formed to be multipolygons because ...
2
votes
1
answer
237
views
Conversion coordinates to decimal degrees in Python
I have a pandas DataFrame with coordinates (Longitude and Latitude) in the following format: (005304000W, 384035000N). I need to convert those coordinates to what I believe are decimal degrees (e.g. -...
-1
votes
1
answer
197
views
Geometry by expression does not work after intersection [closed]
I would like to split a linelayer with points in QGIS. For that, i found this answer: Splitting line with point layer in QGIS
I have one point layer: QBW_Strukturgütekartierung
and one line layer: ...
4
votes
1
answer
163
views
TypeError when converting QgsMultiLineString to QgsGeometry using PyQGIS
I have previously written some PyQGIS code to replace the features in a LineString layer with new features. The outline of the code is below - I have left out the specific code to create data for the ...
1
vote
1
answer
124
views
Remove internal boundaries from a polygon in QGIS
I'm currently trying to retrieve XY coordinates from the perimeter of a polygon (using MMQGIS). When I have a single continuous polygon I face no issues. However, when the polygon is a mix of land ...
4
votes
1
answer
203
views
Creating horizontal lines connecting points using QGIS Geometry generator
I am using the geometry generator to learn how to generate vectors using expressions. Currently, I have a point vector, and I would like to create horizontal lines (shown in red: manually drawn) ...
7
votes
3
answers
718
views
Creating bar chart from point layer using QGIS Geometry Generator
From a layer with point geometry, I store the following fields:
"CATEG" which can be A or B
"ORDER" which is an autonumeric field sequence without repetitions
"VALUE" ...
4
votes
1
answer
281
views
PostGIS: Convert geometry type from MultiLineString back to LineString
I am working with a PostGIS database where I want to alter the geometry type from MultiLineString to LineString. My table used to be a LineString, so I know that all lines are simple, single line ...
0
votes
1
answer
90
views
Accurate Georeferencing of ETRS89-Projected Image and Conversion
I'm seeking assistance with georeferencing the attached image. The image indicates that it is projected in ETRS89, and I have obtained Northing and Easting coordinates by tracing the cross symbols on ...
2
votes
3
answers
234
views
Making the coordinate trace looks more smooth without road network
We have a lot of coordinates generated by GPS and UWB devices for different users in our system. For a given user for a certain time range, when we tried to display their history trace(the yellow ...
3
votes
1
answer
73
views
PostGIS ST_Relate reports polygons intersect but Google Maps says otherwise
I'm creating a Geography database that does not allow polygons to overlap/intersect (having positive common area that is). The user interaction flow is:
User creates and exports a KML document from ...
6
votes
1
answer
216
views
Creating straight line that starts from the point with the given length and also rotates around the point in QGIS
I want to create a straight line that starts from the point with the given length. And also it rotates around the point.
I have a point data of cctvs:
And I want to create a line with the given ...
1
vote
1
answer
372
views
Calculate geometry in decimal degrees from a point feature class using ArcPy
I have a point shapefile where I want to add two new fields "Lat" and "Long" and calculate the X and Y coordinates in decimal degrees for each field in the coordinate system: WGS ...
2
votes
0
answers
340
views
Calculating ECEF position of gps satellite?
I am calculating the ECEF positions of satellites but the results are not what I expected.I'll show my code below but I'm following the gps specification(converting to radians from semicircles and the ...
4
votes
1
answer
85
views
Representing points as polygons from Feflow data in QGIS
I have several Feflow files that are displayed as points in QGIS. I would like to display points that have the same value scale as a polygon (F Value in the attribute table). Is this possible?
Is ...
3
votes
1
answer
553
views
Getting the polygons contained in closed MultiLinestring using Python
Given a set of "streets", how can I get the "blocks" contained in those streets?
For example, I'd like to extract four blocks / polygons from this 2 x 2 "checkerboard":
...
1
vote
0
answers
145
views
Using geometry instead of geography
I have a basic query to run with PostGIS: research all LINESTRINGs close to my centre within a radius. "Linestring" is the only geometry used and represented by two points with longitude and ...
3
votes
1
answer
186
views
Setting/changing geometry type for .TAB file in QGIS
I have a .TAB-file with MultiLines. When I load it to QGIS, in layer properties it says Geometry: Line (LineString) which is wrong. When I try to do some operations with geometries (like snap to layer)...
4
votes
1
answer
250
views
Geting midpoint of MultiLine in QGIS
I have a line(multiline) layer in QGIS 3.22. I need to place a point in the middle.
I've tried using the algorithms: "interpolate point on line" and "points along geometry", by ...
2
votes
1
answer
51
views
Converting polygon with attributed into centered lines using QGIS
I had some data points I wanted to aggregate with different road segments. So I buffered the road in order to process "Join Attributes by Location (Summary)". With the buffered road segments,...
1
vote
1
answer
97
views
Reproject valid features returns geomety error with PostGIS
PostGIS3.2, PostgreSQL 13
I have a table with multipolygons.
There is a constraint CHECK (st_isvalid(geom)) on it.
Run a query with st_ivalid(geom) returns no error fortunately !
When I try to ...
0
votes
0
answers
84
views
Cache feature lengths are in Web Mercator, what is the conversion factor to miles?
I have a cache polyline feature with a Shape_Length field calculated in Web Mercator. I need to convert that feature length to feet or miles. I am using the Value Conversion tool in Dashboards !!...
2
votes
0
answers
243
views
Languages to represent ellipse geometry (WKB/WKT)
I am new to the idea of representing vector geometries in a text markup language. I am looking into different representations for geometries consisting of smooth curves and three dimensional objects, ...
3
votes
1
answer
1k
views
"One or more line ignored due to geometry not having a minimum of three vertices" error when "Line to Polygon" in QGIS
Converting "Line to Polygons" using geometry tools in Vector could not be executed results shows this picture
How to solve this issues?
5
votes
1
answer
376
views
Creating new layer with all attributes inherited from original layer using PyQGIS
Let's assume there is a polygon layer called 'test2' with its attribute table, see the image below.
With the code below I am creating a new layer as centroids of original features
layer = iface....
4
votes
1
answer
727
views
Incorrect ST_Area after changing to 4326 in PostGIS
I'm trying to change the geometry in our database from 3857 to 4326 so that I can use more functionality within PostGIS. It converts them all properly when I run the alter column and transform query:
...
1
vote
1
answer
383
views
Combining Polygons from matching features into a single MultiPolygon feature with QGIS
I have a GeoJSON file from an upstream provider that uses multiple feature "rows" to represent disjoint boundaries of what I need to treat as a single feature.
For example in the dataset ...
1
vote
1
answer
607
views
Transforming cluster of points to polygon using Python
Having a GeoPandas GeoDataFrame with multiple points grouped into n clusters, I am looking for a way to transform a group of points into n or more clusters. Below is the sample image of points grouped ...
1
vote
1
answer
1k
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
479
views
How to convert convexhull polygon from geodataframe to shapefile
I have a point geodatafram with a classcolumn. I wanted to make a convexhull for each class and then write it as a shapefile. but I got error to convert it to shapefile.
print(gdf.head())
Convexhull =...
3
votes
3
answers
2k
views
Converting line to set of H3 hexagons?
What is a proper way to convert a GeoJSON linestring to a set of H3 hexagons?
I came up with an algorithm where I
extract points from a line,
calculate an H3 hexagon of these points geo_to_h3
connect ...
1
vote
1
answer
121
views
Inaccurate results when converting coordinates from shapefile(dynamic projection system file) to EPSG:3857 using geotools
I have created a functionality where I get the geometry data from the shapefile and display it on the map and table structure.
Here there is no restriction like that only some specific files can ...
3
votes
1
answer
363
views
Selecting single line after polygon is split into line segments
In QGIS 3.20 on Windows 10 Pro 64-bit I have used the menu sequence Vector/Geometry Tools/Polygons to lines to create a new line layer from a polygon layer which contains several polygons.
However I ...
2
votes
1
answer
126
views
Modifying parameters in Subdivide Polygon to obtain value from attribute table
I want to split polygons in half, like if a building were split by its roof ridge. I've somehow managed to obtain this in model builder by doing calculations on geometry statistics but as the input ...
0
votes
0
answers
32
views
Save shapefiles from command line altering geometry type and disabling z-dimension?
I would like to use QGIS from Linux terminal to read a shapefile and save it as, with specific Geometry type instead of automatic and making sure z-dimension is not included.
How can I do that?
8
votes
2
answers
693
views
Changing polygon circles to hexagons using QGIS
I received an answer to Changing Points into Hexagon-Polygons using QGIS, which enabled me to change the point to polygons using the "Rectangles, Ovals, Diamonds" tool, which I used circles.
...
6
votes
1
answer
567
views
Changing points into hexagon polygons using QGIS
In QGIS 3.18, I need to convert vector points into polygons for a client and there was a plugin that did this in QGIS 2 but I can't find anywhere in the questions that shows me how to do it.
The ...
1
vote
0
answers
137
views
Spheroid distance to sphere distance
I have
linestring that is calculated on a spheroid.
Shpere distance of where the point should be on the linestring
Distance spheroid / sphare.
On one lib, its all calculated in spheroid (Normal map)....
0
votes
1
answer
404
views
How to flatten a PolygonZ onto the XY-plane using pygis
I want to flatten/project a PolygonZ onto the XY-plane. Although I wished for a method to flatten the whole object with the option of letting me decide what direction of the the line needs to be ...
4
votes
2
answers
3k
views
GeoJSON to CSV with geometry using QGIS
I downloaded a GeoJSON file from vangdata.carto.com and I'm trying to convert it to CSV that has geometry data in tact. I'm trying to achieve the same result as a CSV file when exported from public....
2
votes
1
answer
3k
views
Convert x, y, z local points to WGS84 having only 3 coordinates known
I have a set of (x, y, z) points on a local coordinates system cartesian plan.
For only 3 of these N points, I have the corresponding WGS84 coordinates (latitude, longitude and altitude).
How can I ...
3
votes
2
answers
623
views
Merging lines changes geometry
I'm sorry for the newbie question, but I'm picking up QGIS after a few months' absence, and I feel like everything is confusing again. I have imported some kml tracks, and put them into a GeoPackage ...
2
votes
0
answers
140
views
Draw lines between points from two layers in QGIS [duplicate]
In QGIS 3.10.4 on Mac, I have two multipoint shapefiles: one is "Start" points, and the other is "To" points. Each layer has "x" and "y" coordinate columns in ...
1
vote
1
answer
737
views
QGIS forces multi-geometry?
I noticed that with at least QGIS 3.14 (maybe earlier too) all objects are exported to shapefile as multi-geometry ie. points are exported as multipoints, lines as multiLines, etc, even if objects are ...
3
votes
2
answers
556
views
Forming continuous network out of discontinuous lines in ArcMap
I have river data, which consists of lines (narrow sections of streams) and polygons (wider sections of streams). I would like to have all data in line form.
First, I tried Collapse Dual Lines to ...
8
votes
6
answers
3k
views
Creating all possible line segments between all points using QGIS
I want to connect all points in a point feature with every possible line segment using QGIS.
For example, how a pentagon has five points with ten line segments connecting them all to form a pentagram ...
1
vote
0
answers
468
views
How to convert XYZ to from-to format with azimuth and dip information? [closed]
I have an Excel spreadsheet with header, survey, and assay drill data.
Header data contains hole ID, location coordinates, and length.
Survey data contains related downhole survey with distance, ...
1
vote
1
answer
385
views
PostGIS & QGIS 3.4 : convert mixed Linestring/Multilinestring geometry to multilinestring
I have a PostGIS table in which the geometries are mixed Linestring and Multilinestring. But QGIS doesn't like it very much (it splits the table by the different geometries in the "add PostGIS table" ...
4
votes
1
answer
360
views
Using `CAST` and `ST_UNION` in same query in PostgreSQL
I want to union the geometry of waterlines grouped by a table column in a new view.
My problem is that I apparently needes to specify the geometry type using CAST function. But I cannot figure how to ...
1
vote
0
answers
136
views
Implicit geometry typecast via trigger
Because OGC SFS is relatively strict when it comes to mixing Geometries with their MULTI- Counterparts, we came up with a solution to store everything as MULTI... and convert incoming geometries via ...