SIG

Modelos de Datos 3D

(en SIG)

José Samos Jiménez
()
Dpto. LSI
Universidad de Granada

Citar y Licencia: https://doi.org/10.6084/m9.figshare.27760698.v1

Vídeo: https://youtu.be/avHYeVy0DRg

Contenido

  • ¿Por qué SIG 3D?

  • Modelos Digitales de Terreno: MDT

    • Triangulated Irregular Network: TIN
  • Geometrías 3D y 4D

  • Nube de Puntos

  • Modelos de Edificios 3D: CityGML

  • Otros modelos 3D

  • Conclusiones

¿Por qué SIG 3D?

(Fuente: Devian Art, ClassicTeam, CC BY-NC-ND 3.0)

¿Por qué SIG 3D?

(Fuente: City 3d model, Creazilla, CC0)

Mapa 2D

Mapa 2D basado en ortofoto / híbrido

Modelo 3D

Cambridge 3D Story (por _CambridgeGIS)

Modelos Digitales de Terreno: MDT

MDT: ejemplo

Triangulated Irregular Network: TIN

Geometría TIN en PostGIS

CREATE TABLE tin_2d (
  id SERIAL PRIMARY KEY,
  geom GEOMETRY(TIN, 4326) 
);
INSERT INTO tin_2d (geom) VALUES
(
  ST_GeomFromText('TIN( ((0 0, 1 0, 0 1, 0 0)), 
                         ((1 0, 2 0, 1 1, 1 0)) )', 4326)
);

CREATE TABLE tin_3d (
  id SERIAL PRIMARY KEY,
  geom GEOMETRY(TINZ, 4326) 
);
INSERT INTO tin_3d (geom) VALUES
(
  ST_GeomFromText('TINZ( ((0 0 0, 0 0 1, 0 1 0, 0 0 0)), 
                         ((0 0 0, 0 1 0, 1 1 0, 0 0 0)) )', 4326)
);

CREATE TABLE tin_3d_m (
  id SERIAL PRIMARY KEY,
  geom GEOMETRY(TINZM, 4326) 
);
INSERT INTO tin_3d_m (geom) VALUES
(
  ST_GeomFromText('TINZM( ((0 0 0 10, 0 0 1 20, 0 1 0 30, 0 0 0 40)), 
                          ((0 0 0 50, 0 1 0 60, 1 1 0 70, 0 0 0 80)) )', 4326)
);

Ejemplo de puntos con observaciones

Triangulación de Delaunay

Diagrama de Voronoi

Triangulación de Delaunay y
Diagrama de Voronoi

Ejemplo en PostGIS

CREATE TABLE points (
  id SERIAL PRIMARY KEY,
  geom GEOMETRY(Point, 4326)
);

INSERT INTO points (geom) VALUES 
(ST_SetSRID(ST_MakePoint(6, 8), 4326)),
(ST_SetSRID(ST_MakePoint(0, 3), 4326)),
(ST_SetSRID(ST_MakePoint(3, 1), 4326)),
(ST_SetSRID(ST_MakePoint(3, 10), 4326)),
(ST_SetSRID(ST_MakePoint(8, 4), 4326)),
(ST_SetSRID(ST_MakePoint(3, 5), 4326)),
(ST_SetSRID(ST_MakePoint(7, 10), 4326)),
(ST_SetSRID(ST_MakePoint(9, 6), 4326)),
(ST_SetSRID(ST_MakePoint(9, 10), 4326)),
(ST_SetSRID(ST_MakePoint(1, 8), 4326));
SELECT (ST_Dump(ST_DelaunayTriangles(ST_Collect(geom)))).geom AS geom
FROM points;
SELECT (ST_Dump(ST_VoronoiPolygons(ST_Collect(geom)))).geom AS geom
FROM points;

Presentación en QGIS

Geometrías 3D y 4D

POINTZ y POINTZM en PostGIS

CREATE TABLE points_3d (
    id SERIAL PRIMARY KEY,
    geom GEOMETRY(POINTZ, 4326) 
);

INSERT INTO points_3d (geom) VALUES
    (ST_MakePoint(1, 2, 3)),
    (ST_MakePoint(4, 5, 6)),
    (ST_MakePoint(7, 8, 9));
CREATE TABLE points_3d_m (
    id SERIAL PRIMARY KEY,
    geom GEOMETRY(POINTZM, 4326) 
);

INSERT INTO points_3d_m (geom) VALUES
    (ST_MakePoint(1, 2, 3, 10)), 
    (ST_MakePoint(4, 5, 6, 20)), 
    (ST_MakePoint(7, 8, 9, 30)); 
  • LINESTRINGZ, LINESTRINGZM, POLYGONZ, POLYGONZM, GEOMETRYCOLLECTIONZ, GEOMETRYCOLLECTIONZM, MULTIPOINTZ, MULTIPOINTZM, …

Funciones 3D

SELECT ST_3DExtent(geom) AS extent_3d
FROM points_3d;
extent_3d
BOX3D(1 2 3, 7 8 9)
SELECT id, ST_AsText(geom)
FROM points_3d_m
WHERE ST_M(geom) > 15;
id st_astext
2 POINT ZM (4 5 6 20)
3 POINT ZM (7 8 9 30)

Nube de Puntos

(Fuente: PNOA_2020_AND_454/6/8-4086/8_ORT-CLA-IRC CC-BY 4.0 ign.es)

Nube de Puntos: detalle

(Fuente: PNOA_2020_AND_456-4086/8_ORT-CLA-IRC CC-BY 4.0 ign.es)

Nube de Puntos: formatos

