Question

Write an IFC in Postgres with Postgis extension

  • 23 October 2019
  • 5 replies
  • 40 views

Badge

Hello,

 

I have an IFC file I wish to import in Postgres(PostGIS extension) to go through spatial analysis.

 

Oriinally, what I did was to convert the IFC to a 3DGIS compatible format (GML) and import it in Postgreswhich was successful.

 

Exploring a little more, I saw that Postgres supports the solid geometry type of FME and I performed the same conversion, without converting the geometries to b-rep.

 

This photo shows the input in Postgres

 

and this photo shows the output when I am reading it from Postgres.

 

The highlighted part is visualised differently. I couldn't help but wonder the reason why.

Could you please help me figuring this out?

Thank you,

 

George

 


5 replies

Userlevel 4
Badge +26

So the top image is from a Data Inspector view prior to going into PostGIS and the bottom is the bridge after reading from PostGIS? - Seems a little concerning. Are there any warnings on the log, either when reading from PostGIS or writing the data to PostGIS?

 

 

What happens when you write out to another 3D Format like 3DS? do you see the same problem when reading back in?

 

You could try and repair the data before writing it to PostGIS, try using a GeometryValidator, checking for Solids and Surfaces. This might help.

 

 

Are you able to share the file?
Badge

So the top image is from a Data Inspector view prior to going into PostGIS and the bottom is the bridge after reading from PostGIS? - Seems a little concerning. Are there any warnings on the log, either when reading from PostGIS or writing the data to PostGIS?

 

 

What happens when you write out to another 3D Format like 3DS? do you see the same problem when reading back in?

 

You could try and repair the data before writing it to PostGIS, try using a GeometryValidator, checking for Solids and Surfaces. This might help.

 

 

Are you able to share the file?

Hello Matt,

 

Yes, first photo represents how it is inserted into Postgis, 2nd how it comes out. Both visualised in FME Data Inspector.

 

The geometrytype of the output is IFME Mesh, which is not what I want.

I have passed them through a validator without any changes, log is not being helpful at all, as it logs a successful translation.

 

Thank you for your time.

 

George

Badge +21

Have you tried the GeometryCoercer and "composite_surface" or "brep" before writing - to see if this changes the result?

Userlevel 4
Badge +26

Hello Matt,

 

Yes, first photo represents how it is inserted into Postgis, 2nd how it comes out. Both visualised in FME Data Inspector.

 

The geometrytype of the output is IFME Mesh, which is not what I want.

I have passed them through a validator without any changes, log is not being helpful at all, as it logs a successful translation.

 

Thank you for your time.

 

George

Riight,

 

 

So what looks to be happening is that FME (on write) is creating a mesh/polyhedral surface out of the Data and storing them more as a mesh rather than a BREP. As far as I'm aware though this is how PostGIS represents a soild anyway.

 

 

You might need to do some Processing post import to create solids. https://postgis.net/docs/ST_MakeSolid.html - You can run this tool using the SQL Excecuter in FME after writing to PostGIS. I've never tried it but it might give you what you want.

 

 

Have you looked into CityGML and the 3DCityDB? That could also be an option for your

 

 

Badge +1

Hello,

 

 

I have an IFC file I wish to import in Postgres(PostGIS extension) to go through spatial analysis.

 

 

Oriinally, what I did was to convert the IFC to a 3DGIS compatible format (GML) and import it in Postgreswhich was successful.

 

 

Exploring a little more, I saw that Postgres supports the solid geometry type of FME and I performed the same conversion, without converting the geometries to b-rep.

 

 

This photo shows the input in Postgres

 

 

0684Q00000ArD4zQAF.png

and this photo shows the output when I am reading it from Postgres.

 

 

0684Q00000ArD5WQAV.png

The highlighted part is visualised differently. I couldn't help but wonder the reason why.

Could you please help me figuring this out?

Thank you,

 

 

George

 

 

Hi george!
Kind of unrelated but I was wondering your FME workflow to import an IFC file into PostgreSQL using PostGIS. I am currently doing my master thesis on automating applications of encodings and I need to import an IFC file to my database because of this. Unfortunately, I am having trouble importing geometry to my database through FME.

Can you share some information about your workflow on how you did this?
Thank you in advance!
 

Reply