Solved

how to convert IFC file to postGIS?

  • 1 August 2022
  • 5 replies
  • 32 views

I am trying to find a way to get the data from IFC file and import it to postGIS data.

 

I tried to do it using a reader of IFC and a writer of postGIS, but then instead of saving 3D data - I get only 2D.

 

When I tried changing the geometry type to geometryZ - I get "Error geometry type parsing"

 

I tried to convert first to GML, and from GML to save to postGIS, but that also didn't work.

 

I would appreciate some help here

Thanks,

Elyran

 

 

icon

Best answer by elyrankogan 7 August 2022, 18:17

View original

5 replies

Userlevel 2
Badge +9

Hi @elyrankogan​ PostGIS supports the Solid type of FME, so this should be compatible. Do you have a copy of the full log file, as well as your workspace? You might need to try using the GeometryCoercer to get the geometry type correct before writing to PostGIS. I recommend taking a look at this other community post which has some ideas on how to get this working correctly: https://community.safe.com/s/question/0D54Q000080heKrSAI/write-an-ifc-in-postgres-with-postgis-extension

I tried working with the GeometryCoercer but it did not work, it would either create invalid objects or doesn't do anything.

I saw the post before posting here, it didn't help me at all.

 

I only managed to save the data as multilineString but then it doesn't look the same as it was in ifc, and I cannot run many functions on it - like st_volume.

and also - st_isValid returns false.

when I used the GeometryCoercer to polygon I got:

Query 1 ERROR: ERROR: MultiPolygon is invalid : Polygon 0 is invalid: points don't lie in the same plane 

or:

Query 1 ERROR: ERROR: MultiPolygon is invalid : intersection between Polygon 0 and 1

 

 

Userlevel 2
Badge +9

I tried working with the GeometryCoercer but it did not work, it would either create invalid objects or doesn't do anything.

I saw the post before posting here, it didn't help me at all.

 

I only managed to save the data as multilineString but then it doesn't look the same as it was in ifc, and I cannot run many functions on it - like st_volume.

and also - st_isValid returns false.

when I used the GeometryCoercer to polygon I got:

Query 1 ERROR: ERROR: MultiPolygon is invalid : Polygon 0 is invalid: points don't lie in the same plane 

or:

Query 1 ERROR: ERROR: MultiPolygon is invalid : intersection between Polygon 0 and 1

 

 

@elyrankogan​ I managed to get my IFC to PostGIS conversion working by using a CoordinateSystemRemover on my data before writing it to PostGIS. You could try this on your workspace and see if this helps. If you're still having issues could you share your IFC file and log file with us? If you don't want to share you data publicly, you can upload it to our Safe Software FTP.

image

@elyrankogan​ I managed to get my IFC to PostGIS conversion working by using a CoordinateSystemRemover on my data before writing it to PostGIS. You could try this on your workspace and see if this helps. If you're still having issues could you share your IFC file and log file with us? If you don't want to share you data publicly, you can upload it to our Safe Software FTP.

image

I uploaded the files to the ftp with the prefix of elyran_

I tried using the CoordinateSystemRemover, but it didn't change much.

@elyrankogan​ I managed to get my IFC to PostGIS conversion working by using a CoordinateSystemRemover on my data before writing it to PostGIS. You could try this on your workspace and see if this helps. If you're still having issues could you share your IFC file and log file with us? If you don't want to share you data publicly, you can upload it to our Safe Software FTP.

image

I managed to get it working!

it turns out there were two problems -

  1. the client I used had a bug and didn't display the value of PolyhedralSurfaceZ and displayed and error instead: 'Error geometry type parsing'.
  2. I needed to extract the data from the collection

 

So in the end - in order to fix it I used a GeometryPartExtractor in order to extract from the collection and use only the parts I need,

then I used the AttributeFilter to get only the parts that are relevant to me,

and then I saved it in postGIS with the PolyhedralSurfaceZ type.

 

Reply