# 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.

331 questions
Filter by
Sorted by
Tagged with
46k views

### Fixing geometry validity errors in QGIS 2

I am working on ownership data at a US county level. I have one shapefile per county that contains thousands of tax parcels. I need to dissolve the polygons representing parcels owned by the same ...
• 983
78k 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)...
• 6,848
69k views

### Removing small spaces (slivers) between polygons

I have a set of polygons representing administrative districts. The districts were digitized by hand, and there are small spaces (slivers) between polygons where the polygons should be touching. How ...
• 711
57k views

### Calculating polygon areas and perimeters using QGIS

Using QGIS, if I load a polygon layer and make a new column, how do I fill that column with the area of each polygon and another column with the length of the perimeter of each polygon?
• 995
51k views

### Filling holes in polygons using QGIS

Is there an option in QGIS to fill holes in polygons automatically by setting parameters e.g. maximum area, distance between borderlines? I want to delete/fill holes that a very "thin"/small....
• 259
95k views

### Smoothing/generalizing polygon in QGIS

Is it possible to smooth or generalize a polygon in QGIS, perhaps by using a plugin like the Generalizer Plugin for lines? I could convert my polygons to lines, smooth them and convert them back to ...
• 8,338
62k views

### Visualising WKT geometry string in QGIS

Is there a simple tool in QGIS to graphically visualise geometry formatted as text? Example geometry: POLYGON((571178 6337246,571178 6402217,598061 6402217,598061 6337246,571178 6337246)) Result: A ...
• 4,490
110k views

### Determining the centroid of polygons in QGIS

I have a polygon vector and I want to quickly attain the centroid of this polygon for insertion in a text document. I am working with QGIS. I searched through other questions and although some are ...
• 771
127k views

### Finding minimum-area-rectangle for given points?

As you see in the figure, the question is: How to find the minimum-area-rectangle (MAR) fitted on the given points? and a supporting question is: Is there any analytical solution for the ...
• 3,407
10k views

### How is ST_PointOnSurface calculated?

The PostGIS documentation states that ST_PointOnSurface returns "a POINT guaranteed to lie on the surface". It seems like this function could be trivially implemented to give results that satisfy the ...
• 443
9k views

### Transforming single QgsGeometry object from one CRS to another using PyQGIS

I have a polyline layer with roads in WGS84 that covers several UTM zones. For every road I need to place a set of points at different distances (in metres). To do so I want to reproject each road to ...
• 5,621
1k views

### ArcGis label last vertex Z value

Is it possible to label a feature in ArcMap using geometry values? In this instance I want to label features (polylines) with the Live Z value of the last vertex obtained from the Shape. However ...
• 25.6k
376 views

### Line width and labels based on blended values of features sharing same geometry in QGIS

I want to appropriate line segments that share the same geometry with a particular line width and labels based on the aggregated values of one field "GIS@BUS_5_Min". My attribute table and ...
• 33.3k
82k views

### Converting shapefile to CSV including attributes and geometry