Modelos de Edificios 3D: CityGML

https://www.ogc.org/es/publications/standard/citygml/

CityGML: ejemplo de ciudad

Helsinki Digital Twin (por virtualcitySYSTEMS GmbH, CC BY 4.0 )

CityGML: LoD (Levels of Detail)

CityGML: ejemplo de código

<?xml version="1.0" encoding="UTF-8"?>
<cityModel xmlns="http://www.opengis.net/citygml/2.0"
           xmlns:gml="http://www.opengis.net/gml"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.opengis.net/citygml/2.0 http://schemas.opengis.net/citygml/2.0/cityGMLBase.xsd"
           gml:id="simpleCity">
    
    <!-- Metadata del modelo -->
    <gml:boundedBy>
        <gml:Envelope srsName="EPSG:4326">
            <gml:lowerCorner>0.0 0.0</gml:lowerCorner>
            <gml:upperCorner>10.0 10.0</gml:upperCorner>
        </gml:Envelope>
    </gml:boundedBy>

    <!-- Representación de un edificio en LoD1 -->
    <cityObjectMember>
        <Building xmlns="http://www.opengis.net/citygml/building/2.0" gml:id="Building_1">
            <gml:boundedBy>
                <gml:Envelope srsName="EPSG:4326">
                    <gml:lowerCorner>1.0 1.0</gml:lowerCorner>
                    <gml:upperCorner>5.0 5.0</gml:upperCorner>
                </gml:Envelope>
            </gml:boundedBy>
            
            <!-- Geometría del edificio -->
            <lod1Solid>
                <gml:Solid>
                    <gml:exterior>
                        <gml:CompositeSurface>
                            <gml:surfaceMember>
                                <gml:Polygon gml:id="Wall_1">
                                    <gml:exterior>
                                        <gml:LinearRing>
                                            <gml:posList>
                                                1.0 1.0 0.0  5.0 1.0 0.0  5.0 5.0 0.0  1.0 5.0 0.0  1.0 1.0 0.0
                                            </gml:posList>
                                        </gml:LinearRing>
                                    </gml:exterior>
                                </gml:Polygon>
                            </gml:surfaceMember>
                            <gml:surfaceMember>
                                <gml:Polygon gml:id="Roof_1">
                                    <gml:exterior>
                                        <gml:LinearRing>
                                            <gml:posList>
                                                1.0 1.0 10.0  5.0 1.0 10.0  5.0 5.0 10.0  1.0 5.0 10.0  1.0 1.0 10.0
                                            </gml:posList>
                                        </gml:LinearRing>
                                    </gml:exterior>
                                </gml:Polygon>
                            </gml:surfaceMember>
                        </gml:CompositeSurface>
                    </gml:exterior>
                </gml:Solid>
            </lod1Solid>
        </Building>
    </cityObjectMember>

    <!-- Representación de un árbol -->
    <cityObjectMember>
        <SolitaryVegetationObject xmlns="http://www.opengis.net/citygml/vegetation/2.0" gml:id="Tree_1">
            <gml:boundedBy>
                <gml:Envelope srsName="EPSG:4326">
                    <gml:lowerCorner>6.0 6.0</gml:lowerCorner>
                    <gml:upperCorner>6.0 6.0</gml:upperCorner>
                </gml:Envelope>
            </gml:boundedBy>
            
            <!-- Geometría del árbol -->
            <lod1Geometry>
                <gml:Solid>
                    <gml:exterior>
                        <gml:CompositeSurface>
                            <!-- Representación del tronco -->
                            <gml:surfaceMember>
                                <gml:Polygon gml:id="Trunk">
                                    <gml:exterior>
                                        <gml:LinearRing>
                                            <gml:posList>
                                                6.0 6.0 0.0  6.2 6.0 0.0  6.2 6.2 0.0  6.0 6.2 0.0  6.0 6.0 0.0
                                            </gml:posList>
                                        </gml:LinearRing>
                                    </gml:exterior>
                                </gml:Polygon>
                            </gml:surfaceMember>
                            <!-- Representación de la copa del árbol -->
                            <gml:surfaceMember>
                                <gml:Polygon gml:id="Crown">
                                    <gml:exterior>
                                        <gml:LinearRing>
                                            <gml:posList>
                                                5.8 5.8 5.0  6.4 5.8 5.0  6.4 6.4 5.0  5.8 6.4 5.0  5.8 5.8 5.0
                                            </gml:posList>
                                        </gml:LinearRing>
                                    </gml:exterior>
                                </gml:Polygon>
                            </gml:surfaceMember>
                        </gml:CompositeSurface>
                    </gml:exterior>
                </gml:Solid>
            </lod1Geometry>
        </SolitaryVegetationObject>
    </cityObjectMember>
</cityModel>

Generar y almacenar CityGML

  • FME (Feature Manipulation Engine)

  • ArcGIS CityEngine

  • Blender, SketchUp

  • Python, py3dcitydb

  • 3DCityDB

Otros modelos 3D

  • Modelo Volumétrico: vóxeles (volumetric pixels)
    • ráster
    • celdas cúbicas
    • ejemplo: modelado geológico o atmosférico
  • Modelo de Malla (mesh)
    • vectorial
    • vértices, aristas, polígonos (triángulos, cuadriláteros)
      • TIN
    • mallas regulares / irregulares
    • ejemplo: estructuras naturales y artificiales
  • Otros:
    • Industry Foundation Classes (IFC), Building Information Models (BIM), Esri Multipatch, …
    • 3D Tiles, Keyhole Markup Language (KML/KMZ)

Conclusiones