I have geometry of buildings in Shapefile MultiPatch format. I want to import it into PostGIS database in the same format.
Is that even possible? If yes, then how?
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
I realize this is quite old but just came across the same issue and wanted to share a solution. Strictly speaking John Powell is right – it can't be the same format because it needs to be converted on import to a PostGIS-supported form. However, using
ogr2ogr you have some control over how this happens:
$ ogr2ogr -f "PostgreSQL" "PG:host=localhost port=5432 user=your_name dbname=db password=pass" "path_to_multipatch.gdb" -lco GEOMETRY_NAME=geom -lco FID=gid -lco PRECISION=no -nln table_name -overwrite will create a PostGIS table with the default MULTIPOLYGON Z geometry type.
-nlt "POLYHEDRALSURFACE Z" you can choose to import as polyhedral surfaces instead, which may be better depending on the use case. I believe this will also work if you want TIN Z, as with James Milner's solution using FME Shapefile to PostGIS.