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.

Filter by
Sorted by
Tagged with
37 votes
7 answers
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 ...
Bap's user avatar
  • 973
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)...
Adam Matan's user avatar
  • 6,790
60 votes
11 answers
68k 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 ...
zoo's user avatar
  • 711
14 votes
2 answers
54k 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?
HealthMaps's user avatar
50 votes
5 answers
90k 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 ...
MartinMap's user avatar
  • 8,254
22 votes
6 answers
48k views

Filling holes in polygons automatically 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....
J-Man's user avatar
  • 229
87 votes
6 answers
58k 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 ...
Chau's user avatar
  • 4,460
44 votes
10 answers
103k 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 ...
David's user avatar
  • 731
96 votes
8 answers
123k 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 ...
Developer's user avatar
  • 3,387
33 votes
2 answers
9k 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 ...
mjobrien's user avatar
  • 433
9 votes
2 answers
8k 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 ...
SS_Rebelious's user avatar
  • 5,601
4 votes
1 answer
349 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 ...
Taras's user avatar
  • 31.4k
4 votes
1 answer
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 ...
Michael Stimson's user avatar
23 votes
6 answers
80k 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 ...
Rikk's user avatar
  • 231
21 votes
2 answers
16k 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 ...
user25976's user avatar
  • 2,105
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": "...
Jay's user avatar
  • 323
14 votes
4 answers
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, ...
Lorenzo Barbagli's user avatar
12 votes
1 answer
26k 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 ...
risk_ltu's user avatar
  • 329
11 votes
6 answers
16k 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 ...
RyanKDalton's user avatar
11 votes
1 answer
17k 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 ...
Atihska's user avatar
  • 381
5 votes
2 answers
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 ...
Lee Armstrong's user avatar
4 votes
4 answers
2k 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 ...
Taras's user avatar
  • 31.4k
43 votes
1 answer
45k 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 ...
Developer's user avatar
  • 3,387
24 votes
3 answers
20k 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 ...
Matthew Snape's user avatar
19 votes
2 answers
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 ...
sje397's user avatar
  • 291
17 votes
3 answers
53k 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 ...
Dylan Hettinger's user avatar
16 votes
3 answers
12k 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? ...
kontextify's user avatar
16 votes
2 answers
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 ...
diciu's user avatar
  • 2,348
12 votes
4 answers
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() ...
Annalisa Minelli's user avatar
8 votes
1 answer
2k 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 ...
Fabian Kratz's user avatar
8 votes
1 answer
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'...
Shawn's user avatar
  • 281
4 votes
2 answers
907 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 ...
Patricia's user avatar
19 votes
5 answers
7k 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 ...
Michalis Avraam's user avatar
17 votes
6 answers
13k 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 ...
Petr Krebs's user avatar
  • 10.3k
17 votes
6 answers
11k 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 ...
MartinMap's user avatar
  • 8,254
15 votes
5 answers
28k 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 ...
jmc's user avatar
  • 151
12 votes
1 answer
7k 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 ...
Anubiz's user avatar
  • 121
11 votes
2 answers
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 ...
shawty's user avatar
  • 1,721
11 votes
3 answers
5k 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 ...
Christian's user avatar
  • 111
4 votes
1 answer
551 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 ...
W.Jay's user avatar
  • 51
2 votes
2 answers
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(*...
FelixIP's user avatar
  • 22.6k
1 vote
1 answer
301 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 ...
Ram's user avatar
  • 111
28 votes
3 answers
52k 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?
nippo's user avatar
  • 475
23 votes
3 answers
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 ...
mvexel's user avatar
  • 1,680
15 votes
5 answers
13k 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, ...
Oleksandr's user avatar
  • 253
15 votes
2 answers
19k 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?
Youssef's user avatar
  • 375
9 votes
2 answers
2k views

Generating true curve elliptical polygons in file geodatabase using ArcPy?

As background, this question arose from trying to answer a question on How to generate overlapping polygons from lines output from Table To Ellipse tool? Using the ArcMap 10.1 GUI it is very easy to ...
PolyGeo's user avatar
  • 65k
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 ...
jeffme's user avatar
  • 155
8 votes
3 answers
3k views

Updating feature geometry from attribute fields in QGIS

I know how to get the geometry (x,y) into Attribute fields with the Calculator, but I can't figure out how to update the geometry from values contained in attributes. I am trying Field Calculator > ...
benny the spaceman's user avatar
7 votes
3 answers
6k views

How to create a circle in arcpy

Suppose I have a dataset where each record has an x,y and r (the centroid and radius of a circle). How can I create a polygon feature class containing parametric circles? Sorry to those who have a ...
Regan Sarwas's user avatar
  • 1,675

1
2 3 4 5
7