[postgis-users] Large 3D triangluar meshes - good fit?

Darafei "Komяpa" Praliaskouski me at komzpa.net
Sun Nov 26 07:39:08 PST 2017


Hi Eric,

That's how I would address this in PostGIS:
 - structure table in form of object_id | triangle | triangle_properties,
and a separate one for objects;
 - create index using gist on table (triangle gist_geometry_ops_nd);
 - make sure your statistics_target is large enough so a cell of
sqrt(statistics_target)*sqrt(statistics_target) (or cube root for 3D) is
comparable to usual request bbox, not a lot bigger;
 - use &&& to do 3D box tests, and ST_3DIntersects for more complex shapes.
 - ordering wil be trickier. I expect it to be some kind of camera
coordinate ordering, so indexes will not help you there much. Other than
that ORDER BY clause should work as usual.

I expect performance to be within your constraints for triangle bbox
filtering, and biggest bottleneck being exact shape recheck and ordering,
but that depends on number of triangles you've fetched by bbox.

You may want to explore sfcgal postgis backend, as it seems it enables some
more operations for 3D. PostGIS is mostly 2D so you may lose your Z with
some functions.

There is TRIANGLE in postgis's WKT implementation that stores triangle
effecienlty. It also means that an index that uses boxes of triangles may
occupy even more space than data table itself :)


вс, 26 нояб. 2017 г. в 11:27, Eric <knacktus at googlemail.com>:

> Hi all,
>
> I'm completely new to PostGIS and spatial DBs, but not to Postgres. I've
> scanned the docs and saw that PosGIS can do a lot, but that it also
> needs some proper learning.
>
> So, before I dive into PostGIS, I'd like to ask you about your opinion.
> How good does PostGIS fit in the following use-case?
>
> - objects of large 3D triangular meshes; up to 50 000 triangles per object
> - up to 10 000 objects in a scene
> - overall about 50 000 000 triangles in a scene
>
> - get all objects inside a volume (box, cube and capped pyramid - like a
> frustum) - based on the bounding box
> - get all triangles inside a volume, where the triangles can be filtered
> prior this check.
> - order triangles by coordinate
>
> Performance does matter. Queries should be roughly in the order of ~ 100
> ms. (I have absolutely no idea if this is realistic ...). Available
> infrastructure is quite capable (128 GB ram 16 Cores).
>
> Thanks and best regards,
>
> Jan
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20171126/7d7fca88/attachment.html>


More information about the postgis-users mailing list