hypertidy / silicate

A general form for complex data
https://hypertidy.github.io/silicate/
53 stars 4 forks source link

emit TIN #118

Closed mdsumner closed 4 years ago

mdsumner commented 4 years ago
sf::st_as_sfc("TIN Z (((0 0 0, 0 0 1, 0 1 0, 0 0 0)), ((0 0 0, 0 1 0, 1 1 0, 0 0 0)))")
Geometry set for 1 feature 
geometry type:  TIN
dimension:      XYZ
bbox:           xmin: 0 ymin: 0 xmax: 1 ymax: 1
z_range:        zmin: 0 zmax: 1
epsg (SRID):    NA
proj4string:    NA
TIN Z (((0 0 0, 0 0 1, 0 1 0, 0 0 0)), ((0 0 0,..

from https://gis.stackexchange.com/questions/22809/representing-a-tin-in-geojson

mdsumner commented 4 years ago

Also

https://gdal.org/development/rfc/rfc64_triangle_polyhedralsurface_tin.html

wkt_list = ['POLYHEDRALSURFACE (((0 0 0,0 0 1,0 1 1,0 1 0,0 0 0)),((0 0 0,0 1 0,1 1 0,1 0 0,0 0 0)),((0 0 0,1 0 0,1 0 1,0 0 1,0 0 0)),((1 1 0,1 1 1,1 0 1,1 0 0,1 1 0)),((0 1 0,0 1 1,1 1 1,1 1 0,0 1 0)),((0 0 1,1 0 1,1 1 1,0 1 1,0 0 1)))',
                'TIN (((0 0 0,0 0 1,0 1 0,0 0 0)),((0 0 0,0 1 0,1 1 0,0 0 0)))',
                'TRIANGLE ((48 36 84,32 54 64,86 11 54,48 36 84))' ]
mdsumner commented 4 years ago

internal tri_to_sf function though I can't imagine any practical use ...

tri_to_sf(copy_down(DEL(minimal_mesh), "a"))
Geometry set for 20 features 
geometry type:  TIN
dimension:      XYZ
bbox:           xmin: 0 ymin: 0 xmax: 1.23 ymax: 1
z_range:        zmin: 1 zmax: 2
CRS:            NA
First 5 geometries:
TRIANGLE Z ((0.2 0.2 1, 0.69 0 1, 0.5 0.2 1))
TRIANGLE Z ((0.69 0 1, 0.2 0.2 1, 0 0 1))
TRIANGLE Z ((0.2 0.2 1, 0.5 0.2 1, 0.5 0.4 1))
TRIANGLE Z ((0 0 1, 0.2 0.2 1, 0.2 0.4 1))
TRIANGLE Z ((0 1 1, 0.2 0.4 1, 0.3 0.6 1))