Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
sjib opened this issue May 15, 2024 · 13 comments
Closed

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

sjib opened this issue May 15, 2024 · 13 comments
Assignees
Labels
datamodel question Further information is requested

Comments

@sjib
Copy link
Contributor

sjib commented May 15, 2024

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 sjib added question Further information is requested datamodel labels May 15, 2024
@sjib sjib changed the title Modelling of geometries - one or several? Modelling of geometries - one or several? 2D/3D? May 15, 2024
@sjib
Copy link
Contributor Author

sjib commented May 15, 2024

Discussions and Decisions:

  • Support 3D as we get 3D information today - same as TEKSI wastewater
  • Supporter n lignes

To clarify

  • Ouvert: support also n polylignes?
  • Ajouter Surface et Ligne in an extra class? Or does QGIS support MULTIPOLYGON and MULTILINE?
  • check with INTERLIS - how to aggregate and disaggregate? Which option is easier - seperate classe as in INTERLIS or transformation between MULTIPOLYGON and MULTILINE?

@ponceta What do you think?

@sjib
Copy link
Contributor Author

sjib commented May 15, 2024

Same question with

  • Trasse / Trace
  • Pipe_section
  • Cable a distance

@sjib
Copy link
Contributor Author

sjib commented May 17, 2024

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:

  • In class trench (Trace / Trasse) there is an attribut geometrie within the class plus extra trace_surface and trace_ligne

  • In contradiction in structure (ouvrage / Bauwerk) the geometry attributes are only in the extra classe structure_surface and structure_ligne

  • It looks like this is a modelling error in INTERLIS with class trench

  • I suggest to start with implementing:

  • geometry3D as surface for classes trench and ouvrage in TEKSI Distant heating

@jpdupuy
Copy link
Collaborator

jpdupuy commented May 21, 2024

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
Copy link
Contributor Author

sjib commented May 21, 2024

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
Copy link
Collaborator

jpdupuy commented May 22, 2024

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
Copy link
Member

ponceta commented May 22, 2024

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
Copy link
Contributor Author

sjib commented May 23, 2024

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 c28066d

@sjib
Copy link
Contributor Author

sjib commented May 23, 2024

Still open:

  • Supporter n lignes - I have to add an extra table *_line for that

@sjib sjib self-assigned this May 23, 2024
@jpdupuy
Copy link
Collaborator

jpdupuy commented May 24, 2024

@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 added a commit that referenced this issue May 24, 2024
@sjib
Copy link
Contributor Author

sjib commented May 24, 2024

@jpdupuy Should be fixed with b5f7714

@sjib
Copy link
Contributor Author

sjib commented May 24, 2024

Supporter n lignes - I have to add an extra table *_line for that
Added with 43f8565

@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.

@sjib sjib closed this as completed May 27, 2024
@jpdupuy
Copy link
Collaborator

jpdupuy commented May 27, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
datamodel question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants