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
116
votes
13answers
47k views

What are Definition, Algorithms and Practical Solutions for Concave Hull? [closed]

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 (...
71
votes
7answers
70k 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 ...
62
votes
4answers
35k views

Visualising WKT geometry string in QGIS

A very simple question: Is there a simple tool in QGIS to graphically visualise geometry formatted as text? Example geometry: "POLYGON((571178 6337246,571178 6402217,598061 6402217,598061 ...
60
votes
4answers
126k 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?
37
votes
1answer
34k 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 ...
30
votes
5answers
37k views

Fixing geometry validity errors in QGIS?

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 ...
26
votes
4answers
75k 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/...
24
votes
3answers
9k 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 ...
23
votes
3answers
32k 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 ...
23
votes
1answer
946 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 ...
22
votes
3answers
11k 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 ...
22
votes
2answers
10k 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: ...
21
votes
6answers
59k views

Convert 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 ...
21
votes
1answer
19k 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": "...
21
votes
1answer
4k 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 ...
21
votes
3answers
15k 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 ...
19
votes
3answers
3k 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 ...
19
votes
2answers
6k 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 ...
19
votes
2answers
8k 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 ...
18
votes
5answers
5k 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 ...
17
votes
6answers
12k 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 ...
16
votes
1answer
10k 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 ...
16
votes
2answers
23k 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?
15
votes
5answers
610 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 ...
15
votes
3answers
39k 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:...
15
votes
3answers
42k 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 ...
15
votes
2answers
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 ...
15
votes
3answers
12k 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 ...
14
votes
2answers
11k 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 ...
13
votes
5answers
579 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 ...
13
votes
3answers
6k 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? ...
13
votes
5answers
2k 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 ...
13
votes
2answers
3k 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 ...
13
votes
5answers
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 ...
13
votes
1answer
544 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 ...
13
votes
4answers
9k 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 ...
12
votes
2answers
1k 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 ...
12
votes
2answers
10k 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?
12
votes
1answer
1k views

How big does a circular geofence need to be for the curvature of the earth to matter? [duplicate]

I'm working on adding geofences to a mobile application. I know the proper way of calculating distance between two points on a sphere is using the great-circle or Haversine formula. I don't know if ...
12
votes
1answer
560 views

Alter Minimum Bounding Box Algorithm

I'm trying to create an algorithm similar to minimum bounding box (though it may end up looking nothing like it). In this case the angle will be passed as a parameter and given the angle I need the ...
12
votes
0answers
412 views

Why do file geodatabase and SDE readers produce different fme_geometry types? [closed]

I have one very simple workbench that I am running against both SDE (9.3) and FGDB (10.0) sources. I noticed two different fme_geometry values for same type of objects. For the first one, i.e SDE 9....
11
votes
2answers
3k 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 ...
11
votes
2answers
8k views

Creating line of varying distance from origin point using Python in ArcGIS Desktop?

I'm trying to create a line feature from a single point, using a set distance and angle using ArcGIS and Python (ArcPy). I have a point at these coordinates: X = 400460.99, Y = 135836.76 From ...
11
votes
5answers
4k views

Measuring straightness of a curve segment (represented as a polyline)

I'm working on an automatic elevation contour labeling algorithm and one of the factors that I want to take into account when deciding the positions of labels is how "straight" a particular segment of ...
11
votes
3answers
14k 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 ...
11
votes
4answers
17k 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() ...
11
votes
2answers
6k views

Cutting up a shapefile into smaller parts

I've downloaded the 450MB coastline shapefile from OpenStreetMap, I want to split it up in smaller parts. Is there a way to generate a shapefile with only the polygons contained in a smaller area? ...
11
votes
2answers
6k 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 ...
11
votes
1answer
6k 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?
11
votes
4answers
609 views

Given a list of surveyor points, what is the algorithm used to simplify the points and retain the terrain characteristics?

Given a terrain and surveyor points sampled from from it or from its contours, is there any algorithm that one can use to simplify the points ( i.e., reduce the surveyor points number) and at the same ...