teksi / district_heating

Future TEKSI distance heating module
GNU General Public License v3.0
0 stars 0 forks source link

Modelling of geometries - one or several? 2D/3D? #10

Closed sjib closed 1 month ago

sjib commented 1 month ago

The SIA405 Fernwaerme Model is modelling geometries Surface and Ligne of OUVRAGE and TRACE with an extra class:

CLASS Ouvrage_Surface =
ATTRIBUTE
!!   Geometrie: MANDATORY SURFACE WITH (STRAIGHTS, ARCS) VERTEX Base_f_LV95.CoordNat
!!              WITHOUT OVERLAPS > 0.050;
   Geometrie: MANDATORY Base_f.Surface;
END Ouvrage_Surface;

ASSOCIATION Ouvrage_SurfaceAssoc =
   OuvrageRef  -<#> {1} Ouvrage;
   Surface --   {0 .. *} Ouvrage_Surface;
END Ouvrage_SurfaceAssoc;

CLASS Ouvrage_Ligne =
ATTRIBUTE
    Geometrie: MANDATORY Base_f.Polyligne;
END Ouvrage_Ligne;

ASSOCIATION Ouvrage_LigneAssoc =
   OuvrageRef  -<#> {1} Ouvrage;
   Ligne --   {0 .. *} Ouvrage_Ligne;
END Ouvrage_LigneAssoc;

Tthis would allow to have several surfaces and lines for the classes OUVRAGE / TRACE. This would allow to have an e.g. inner and outer surface and if needed lines for drawing details.

Should this be supported in this first version of the module?

We could also just start with one each and see if this is enough during the discussion of your prototype.

Do you want support for 3D geometry?

Currently geomtries are modelled like this: 2D

ALTER TABLE tdh_od.structure ADD COLUMN geometry_geometry geometry('CURVEPOLYGON', :SRID);
CREATE INDEX in_tdh_structure_geometry_geometry ON tdh_od.structure USING gist (geometry_geometry );
COMMENT ON COLUMN tdh_od.structure.geometry_geometry IS ' / offener oder geschlossener Linienzug, Stützpunkte in Landeskoordinaten / polyligne ouverte ou fermée avec des points d’appui en coordonnées nationales';

3D

ALTER TABLE tdh_od.structure ADD COLUMN geometry3d_geometry geometry('CURVEPOLYGONZ', :SRID);
CREATE INDEX in_tdh_structure_geometry3d_geometry ON tdh_od.structure USING gist (geometry3d_geometry );
COMMENT ON COLUMN tdh_od.structure.geometry3d_geometry IS 'yyyy_geschlossener Linienzug, Stützpunkte in Landeskoordinaten / geschlossener Linienzug, Stützpunkte in Landeskoordinaten / polyligne fermée avec points d’appui en coordonnées nationales';

In TEKSI Wastewater we have changed to 3D

sjib commented 1 month ago

Discussions and Decisions:

To clarify

@ponceta What do you think?

sjib commented 1 month ago

Same question with

sjib commented 1 month ago

TEKSI Distant heating drawio

This is an class diagramm based on the information from the INTERLIS files German, French and the translation made for TEKSI district heating.

Notes:

jpdupuy commented 1 month ago

I believe the definition of 3D is wrong in the data model ALTER TABLE tdh_od.structure ADD COLUMN geometry3d_geometry geometry('CURVEPOLYGONZ', :SRID);

CURVEPOLYGONZ is a 2D polygon made of straights and arcs with XYZ coordinates, but it is not a 3D object. in order to support a 3D volume we should use ALTER TABLE tdh_od.structure ADD COLUMN geometry3d_geometry geometry('POLYHEDRALSURFACEZ', :SRID);

sjib commented 1 month ago

CURVEPOLYGONZ is a 2D polygon made of straights and arcs with XYZ coordinates, but it is not a 3D object. in order to support a 3D volume we should use ALTER TABLE tdh_od.structure ADD COLUMN geometry3d_geometry geometry('POLYHEDRALSURFACEZ', :SRID);

We are not yet at 3D volumes with TEKSI - I think if we want to go that far we would need to discuss this in the technical group. @ponceta Can you put this on the agenda for one of the next meetings? At all: Do you see any need to change to 3D volumes in TEKSI already? Is this manageable for the day to day operation?

Please at your comments in this discussion: https://github.com/orgs/teksi/discussions/104

jpdupuy commented 1 month ago

ALTER TABLE tdh_od.pipe_point ADD COLUMN geometry3d_geometry geometry('COMPOUNDCURVEZ', :SRID); should not it be ? ALTER TABLE tdh_od.pipe_point ADD COLUMN geometry3d_geometry geometry('POINTZ', :SRID);

ponceta commented 1 month ago

ALTER TABLE tdh_od.pipe_point ADD COLUMN geometry3d_geometry geometry('COMPOUNDCURVEZ', :SRID); should not it be ? ALTER TABLE tdh_od.pipe_point ADD COLUMN geometry3d_geometry geometry('POINTZ', :SRID);

https://github.com/teksi/district_heating/pull/1/files#r1609444748

sjib commented 1 month ago

ALTER TABLE tdh_od.pipe_point ADD COLUMN geometry3d_geometry geometry('COMPOUNDCURVEZ', :SRID); should not it be ? ALTER TABLE tdh_od.pipe_point ADD COLUMN geometry3d_geometry geometry('POINTZ', :SRID);

Should be corrected with https://github.com/teksi/district_heating/pull/1/commits/c28066d3fe29c40a235b4c5e3cd19da22e99a8ad

sjib commented 1 month ago

Still open:

jpdupuy commented 1 month ago

@jbl typing mistake ALTER TABLE tdh_od.pipe_point ADD COLUMN geometry3d3d_geometry geometry('POINTZ', :SRID); CREATE INDEX in_tdh_pipe_point_geometry3d_geometry ON tdh_od.pipe_point USING gist (geometry3d_geometry );

sjib commented 1 month ago

@jpdupuy Should be fixed with https://github.com/teksi/district_heating/pull/1/commits/b5f7714340e2af75305988abd26365338c288a99

sjib commented 1 month ago

Supporter n lignes - I have to add an extra table *_line for that Added with https://github.com/teksi/district_heating/pull/1/commits/43f85650dca9afdac550198379c104f1ccc84ad2

@jpdupuy This has the requirement to have the extension "uuid-ossp" installed in the database

Maybe you can add datamodel/changelogs/0001/00_extensions.sql in your setup script for windows.

jpdupuy commented 1 month ago

@sjib This extension has been included in our windows setup script TEKSI_CAD.zip