I have a shapefile with 60k+ entries, all of which are polygons with corresponding attributes (acreage totals, landowner names, tax ID #s, etc.). What I ultimately need is a CSV file with all of ...
• 231
17k views

### How to draw polygons from the python console?

I've been visiting and revisiting the page on geometry handling in the PyQGIS Cookbook: http://documentation.qgis.org/2.0/en/docs/pyqgis_developer_cookbook/geometry.html but can't seem to figure out ...
• 2,115
5k 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(...
54k 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": "...
• 333
8k views

### In PostGIS: how to split linestrings into their individual segments?

I have one table with many linestrings and I want to make a new table containing the individual segments of all the linestrings, no matter if they are grouped line per line or not. This is my table, ...
27k views

### Repairing geometry using QGIS? [duplicate]

I have shapefile with few polygons. Some of them are self-intersecting. In ArcMap I can use "Repair geometry" tool, and it works well. But problem is, that for that task some users need to use open ...
• 329
18k views

### Creating square buffers around points using shapely? [duplicate]

I am trying to create square buffers around given points, I am able to create circular buffers but how do I create square ones? from shapely.ops import transform from shapely.geometry import Point ...
• 391
17k views

### Moving / offsetting point locations using ArcPy or ModelBuilder?

I have a number non-georeferenced CAD layers (see this question) that have text annotation features. I have created a model to convert the text to points, but after converting the annotation to a ...
• 23.1k
7k views

### Multilateration Code

I am currently writing some code to do multilateration using TDOA and currently struggling and wondering if anyone has any reference code that can be used as a test case with some sample data that I ...
4k views

### Identifying features with duplicate geometry in QGIS

I am working on a public transport network in one shapefile (polyline type) in QGIS 2.18. Certain bus routes share the same paths, means that one line-part can repeat more than once. It always has the ...
• 33.3k
46k views

### Finding center of geometry of object?

Given a set of 2D or 3D points: How to find the center of geometry of an object? According to the following figure, the center of geometry differs from the center of mass if it is calculated in the ...
• 3,407
21k views

### Seeking Generalisation Strategies for Building Outlines in PostGIS?

I have a dataset of building footprints vectorised from a raster dataset. The dataset is currently just a vector representation of the raster data. I would like a polygon dataset that only has ...
• 6,127
10k views

### Finding tunnel center line?

I have some map files consisting of 'polylines' (each line is just a list of vertices) representing tunnels, and I want to try and find the tunnel 'center line' (shown, roughly, in red below). I've ...
• 291
12k views

### Deleting duplicate geometry in PostGIS tables

After - I don't know what happened - all my entries in my PostGIS tables are doubled. I tried this to delete them but it does not delete any/all duplicates: DELETE FROM planet_osm_point WHERE ...
• 8,338
54k views

### Removing duplicate features with same geometry in ArcMap?

Is it possible to uniquely identify each geometry in a feature layer? Essentially I have a polygon feature layer with many rows of data represented by the same geometry. I would like 1 row for each ...
14k views

### Inverting Polygons using QGIS?

I have a Shapefile with Polygon features representing the world's land areas (continents, islands). Is it possible to invert these, and get a geometry that represents the world's oceans and seas? ...
• 802
4k views

### What are the implications of invalid geometries

I've imported some data in a Postgis database and some of the geometries are reported invalid (ST_IsValidReason reports self-intersection or ring self-intersection). The queries I am performing don't ...
• 2,348
22k views

### Creating lines from points pair coordinates with ArcPy?

I've got some points pair coordinates (start and end points) which I have to transform into lines. Until now, I used an append of both the coordinates in a pippo.Point(), a pippo.CalculateGeometry() ...
3k views

### How to edit geometry of multiple layers simultaneously in QGIS 3?

I have several line layers (route, pipes, cables) that share the same geometry and would like to edit them simultaneously. Is there a way to easily snap the geometry of the pipes and cables layers ...
• 139
1k views

### Converting point XY to page units XY using ArcPy

I am using ArcPy to export PDFs from my ArcGIS Server application. I want to move a TextElement in my layout view to the centroid of a selected feature. I can get the centroid of the feature, but that'...
• 281
933 views

### Select the most distant vertex from polygon's centroid using ArcPy [closed]

I have a polygon and the polygon's centroid. I want to select the most distant vertex from centroid (picture: point A). I used arcpy.FeatureVerticesToPoints_management to create a feature class ...
• 61
8k views

### Comparing two geometries in ArcPy?

I am trying to compare two separate feature classes to identify differences between them (sort of a diff function). My basic workflow: I extract the geometries using a SearchCursor Save the ...
14k views

### Converting between Esri Geometry and WKT using ArcObjects?

It seems like there is no means of converting an ArcObjects geometry to the Well-Known Text representation (and vice versa) in ArcGIS ArcObjects API. The only thing I was able to find is conversion to ...
• 10.3k
30k views

### Identify polygon containing point with R sf package

I would like to be able to map geocoded coordinates to a region on a .shp file in R using the sf package. I can load up the map and plot it but I am struggling with the code to return the region for ...
• 151
8k views

### Writing vector layer to CSV file with geometry using PyQGIS?

I use Python try to write vector layer file to csv file with this code: QgsVectorFileWriter.writeAsVectorFormat(mylayer, r'c:\temp\xyz.csv', "utf-8", None, "CSV") It can export to xyz.csv but only ...
• 121
6k views

### Find maximum radius of circle that will fit within an irregular polygon?

I have a problem which I think could be handled by using the Zonal Geometry tool in the ArcGIS Spatial Analyst toolbox. However I do not have a license for Spatial Analyst, so I am searching for an ...
• 111
6k views

### Defining spatial operators (Equals, Disjoint, Touches, Within, Overlaps, Crosses, Intersects, Contains, Relate)?

Ok, I have to admit, I don't really delve too deep into the semantics of the spatial operators list below, I'm more of a user, I write software to drive the SQL most of the time and don't really think ...
• 1,731
642 views

### Creating direction raster in QGIS

I need to create a raster with values showing directions relative to a single point. Each cell will have the azimuth to the origin point. Basic trigonometry could calculate this using the differences ...
• 51
1k views

### How to handle coordinates accuracy in ArcGIS

I am creating very basic rectangular polygon using very basic a Python code nCols,nRows=100,100 corners =[[0,0],[0,nRows],[nCols,nRows],[nCols,0],[0,0]] p=arcpy.Polygon(arcpy.Array([arcpy.Point(*...
• 23.2k
1 vote
335 views

### Updating Z values with geometry of multipart and donut polygons with ArcPy?

I am trying to update Z values of polygon features with point features. The code is (found on GIS Stack Exchange) working good if no 'interor ring' or 'multipart' features are present in the polygon ...
• 111
2k views

### Adding Area column in Polygon layer using PyQGIS? [closed]

I have a WardBoundary.shp file with Polygon Features in it. I have to calculate the area of each Polygon and write into attribute Table. I can do manually by using '\$area` but I need to automate ...
• 607
57k views

### Copy a geometry from one feature to another without attributes?

With QGIS it's easy to add a new part to an existing feature/geometry but I can't see how to copy/paste this part from another existing feature/geometry. Is it possible?
• 515
9k views

### How to calculate the angle at which two lines intersect in PostGIS?

I want to calculate the angle between two lines where they intersect in PostGIS. The starting point for angle calculations in PostGIS seems to be ST_Azimuth - but that takes points as input. My first ...
• 1,680
20k views

### Multipoint vs point PostGIS

Is it normal to use the geometry type 'multipoint' instead of 'point' knowing that I use it to store only one point? How can I convert from multipoint to point?
• 375
14k views

### Python, shapely library: is it possible to do an affine operation on shape polygon?

I am trying to create a rotated rectangle in lat/lon coordinates. Basically, I have the coordinates of the center and rotation angle around the center. Is it possible to do using, shapely or gdal, ...
• 253
8k 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 ...
• 155