Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. Listen now

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.

185 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
6
votes
2answers
4k views

C# implementation of concave hull / alpha shapes

I'm looking for a C# implementation of the Concave hull (alpha shapes) algorithm. I already found several Java, Python and C++ implementation but no C# version. The other implementation are quite ...
4
votes
0answers
117 views

Change from LineString to MultiLineString when saving layer edits in QGIS

In QGIS, when a user creates a new single part line in an open editing session for a “Multi-Line” SpatiaLite dataset, the QGIS data type is initially a “LineString”. But, when the user commits the ...
4
votes
0answers
209 views

Using transform function in QGIS layer geometry generator?

I'm trying to use the following expression in the geometry generator in a QGIS layer to show a 1-mi boundary around points: buffer(transform($geometry, 'EPSG:4326', 'EPSG:2877'), 5280) However, the ...
4
votes
0answers
604 views

Right-hand-rule in QGIS

It seems that there isn't a plugin to perform the right-hand-rule on a layer or selected features. Can this be done by using some Python code? Is there a function that works in the same way as ...
4
votes
0answers
98 views

Style rule based on feature adjacency?

Is there a way in QGIS to use an expression to define a polygon feature's color based on whether it's adjacent to other features? I would like to achieve something like the following: -If a feature ...
4
votes
1answer
696 views

How to offset/displace overlapping lines in a web map?

I have a dataset of points representing a To/From status - something like distribution centres and delivery addresses. When the user clicks on a point I'd like to show the relationships between this ...
3
votes
0answers
52 views

Lines length plugin - QgsVectorLayer error

Several similar questions have already been made, but none of the is helping me. I have a layer of polygons and I want to known the length of each line of each polygon. And based on the length I ...
3
votes
0answers
104 views

Create multipoint layer from array by expression

I have two layers. One shapefile point layer, called "point1" and one csv no geometry layer, called "Meta". "point1" looks like: id bd 1 a 2 b 3 c 4 d 5 e 6 f and so on... "...
3
votes
0answers
74 views

Check Geometry - Bad Envelope

I have a polygon feature which returns Bad envelope when run through the Check Geometry tool. According to the help: Bad envelope : The envelope does not match the coordinate extent of the ...
3
votes
0answers
288 views

How to plot geometry(MultiPolygon, 3044) QGIS based datatype in python

I have a table tb_regions in Postgresql having a column c_geometry which contains geometry(MultiPolygon, 3044) datatype from QGIS. I know how to retrieve data from Postgresql using pythons psycopg2 ...
3
votes
0answers
342 views

Dissolve fails, geometry errors, and cleaning problems

I fairly new to GIS, and I'm having an issue with dissolving a vector. To start, I'm running QGIS 2.14.15 on Windows 7 Pro. When I try to dissolve the polygons it creates a blank shapefile. All of the ...
3
votes
0answers
155 views

How to measure orthogonal distance of line from point in QGIS?

As I am fairly new to QGIS I'm seeking your help. I'm trying to measure the distance between points in a point Layer P and the end of lines in a line layer L. In L there are two categories (attributes)...
3
votes
1answer
609 views

Using Check Geometries plugin for polygons in QGIS?

I've a few hundred polygon features with many duplicate nodes, gaps, overlaps and other geometry errors. Fixing all errors seems to be quite tricky. I had to run the duplicate nodes check twice to fix ...
3
votes
0answers
285 views

Interpolating point to nearest polygons to compute street width in posgis

I am trying to calculate the width of streets (line.shp) in postgis using reference point (ref_point.shp) (yellow point features) and building polygons (building.shp). The red point features are the ...
3
votes
0answers
387 views

Geometry issues when digitising in QGIS

I'm digitising a large number of maps from hand drawn mud maps and digital images, and although I have used the snapping tools ("snap to vertex and segment", Tolerance 10 pixels, avoid intersections) ...
3
votes
0answers
1k views

how to orthogonalize building outlines

I'm looking for a way to orthogonalize building outlines which I've extracted from a high-res DEM. I'm using the FOSS GIS stack (QGIS, GRASS, SAGA, PostgrSQL, PostGIS) and can code in Python (or Java)....
3
votes
0answers
363 views

What is the area that OGR extracts from the (geometry) shp files for polygons?

