Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [geos]

A library providing vector geometry services

1
vote
1answer
56 views

Hausdorff distance (ST_HausdorffDistance) extremely slow for polygons?

I have a simple SQL statement for computing the Hausdorff distance between two polygons of the form: SELECT ST_HausdorffDistance(geom1, geom2); , which is taking a long time (for a pair of polygons ...
0
votes
0answers
25 views

ST_Polygonize/Shapely cannot polygonize when overlapping with shared node/point

I'm trying to use both polygonize_full (Shapely, python) and ST_Polygonize (postgis) to get all polygons from a set of line strings. There is one case where it fails: when there is an "overlapping ...
1
vote
2answers
69 views

ST_Union Topology exception despite of valid geometries

I have an isochrones layer and I want to calculate the population lays on the overlapping regions. My first step is to create an intersection between all the isochrones. After that, I try to create a ...
0
votes
1answer
196 views

Load multipolygons from GeoJSON into GeoDjango model

I have a simple model: from django.contrib.gis.db import models class CountryShapes(models.Model): geonameid = models.PositiveIntegerField(primary_key=True) geom = models.MultiPolygonField() ...
3
votes
1answer
149 views

Get exterior ring of a multipolygon using GEOSGeometry or PostGIS

I am trying to get the exterior ring of the multipolygon in the image below using GEOSGeometry (through GeoDjango) or Postgis, but I have not found an easy solution. This is an example of a ...
0
votes
1answer
27 views

How to call GEOS error handlers provided during initialization (initGEOS)?

From what I learned, when using GEOS in C/C++, it should be initialized first using initGEOS : extern void GEOS_DLL initGEOS(GEOSMessageHandler notice_function, GEOSMessageHandler ...
2
votes
1answer
72 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: ...
0
votes
0answers
14 views

GeoPHP geosInstalled returns false

I have installed OSGeo4W on my 64-bit windows. I am trying to use GEOS functions in GeoPHP, but when I call geoPHP::geosInstalled, it returns me false. This is how I included the libraries: <?php ...
1
vote
1answer
54 views

Enabling C++ standards when compiling GEOS using cmake/ccmake?

I read from RFC # 7 of GEOS that the old autoconf based build system may be removed in the future, in favor of using cmake. I sometimes need to customize geos and add functions that uses the newest C+...
1
vote
0answers
121 views

Why is Union in ArcMap much faster than other approaches? [closed]

Taking the union* of these two large shapefiles file1 file2 locally using ArcMap takes appr. 10 min. Over the last few weeks, I've tried to obtain the same results using other, open-source ...
1
vote
1answer
30 views

Update R-tree to insert after query

I would like to use the GEOS R-tree implementation to store the items of a growing structure. However, I also need to query from the tree during the growth process to make sure that growing ...
0
votes
0answers
170 views

Can't upgrade PostGIS on Ubuntu with Postgres 10?

I am running Postgres 10.5 (I think) on Ubuntu 14.04. I want to upgrade to PostGIS 2.2+ so I can use ST_Subdivide. I've done: apt install postgresql-10-postgis-2.4 But when I try to upgrade PostGIS ...
4
votes
0answers
62 views

ST_3DIntersects says 'no' despite geometries intersecting

Considering the following query I expect both geomb and geomc to 3D Intersect with geoma. According to postgis, only geomc intersects. Unfortunately I can't come up with a more simplified polygon as ...
0
votes
2answers
908 views

Error building GEOS on Ubuntu 18.04

Following the directions to install geodjango on linux ubuntu 18.04, so far here are my commands: sudo apt-get install binutils libproj-dev gdal-bin wget http://download.osgeo.org/geos/geos-3.4.2....
1
vote
1answer
39 views

What is IndexedFacetDistance in JTS?

I just read from GEOS 3.7 documentation that there is a new IndexedFacetDistance imported from JTS. Reading from the JTS link, I cannot tell what the new distance metric does except that it's taking ...
1
vote
1answer
462 views

QGIS and Shapely : Shell is not a LinearRing

When trying to create a polygon with Shapely with QGIS python console, i'm getting the error : ValueError: Null geometry supports no operations And it prints Shell is not a LinearRing in the ...
2
votes
0answers
46 views

Trying to count points in polygon and add a column to the table [duplicate]

I have a data variable called "schools" with the following data. | School Name | Address | geometry | |---------------------------------------------- | | School A | 123 abc | c(123....
2
votes
1answer
102 views

GeoPandas returning incorrect spatial join results. GDAL problem? GEOS problem?

I'm having a problem that I can reproduce on an Ubuntu installation of GeoPandas (0.3.0), but not on my local OS X intallation (same geopandas version). Here's the example (taken from the geopandas ...
1
vote
0answers
82 views

How to replicate ST_Length using python without saving to DB?

I'l like to be able to calculate the length in meters of a LineString, in python. I came across this question: Get LineString length in meters (Python, GEODjango) but the recommended method seems to ...
0
votes
2answers
429 views

gUnaryUnion from rgeos packge fails randomly

I am using gUnaryUnion() function from the rgeos package to "melt" administrative regions into bigger units. At times I do get the expected result, and other times (seemingly randomly, so I suspect ...
3
votes
1answer
283 views

Reading Point object under different environnement

The problem I create a GIS model which works fine on my dev environnement. When I push my app to my production environnement I get an GEOS_ERROR GEOS_ERROR: ParseException: Invalid HEX char. here ...
1
vote
0answers
98 views

Cartesian / Meters issue while making ellipses

I am trying to create an ellipse to be stored in my django project. I'm provided a lat, lon, major/minor in Nautical Miles, and an orientation in degrees. Between this post and the docs I've been able ...
1
vote
1answer
62 views

How do I patch libgeos without losing QGIS?

How can I create a custom libgeos to replace the one in my Ubuntu system? Basically, I'm trying to expose some of GEOS functions (orientedDistance()) to other packages as explained in Directed ...
5
votes
2answers
233 views

Directed Hausdorff distance in PostGIS?

I was wondering how to implement a directed (or one-sided) Hausdorff distance function in PostGIS? I looked into the PostGIS 2.3.3 source code, and it seems that ST_HausdorffDistance is implemented ...
2
votes
0answers
19 views

Sample data for testing GEOS bindings

Similarly to this question (Is there a source for free CSV files with geo data and other desired fields?) I am working on testing an open source set of bindings for the GEOS project and would like to ...
1
vote
0answers
99 views

Creating an offset line with the rgeos package

I discovered the ST_OffsetCurve function in PostGIS, it is based on GEOS. I'd like to compute the same in the R software, using the package rgeos. I couldn't find a same-named function though. Has ...
0
votes
2answers
192 views

Issue with GEOS not creating buffer correctly for use in Django

Currently in my django I use the following function to take a point, buffer it by 2000 meters, and produce a circle polygon: updatequery = str("update table_events set event_geo = ST_Multi( ...
2
votes
1answer
809 views

Shapely in Spyder for Python 2.7

I already use another library "shapefile", which was easy to import. However I just installed shapely 1.3.3 for windows (which still has an installer) and cannot import it. I tried it the same way as ...
7
votes
1answer
2k views

ST_Union fails with TopologyException despite valid polygons and using ST_SnapToGrid

I am working with Postgres 9.6 and PostGIS 2.2.2. These are my tables: Table "public.allparcels" Column | Type | ...
1
vote
1answer
135 views

Strange result with ST_Distance, geography type and equator

I am getting strange results with distance queries in PostGIS using geography types and ST_Distance. According to the docs, ST_Distance should return the distance in metres between two geography ...
2
votes
0answers
301 views

'ST_Subdivide' function (3.5.0+ required) GEOS

Im running a query with ST_SubDivide() and receiving the error bellow. ERROR: The GEOS version this PostGIS binary was compiled against (34) doesn't support 'ST_Subdivide' function (3.5.0+ required) ...
3
votes
1answer
1k views

How to find the minimum perimeter oriented bounding box?

I would like to know an algorithm to calculate the minimum perimeter oriented bounding box of a point set or polygon. I know that if I use the rotating calipers, I am able to get the minimum area ...
4
votes
1answer
543 views

Convex hull with n points using computational geometry libraries

I've been searching for a function to make the Convex Hull of a Spatial Object with N points, to make an spatial approximation with n-corners, as shown in the article "Comparison of Approximations of ...
1
vote
0answers
241 views

GeoDjango: GDAL library is not available to transform() geometry

I am trying to take points and buffer them to create polygons in my django project. I queried for points and tried to take the geometry of the first point and transform it to a meters based system (...
1
vote
1answer
1k views

Geopandas [Shapely] spatial difference: TopologyException: no outgoing dirEdge found

I am working on the "solver" that sequentially selects best location from the list, basing on poi and overlapping polygons within the certain buffer, then removes those points and location from the ...
3
votes
1answer
842 views

Parsing WKB with python geos: ParseException: Unknown WKB type 16

I am pulling a WKB strings from the MYSQL table in pandas / geopandas, Python 2.7. As it is MySQL, the only way to read geometry is to parse it on the client. However, when parsing, geos raises an ...
3
votes
0answers
94 views

GDAL 2.1 DelaunayTriangulation Give bad results (sometimes)

I am using the latest stable release of GDAL 2.1. When I add vertexes to a polygon in a loop sometimes it does not return the correct results. If I put those same values in hard coded, the right ...
4
votes
1answer
949 views

inaccurate distance measurements in Python

I've tried several ways of measuring the distance between two points in my Django application and comparing the results to a reliable measurement. My numbers are way off. For example, I'm assuming the ...
2
votes
1answer
146 views

What does the GEOS LineString “normalize()” routine really do?

What does the GEOS LineString "normalize()" routine really do? GEOS has virtual void geos::geom::LineString::normalize() with the documentation: A normalized linestring has the first point which ...
3
votes
0answers
158 views

Can I reorder the points in a GEOS LineString?

Using libgeos, when I buffer() a polygon and then getExteriorRing() [to make a slightly smaller outline copy of the polygon just inside the original], it seems that which point on the new geometry is ...
0
votes
1answer
590 views

Finding neighbors for non adjacent polygons in R [closed]

I'm looking for a method or function in r-project that create a neighborhood matrix from a group of polygons that don't touch each other, like polygons of set of blocks separated by streets in a town. ...
3
votes
0answers
138 views

Casting group of two polygons with rgeo returns nil

Here's an array of 2 polygons I'm trying to cast into a multipolygon (wkt string format). The polygons are in a linear CRS, SRID:3361 ["POLYGON ((990863.9961167622 709913.6373089257, 990983....
0
votes
2answers
274 views

Trouble getting shapely to run

I downloaded the GDAL complete Framework von Kyngchaos which also includes the GEOS Framework and shapely for python. I can import shapely without a problem, but when I try to perform some "geo ...
2
votes
0answers
195 views

geoPHP pointOnSurface always returns null

Using geoPHP with geos installed. pointOnSurface() for a valid polygon always returns null. While other functions such as centroid() work fine. Example: geoPHP::geosInstalled(); //true $...
4
votes
1answer
737 views

gBuffer(rGEOS) causing R to crash

I have downloaded a US federal lands data layer (fedlanp010g.shp.tar.gz) from http://nationalmap.gov/small_scale/atlasftp.html?openChapters=chpbound#chpbound In R, I am trying to create a buffer ...
4
votes
2answers
716 views

Create a new point from a reference point, degree and distance

I'm trying to calculate the coordinate of endPoint using the lat/lon of startPoint as a reference. I know the distance between the start and end points and I know the azimuth to the endPoint. I ...
1
vote
2answers
3k views

Python Gdal ERROR 6: GEOS support not enabled

I installed GDAL from here (https://pypi.python.org/pypi/GDAL/1.9.1) Before attempting the python GDAL I installed the prerequisite gdal libraries using Kyngchaos's description some time ago (http://...
1
vote
0answers
388 views

Error and kernel dies with shapely/geos inside Jupyter notebook

I have a Python 2.7 script (code below) that scrapes data from a table on the web and draws a map. It runs fine from the command line using $ python bears.py When I run the identical script from ...
3
votes
0answers
114 views

Building GEOS / GDAL halts on embedding manifest files [closed]

I'm trying to build GEOS and GDAL from source on a Windows machine. I have Visual C++ for Python 9.0 installed with Lib / Include / PATH environment variables established (as far as I am aware). But ...
4
votes
3answers
1k views

GDAL with GEOS support, pandas and VTK using python on Windows?

So far I have been using OSGeo4W shell (or OSGEO install) as really convenient way to use python together with additional packages, namely gdal, shapely, numpy, scipy and matplotlib. I was happy till ...