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
135 votes
14 answers
63k 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)...
user avatar
  • 6,564
91 votes
7 answers
110k 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 ...
user avatar
  • 3,307
87 votes
4 answers
167k views

Getting coordinates from geometry in PostGIS?

This line: SELECT geom FROM myLayer.geom will return a hex value. How would I get decimal values, which is a human-readable coordination?
user avatar
  • 1,169
83 votes
5 answers
51k 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 ...
user avatar
  • 4,312
47 votes
5 answers
77k 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 ...
user avatar
  • 7,695
43 votes
1 answer
42k 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 ...
user avatar
  • 3,307
35 votes
7 answers
45k 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 ...
user avatar
  • 915
31 votes
1 answer
7k 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 ...
user avatar
  • 413
29 votes
4 answers
95k views

Create a geography/geometry column from x and y fields - SQL Server 2008

I'm new in SQL Server 2008 and I hope you will understand my question/need. Thus, I have a table which contains 3 fields (Name, Lat and Long) in my data base (spatial). I want to create a geometry/...
user avatar
  • 321
29 votes
1 answer
40k 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": "...
user avatar
  • 293
28 votes
3 answers
49k views

Converting GeoJSON to Python objects? [closed]

New to the site, and to geoJSON, and to python. My goal is to read in a file with geoJSON data, and use it to generate shapes to be used in an application that is using python scripting. Python ...
user avatar
28 votes
4 answers
24k views

How to find the maximum-area-rectangle inside a convex polygon?

In this post we are looking for algorithms / ideas on how to find the maximum-area-rectangle inside a convex polygon. In the following figure, numbers are the areas of the fitted rectangles. As shown ...
user avatar
  • 3,307
25 votes
4 answers
27k views

Filter by bounding box in GeoPandas

I have a GeoPandas DataFrame in EPSG:4326 and I'd make a new DataFrame consisting of all the rows that fall within a certain bounding box. First I get the bounding box that I care about (which is ...
user avatar
  • 2,973
24 votes
3 answers
41k 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?
user avatar
  • 425
24 votes
6 answers
73k 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 ...
user avatar
  • 241
24 votes
3 answers
10k views

How to store lines and polygons in JSON documents?

Looking at the increasing NoSQL movement and considering that databases like MongoDB offers a new perspective in flexible data storage for GIS. What is the best way to store lines and polygons in ...
user avatar
  • 9,753
24 votes
3 answers
18k 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 ...
user avatar
24 votes
2 answers
11k views

How can I find a point inside a polygon in PostGIS?

How can I find a point that is guaranteed to be within a given polygon in PostGIS? I am aware of the ST_Centroid function. However, the centroid is not always within a polygon, see below: ...
user avatar
  • 9,311
23 votes
1 answer
1k views

Space filling between random 2D lines

Consider a region (2D) filled with lines randomly (following Figure). We are interested in filling the empty spaces between lines including four boundary edges in a way: 0- maximizing the size of ...
user avatar
  • 3,307
20 votes
3 answers
8k 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 ...
user avatar
  • 1,624
19 votes
2 answers
15k 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 ...
user avatar
  • 2,035
19 votes
1 answer
14k views

Postgis - Converting 'geometry_dump' data type to a 'geometry' type

I am working with a dataset of property boundaries that has had ST_Union() run on it, thus all the polygons appear as a multi polygon in one row of a table. I would like to separate these out so I get ...
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 ...
user avatar
19 votes
3 answers
4k views

What is the precision of SELECT DISTINCT on PostGIS geometry column?

I wonder what the precision of the SELECT DISTINCT operator is on a PostGIS geometry. On my system, the following query gives me a count of 5, which means that the inserted points are considered equal ...
user avatar
  • 2,923
19 votes
2 answers
9k 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 ...
user avatar
  • 291
17 votes
3 answers
51k views

How I get SRID from Geometry field