The ESRI July 1998 technical documentation for polygon shapefiles at page 10 makes no mention of either area measures or length measures (apart from byte/record-layout matters). Yet OGR enables me to ...
3
votes
0answers
95 views

PostGIS does not export shortest path to Shapefile

I am trying to draw a bunch of lines overlaying the globe map in a WGS84 projection. To this effect I have created a PostGIS DB with a table that has one column containing linestring data. My problem ...
2
votes
0answers
21 views

GDAL osgeo for python treating Z dimension differently

I have a space defined by a polyhedral surface, and I would like to check if a point is inside this space, and I would like to do this in python with gdal. After trying the default installation of ...
2
votes
0answers
39 views

QGIS: check and repair geometry

I'm studying how to check and repair geometry correctly and found the "check geometry" tool which seems to work fine. However there are also tools called "check validity" and "fix geometry" which ...
2
votes
1answer
69 views

Optimising Large Spatial Queries in SQL

I'm sure similar answers have been given elsewhere but no matter what I have tried I am unable to optimise this query. Details: TableA has 3.5mill records TableB Had 57000 records but I have ...
2
votes
0answers
60 views

Applying filter on the geometry for a given feature?

I have multiple layers, with multiple features, where I am interested in extracting information from a given feature within a rectangle. I am able to achieve this using the following filter, ...
2
votes
1answer
51 views

Making polygon shapefile from unsorted point shapefile?

I have a point Shapefile with unsorted feature ID's (FID). I want to convert the same point file into polygon Shapefile by using python gdal/ogr. I got the help from link1 and link2. I'm able to make ...
2
votes
0answers
54 views

Calculate the length of geometry line object using python in QGIS

Calculating the length of a geometry line object using the Field Calculator gives you 2 options: $length where the length calculated by this function respects both the current project's ellipsoid ...
2
votes
0answers
40 views

Generate arc from projection coordinates

