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

1,163 questions
Filter by
Sorted by
Tagged with
33 views

### Definition for point and line geometries?

There is a common definition named "area geometry" to categorize polygons and circles and any geometry that has a surface area. I would like to know if there is an alike definition for points and ...
85 views

I am trying to find area and perimeters of Polygon using Pyqgis3. I tried manually first Vector->Geometry Tools->Add Geometry Attributes. By doing so, I get the area and perimeter column in the ...
142 views

### What algorithm is used by the \$geowithin operator of Mongodb

MongoDB can perform geospatial query such as finding restaurants inside region with the operator \$geowithin. For example: db.places.find( { loc: { \$geoWithin: { \$geometry: { ...
84 views

### Text File MultiPolygon/Polygon to PostgreSQL using Python/Psycopg2

I am writing a python script attempting to insert GeoJSON Polygon coordinates into a Postgres table. I am writing a basic insertion code since I am new to GIS domain. The code look like this: ...
50 views

### Why does this R code that maps points into polygons cause a segmentation fault?

As in this question/answer, I have a data frame of points (which also includes some necessary, non-coordinate data columns) and a shapefile. In this case the shapes are US states. The last line of the ...
237 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 ...
104 views

### Preserving geometry of Union output with Virtual Layer in QGIS 2

There is a polygon layer "Union23" that was created with 'Union' tool. Layer's attribute table includes the following values. My effort is simply to aggregate those polygons by "FLAECHEID" field ...
40 views

### How to calculate a position based on nearby sensors with weights

I'm working on an indoor-positioning project where the users are carrying phones which can detect beacons located throughout the facility. The phone app only knows the IDs of the beacons, and can ...
1k 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 ...
36 views

### How to remove complicated shapes in ArcGIS - generalization [duplicate]

What can be the way of simplifying polygons in ArcMap? I have a shapefile with buildings and I have to make them as simple as it's possible. I used already some tools, like: dissolve, union, ...
117 views

### How to find lat/long of point knowing cross track distance

Knowing lat/long of point A , B and C. And knowing cross track distance (CTX) from point B to point D. How to find lat/long of point D?
65 views

### Measuring width of polygons, which is wider than long

Within my project I am trying to quantify and compare different submarine landslides with ArcGIS. Therefore, I created a polygon shapefile and mapped the spatial extent of each landslide. Now I want ...
37 views

### Listing only Polygon Feature Classes in IMxDocument Using ArcObjects?

I am using VS 2017 with ArcObjects trying to list all polygons in IMxDocument to be used as clip feature in my add-In. I have a WinForms application and the following code: IMxDocument document = (...
101 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... "...
138 views

### Find index of Linestring element at feature, when hovering - openlayers/GeoJson

I have a Geo-JSON Linestring, this is drawn by 800 elements in OpenLayers 4.6.5. I'am trying to use the map.forEachFeatureAtPixel, and print a pop-up when hovering for individual elements on the ...
93 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 = ...
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 ...
386 views

### Handling AIS data using Python and PostGIS?

I want to turn points into a linestring in PostgreSQL with the extension of PostGIS using Python. I want the lines in a new table because every few minutes more points are added and it needs to keep ...
24 views

### Feature geometries sometimes treated as equal, sometimes not (PyQGIS)

QGIS 3.4x64 and Python 3.7 seem to sometimes treat my geometries as equal, sometimes not. I'm debugging code using a reduced dataset with 3 points. Points A and B have the same geometry, and point C ...
21 views

### Separate interstate and non-interstate roads from a given route

I have direction steps from city A to city B (obtained from Google Directions API). I need to differentiate the interstate road distances from non-interstate distances in the route. Google ...
73 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 ...
140 views

### Extracting shapely polygons from .png file? [closed]

I have a .png file coming from a WMS service (WFS is not available). It only contains "straight" lines and I would like to extract the geometries (shapely polygons) of the connected components of ...
52 views

### Bearing Geometry Automatic Calculation?

I am building a cadastral fabric and it's really nice to have the bearing and distance come up on the lines as I traverse around. I just found a great way to do this with the Add Geometry ArcGIS tool. ...
76 views

### arcpy.da.InsertCursor generating empty polygons?

I am using this script to copy some features from an input featureclass into an output featureclass. This works for points but surprisingly not for polygons. For polygons it is generating features ...
178 views

### Azimuth calculation from One to Many Points in PostGIS

I have vector data of 3D City Model in PostgreSQL database. So from my data geometry column, which is a surface geometry. (These are geometries of all the surfaces of buildings). I had extracted the ...
101 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....
228 views

### Is it possible to use SELECT ST_GeomFromText( with other SELECT? [closed]

I'm trying to use SELECT ST_GeomFromText() with a value catched from another query: SELECT ST_GeomFromText( ST_AsText( ST_GeomFromGeoJSON( SELECT column-name FROM table-name ORDER BY ...
177 views

### Problem importing geometry from CSV in QGIS

I have a polygon layer (although I have also converted it to points and tried it that way). I would like to copy this layer into excel and add it back in after editing some things. I've attempted to ...
404 views

### Invalid geometry constructed by EE Python API

I have a problem with Python API of Google Earth Engine. I'm trying to create a vector mask of a small area based on NDVI. I take Sentinel-2 data as two bands and pass a rectangle (defined as series ...
181 views

### Measuring distance to two Points in ArcPy?

I would like to know how to measure the distance from two Points in ArcPy? I know only Geometry has the distanceTo method but how do I could make a typecast in ArcPy? I got the following error ...
97 views

### Cluster geometries that touch each other

I'm trying to cluster the geometries in a sf object that touch each other. For the moment I'm using the same approach that it's explained in the answer here, but the problem is that the same idea ...
98 views

### Troubles with reprojection

I want to draw a polygon on the world map in different map projections, for example, in mercator proj or stereographic one. They must correspond to ICAO ares G (https://aviationweather.gov/satellite?...
273 views

### Creating point at defined distance along line in PostGIS?

How do I create a point at a defined distance along a line? I know we have ST_Segmentize, but it creates more than 1 points - I only need 1. What I want is: For each line: Create ONLY 1 point at ...
51 views

### Avoiding or reducing invalid geometries when geoprocessing in ArcGIS Desktop? [closed]

I use geoprocessing with large polygon datasets. I use Multipart_to_Singelpart and Repair_Geometry to remove all invalid geometries, prior using the tools like Union or Intersect. Regardless the ...
211 views

### How to populate a feature table in a GeoPackage file using GDAL?

I want to use the binary version of GDAL to avoid programming in C or Java here. So I have created a SQL file and I want to run it using the following command : ogrinfo.exe empty.gpkg -sql @...
454 views

### GeoJSON put in the OpenLayers maps

I am a beginner in OpenLayers. I would like a GeoJSON to be displayed on the map. Can you provide me with some example code to allow me to build this small project? The GeoJSON code is: {"type":"...
2k views

### How to fix 'GeoSeries' object has no attribute '_geom'

I'm working on a python script whose goal is to detect if a point is out of a row of points (gps statement from an agricultural machine). To do this, my idea is to make a buffer around the 10 points ...
488 views

### How to convert geometry in the GeoJSON from PHP and insert polygon in PostGIS

I'm a beginner in PostGIS and GeoJSON. I need to extract every geometry from GeoJSON and store them in the PostGIS database as polygons. For each entry in GeoJSON I would like to be able to store ...
213 views

### Getting halfway point in Polyline in ArcGIS API for JavaScript?

I would like to reach the mid point of a polyline. I just tried the centroid and realcentroid properties but I only got a soluction in ArcPy with the code below: Midpoint = geometry....
117 views

### What is geometry(4326), and can you do Cartesian calculations with unprojected ellipsoidal coordinates?

I know Geography(4326) is an unbounded, and unprojected, and covers the entire world with ellipsoidal coordinates. I get that the math on this system is done on a spheroid. I also get that with a ...
147 views

### Delete vertices on polygon feature class, based on the intersection with point shp with python

I need to delete some vertices from some polygon fc that are unnecessary for the geometry. I have a point shapefile that contains all unnecessary vertices as points - but how can I access the vertices ...
176 views

### Invalid geometry vs. no geometry

Looking at the QGIS API Documentation: bool QgsFeature::hasGeometry Returns true if the feature has an associated geometry. Is invalid geometry different from a feature having no associated ...
70 views

### Using centroid point to generate polygon using ArcPy? [closed]

Is this possible to generate polygons from points (which are centroids of future polygon)? I got shapefile with ~250 points + they have got two attributes: length and width. I don't need complete ...
508 views

### Merging lines (with and with no overlaps) in QGIS

I have two layers ("Layer_1" and "Layer_2") of lines where they sometimes overlap and follow each other for a bit and then takes another route (see the image below). "Layer_1": Red line "Layer_2": ...
100 views

### Method to convert all 'overlapping' points to exact same geometry in QGIS 3.4

I have a point vector layer with approximately 2.5 million points, many of which share the same or a very similar geometry (within 1 m of each other). I would like to know if I can bulk amend the ...
117 views

### PostGIS geometry to GEOS geometry without lwgeom dependency?

I've been looking for ways to convert PostGIS to GEOS geometries without linking to or dependency on lwgeom/liblwgeom. The closest thing I can find is a mention of the pointcloud approach here: ...
105 views

### Automatic polygon placement from trail

I have a shapefile with >300 points that correspond to the points where vegetation survey plots were carried out 10m from the road on both sides. Plots have the dimensions 20mx50m. The attributes ...
78 views

### PostGIS Connection In QGIS. Vector Query Results of GeometryCollection Load Layer as Raster

https://postgis.net/docs/ST_VoronoiPolygons.html I am trying to load this query result using PostGIS 2.5 connection in QGIS 3.4, QGIS 2.18. SELECT ST_VoronoiPolygons(geom) As geom FROM (...