Skip to main content
4 votes
Accepted

Use ST_ApproximateMedialAxis with 3D geometries

So, looking at the source code for the ST_ApproximateMedialAxis and ST_StraightSkeleton indicates that both do in fact drop the z-axis, ie, they work, but ignore the z values. However, there is a ...
John Powell's user avatar
  • 13.7k
4 votes

Postgis exact geometry from text

As of PostGIS 2.5, the geometry and geography types only support storage of double-precision floating point values. Any coordinates that you input to PostGIS are converted to the geometry type, and ...
dbaston's user avatar
  • 13.2k
3 votes

How does ST_ApproximateMedialAxis(geometry) calculate medial axis internally?

The PostGIS ST_ApproximateMedialAxis uses the SFCGAL approximateMedialAxis function (code here). This function computes the straight skeleton using CGAL. It then returns only skeleton edges which are ...
dr_jts's user avatar
  • 5,283
3 votes

PostGIS sfcgal ST_3DArea

The vertices given in 2) cannot be elements of the same 2-dimensional plane; i.e. vertex (0 1 1) cannot be contained in the plane defined by the other vertices. Simple POLYGON geometries (or faces), ...
geozelot's user avatar
  • 30.9k
2 votes

Can sfcgal be Installed on Amazon Web Services

You can install virtually the same set of software in AWS EC2 as that of your laptop. At least, this is the case for me with Ubuntu 16.04 LTS, in which sfcgal works out of the box with apt-get. You ...
tinlyx's user avatar
  • 11.2k
2 votes

ST_MakeSolid() creating an invalid solid from closed polyhedralsurfaceZ

The problem is in the ordering of your points. The front and the back of a face are determined by whether the points turn clock or counter-clockwise. Make sure you'r points all rotate the same ...
tilt's user avatar
  • 3,279
2 votes

ST_Tesselate on PolyhedralSurface is invalid : Polygon 0 is invalid: points don't lie in the same plane (and Is_Planar() only applies to polygons)

Based on user30184's answer and because Is_Planar apparently only applies to polygons, I came up with the following workaround using ST_Dump: SELECT ST_IsPlanar(geom(ST_Dump( ST_GeomFromText( ...
swiss_knight's user avatar
  • 10.9k
2 votes

ST_Tesselate on PolyhedralSurface is invalid : Polygon 0 is invalid: points don't lie in the same plane (and Is_Planar() only applies to polygons)

I would have a try with ST_IsPlanar https://postgis.net/docs/ST_IsPlanar.html.
user30184's user avatar
  • 69.1k
2 votes
Accepted

PostGIS SFCGAL ERROR: PolyhedralSurface is invalid : inconsistent orientation of PolyhedralSurface detected at edge 0 (0-1) of polygon 3

I guess this is the right way to defin the polyhedral surface: SELECT ST_Tesselate( ST_AsText( 'POLYHEDRALSURFACE Z ( ((0 0 0, 1 1 1, 1 2 1, 0 0 0)), ((0 0 0, 1 ...
swiss_knight's user avatar
  • 10.9k
1 vote

3D centroid in PostGIS

I'm also posting here what I have found so far as an answer to keep things clearly separated. So this is my current workaround, maybe other (future) people could have better/faster/more robust ...
swiss_knight's user avatar
  • 10.9k
1 vote
Accepted

ST_3DIntersects says 'no' despite geometries intersecting

It seems that the bug has been corrected. I had a try and got result true,truewith this PostGIS version: POSTGIS="3.4.1 3.4.1" [EXTENSION] PGSQL="160" GEOS="3.12.1-CAPI-1.18.1&...
user30184's user avatar
  • 69.1k
1 vote

sfcgal ST_Volume Issue

Not really an answer but a workaround: Changing the TINZ prefix in the input data file to POLYHEDRALSURFACE Z then works with: ST_Volume(ST_MakeSolid(sd.design)) Maybe there are some polygons ...
craigL's user avatar
  • 121
1 vote

How to Fix Inconsistent Data Conversions in SFCGAL Expressions

The answer is to send the POLYGONZ text strings through ST_MakeSolid before performing any other operations on them. E.g. SELECT ST_Volume(ST_3DDifference(stopeDesign,ST_3DIntersection(s1,s2))) ...
craigL's user avatar
  • 121
1 vote

How to Fix Inconsistent Data Conversions in SFCGAL Expressions

I am posting this as an answer, even though it is not a full answer, as it lacks a complete explanation of why what you are doing isn't working, but this approach does work (and because it is way too ...
John Powell's user avatar
  • 13.7k

Only top scored, non community-wiki answers of a minimum length are eligible