I have a mind to generate arc from given parameters: start point coordinates arcDistance arcBearing arcOrigin coordinates. My concept is, calculate the end point of arc (function geo.sphere....
2
votes
0answers
53 views

Can I correct position data from a device suffering from the 4/6/19 roll-over problem?

I work for a company that sells apparatus containing GPS receivers. Over the years a lot of this gear has been sold and deployed. A number of machines in the field contain GPS receivers that feature ...
2
votes
1answer
241 views

Listing all overlapping polygons using PostGIS?

Assume a table of overlapping polygons where the number of polygons overlapping a single area varies from 1 to n. I am trying to find a PostGIS/SQL query that will return a list of all of the polygons ...
2
votes
0answers
95 views

Calculate length of selected features in PyQGIS

I create a selection with getFeatures(QgsFeatureRequest()) and I want to calculate the length of the result which is a QgsFeatureIterator : select = QgsExpression(" myexpression ") selectedfeats = ...
2
votes
0answers
57 views

PostGIS ST_Area causing error when used with “use_spheroid=false” setting, succeeds with spheroid

I am running into an issue with using the PostGIS ST_Area function against a dataset loaded with osm2pgsql. Setup: PostgreSQL 11.2/PostGIS 2.5.1 osm2pgsql 0.96 When I attempt to run the ST_Area ...
2
votes
0answers
102 views

T-SQL Invalid Geometry Created by Intersection

I have two sets of geometries (A and B) in SQL Server 2016. I want to determine the overlap areas of those geometries from set A that intersect set B. Most of the time this code works: SELECT a....
2
votes
0answers
87 views

ST_ApproximateMedialAxis producing strange outputs

My problem is as follows: I have some lines (yellow), that I want to merge in one line if they are at a certain distance (blue, buffer), and after a long research I found this function from PostGIS/...
2
votes
1answer
481 views

Remove vertex from geometry (polygon) in OpenLayers 5?

I could able to remove the recent modified vertex of a feature using removePoint method of modify interaction, as well as using deleteCondition event of modify interaction. However, that is not what I ...
2
votes
0answers
242 views

Error WFS (2.0.0) GetFeature spatial query with multi-surface geometries in ArcGIS Server 10.6

In the new version of ArcGIS Server 10.6 it is not possible to request GetFeature WFS with spatial filters with multi-surface geometry. The following is an example of the query: GML3 geometry would ...
2
votes
0answers
184 views

Building footprint polygon simplification / generalisation

I'm looking for implementations of polygon simplification algorithms that preserve topology and overall rectilinearity. The input data is building footprints which often have squarish protrusions and ...
2
votes
0answers
99 views

Automatically delete overlapping polygons

I have 200 000 polygons that needs to remain like circle and they can't be on top of each other. I need to find a way to correct the 8000 errors I've got automatically. A picture's worth a thousand ...
2
votes
0answers
113 views

Shape index, compactness and assymetry index with PostgreSQL /PostGIS

I am working on automated land parcel identification and would like to extract road/river/thin and linear-like polygons from a massive dataset. For now, the only index I can get some answers from is ...
2
votes
0answers
1k views

How to connect existing postgis tables with Django models

I have some existing tables (shapefiles) and I want to connect each table with a django model. I imported the tables with shp2pgsql tool: shp2pgsql -I -s 2100 -W 'iso-8859-7' world.shp public.world | ...
2
votes
0answers
145 views

Faster equivalent of arcpy distanceTo method

Unfortunately arcpy distanceTo method is painfully slow. When speed is crucial, I am still using Avenue to work around it, but it is getting harder to transfer ArcView 3 to newer computers. As ...
2
votes
0answers
183 views

Determine Geometry of Multiple Layers in QGIS

I am sure this is a newbie question. I am importing a large number of layers into QGIS from a complex .kml file and need to combine into a single layer and finally save as a .shp file. I repeated ...
2
votes
0answers
601 views

How to calculate elevation of the point?

I have two points: A ( x1 ( latitude ), y1 ( longitude ), z1 ( elevation ) ) and B ( x2, y2, z2 ). x1,y1,z1 and x2,y2 are known, also I know the distance between A and B. How can I calculate z2 ...
2
votes
0answers
855 views

How to convert geometry to WKB in QGIS?

I have a shapefile with polygon type geometry. I want WKB format of the geometry values. Is there any such tool in QGIS so that without using gdal/ogr I can do this?
2
votes
0answers
253 views

What does “Feature doesn't have a geometry” mean in QGIS?

When I open the .shp file and click on specfic item in the attribute table, in the canvas, it said "Feature doesn't have a geometry". Is it the same as "geometry is not valid", or does it simply mean ...
2
votes
0answers
170 views

Create geometry in PostGIS with OGR and Python

I have issue with PostGIS, Excel spreadsheets and Python OGR bindings. I need to read many Excel spreadsheets (with same schema), parse latitude and longitude fields, create points, re-project them ...
2
votes
0answers
100 views

QGIS clip tool doesn't regenerate geometry column in attribute table

I have a lot of large datasets which all contain WKB defined geometry (point and polygon separate), which makes it easy to load in QGIS from a PostGIS-database. This format is also preferable when ...
2
votes
0answers
88 views

Asp.net or MsSql Create bbox of a point proportional to image height and width

Short question is how do I create bbox dimensions that is proportional to image height and width? I'm working on a asp.net webservice to generate a map using geoserver. The parameters I have are ...
2
votes
0answers
378 views

Best SRID for worldwide data in Microsoft Sql Server geometry field?

I'm using Microsoft Sql Server 2012 to store geographical data related to hydrometeorological stations which are scattered around the globe (point layers and multipolygon layers). My data is in WGS84 ...
2
votes
0answers
119 views

C/C++ function to return minimum set of points required to represent a geometric shape

I am looking for a method from Grass, GEOS, or similar that will delete those points in a geometry which do not affect its shape. Example 1 +----+----+ p0 p1 p2 p1 can be deleted without ...
2
votes
0answers
865 views

Importing shapefile problem, unknown geometry type in QGIS

I have used ArcGIS extensively, but am at a new job with only access to QGIS. I am trying to import a few shapefiles and am having some problems. First, I opened the shapefiles in esris free browser, ...
2
votes
0answers
134 views

Split Polygon Layer by other Polygon layer in QGIS

I know there is a lot of previous posts to this subject, but I simply cannot find the solution I am after in the other posts. I have to following problem: I have two very extensive polygone layers, ...
2
votes
0answers
134 views

how to register view geometry made by MakeLine function?

I am trying to to create a spatial view on my spatialite database. CREATE VIEW v2_pump_view AS SELECT pump.ROWID AS ROWID, pump.id AS pump_id, MakeLine( ...