What is the function for getting SRID from Geometry field. I have inserted a shapefile into SQL Server table with a Geometry field defined. I know the projection of shapefile is Swreff99_1800 (EPSG:...
user avatar
  • 1,417
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 ...
user avatar
  • 10.2k
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 ...
user avatar
  • 2,298
16 votes
5 answers
9k 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 ...
user avatar
  • 7,695
16 votes
3 answers
50k 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 ...
user avatar
16 votes
2 answers
11k views

Correcting gaps and overlapping polygon (parcels) geometry

I have come across a resource that we rely upon almost daily that is in terrible need of repair. It is not our own product and the supplier is generally not interested in fixing the problem. We are ...
user avatar
16 votes
3 answers
13k views

Exporting only certain columns to CSV file in ArcGIS for Desktop?

I've written a python script using arcpy which outputs a polygon feature class into a File Geodatabase. I have added a function to export the attributes to a separate CSV file. I am using the code ...
user avatar
  • 21.3k
15 votes
5 answers
651 views

Terminology: Polygon or Area?

When writing about GIS geometry I'm unsure whether to use the term "polygon" or "area". In particular, does the word "polygon" suggest a specific type of geometry? For example, a colleague suggested ...
user avatar
  • 12.4k
15 votes
3 answers
10k 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? ...
user avatar
15 votes
5 answers
3k views

How to snap a road network to a hexagonal grid in QGIS?

I'm trying to use QGIS 2.14 to snap a road network to a hexagonal grid, but I'm getting strange artifacts. I've created a hex grid with MMQGIS, cells are approx 20 x 23 m. I've buffered the road ...
user avatar
  • 19.8k
15 votes
3 answers
21k views

How to convert from SQL Server geometry BLOB to something else?

I have a CSV data file from a 3rd party that is an exported SQL Server table. They simply did a select * from foo and output the result to a text file and sent it over. In their table is column of ...
user avatar
  • 151
14 votes
2 answers
16k 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?
user avatar
  • 355
14 votes
2 answers
4k views

Centroid coordinates for odd-shaped polygons

I have a problem in computing the centroids of certain polygons in QGIS (via the geometry tools): for certain polygons - with a strange and rather long shape - the centroids computed are off the ...
user avatar
  • 163
14 votes
2 answers
815 views

Detecting branched polygon shape?

I have a vector layer with millions of polygons making continuous coverage. I need to classify them according to their shape. I am already using several shape indexes from landscape ecology like ...
user avatar
  • 2,453
14 votes
3 answers
8k views

Calculating a spherical polygon centroid

I'd like a general way to calculate centroids for polygons on a sphere. So far, the best online reference appears to be: Tools for Graphics and Shapes by Jeff Jenness. The method described there ...
user avatar
14 votes
1 answer
14k views

Python: find a method to calculate the “inner centroid” (also known as labelPoint in arcmap) of a polygon

i am looking for a method to compute the X,Y coordinate of a inner point (also known as labelPoint in arcmap) of a (irregular) polygon. I am try to find a solution without the use of ArcGIS module ...
user avatar
  • 409
13 votes
5 answers
625 views

What in-depth spatial database systems tutorials exist? [closed]

Is there a good tutorial that explains in depth the internals of a GIS and a spatial database system such as PostGIS with examples and without any background assumption? I'm specifically looking for ...
user avatar
13 votes
5 answers
9k 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, ...
user avatar
  • 233
13 votes
1 answer
13k views

Calculate distance from a Point within a Polygon to its edge

Let's say we have the following point and polygon: poly = Polygon([(0, 0), (2,8), (14, 10), (6,1)]) point = Point(4,4) Because point lies within poly, the distance from the first to the latter will ...
user avatar
  • 545
13 votes
2 answers
5k views

How to fix "Hole lies outside shell"

I got a dataset with polygon shapes, in which the geometry was updated by the QGIS plugin "Geometry Updater". Now I have the problem that in PostGIS I get invalid geometries with the error message "...
user avatar
  • 1,160
13 votes
5 answers
1k views

Simulating the expansion of polygon features

I've got what I'm hoping will be an interesting question. I'm working on an assignment for an intro to GIS course that uses some Gulf oil spill data to introduce common vector-based spatial analysis ...
user avatar
  • 453
13 votes
1 answer
12k views

Difference between bounding box, envelope, extent, bounds?

Every time when I create a script to manipulate vector (point, line and polygon) in python I meet this doubt. What is the difference between bounding box (bbox), envelope, extent, bounds?
user avatar
13 votes
3 answers
14k views

Self intersections for polygons, how to solve?

I have a question about repairing a self intersecting polygon shapefile. I have a shapefile containing Polygons (ZM) which have self intersecting features. If I use the "repair geometry" tool, it ...
user avatar
  • 129
12 votes
4 answers
14k views

Reading geopackage geometries in Python

Let me state up front that I'm totally new to the field of GIS. I'm doing a project involving a database of buildings and their geometries in my home country (the Netherlands). At the moment, I'm ...
user avatar
12 votes
2 answers
2k views

Difference between geometry and $geometry QGIS

This may be trivial question, but I'm confused, what is the difference between geometry and $geometry in QGIS? I didn't find any examples of using this function. Particularly I'm interested in ...
user avatar
  • 1,015

1
2 3 4 5
34