[postgis-users] Unknown geometry type: 12 - MultiSurface

727 views
Skip to first unread message

James Klassen

unread,
Apr 21, 2017, 2:59:07 PM4/21/17
to postgi...@lists.osgeo.org
I have been getting "ERROR: Unknown geometry type: 12 - MultiSurface" on some operations since importing a File GeoDatabase containing curved geometries into PostGIS using a recent OGR (2.2.0dev trunk@37918).  Using ST_CurveToLine(geom) instead or the original curved geometry is a work around, but it would be desirable to directly use the original geometry if possible.  Is this the expected behavior?

I am running PostgreSQL 9.5.5/PostGIS 2.2.2 from http://apt.postgresql.org/pub/repos/apt/ on Ubuntu 12.04.

It is unclear to me from the documentation if Curved geometries are generally supported or only with a few specific functions.  I have found some references to "Unknown geometry type" errors from long ago that reference closed tickets against PostGIS 1.x and a Stack Exchange question "Smallworld > FME > PostGIS > QGIS" that seems similar but different.

Steps to reproduce:

SELECT version();
                                                version                                               
-------------------------------------------------------------------------------------------------------
 PostgreSQL 9.5.5 on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 64-bit
(1 row)

SELECT postgis_full_version();
                                                                        postgis_full_version                                                                       
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
 POSTGIS="2.2.2 r14797" GEOS="3.3.3-CAPI-1.7.4" PROJ="Rel. 4.7.1, 23 September 2009" GDAL="GDAL 1.9.0, released 2011/12/29" LIBXML="2.7.8" LIBJSON="UNKNOWN" RASTER
(1 row)

-- Operations fail with MultiSurface
select ST_IsValid(
 ST_GeomFromEWKT(
  'MULTISURFACE(((563145 151701,563144 151530,
                  563106 151523,563107 151701,
                  563145 151701)))'
 )
);
psql:postgis-multisurface.sql:12: ERROR:  Unknown geometry type: 12 - MultiSurface



select ST_Intersects(
 ST_GeomFromEWKT(
  'MULTISURFACE(((563145 151701,563144 151530,
                  563106 151523,563107 151701,
                  563145 151701)))'
 ),
 ST_GeomFromEWKT(
   'POLYGON((0 0, 600000 180000, 600000 0, 0 0))'
 )
);
psql:postgis-multisurface.sql:23: ERROR:  Unknown geometry type: 12 - MultiSurface
CONTEXT:  SQL function "st_intersects" statement 1



-- It works with ST_CurveToLine
select ST_IsValid(
 ST_CurveToLine(ST_GeomFromEWKT(
  'MULTISURFACE(((563145 151701,563144 151530,
                  563106 151523,563107 151701,
                  563145 151701)))'
 ))
);
 st_isvalid
------------
 t
(1 row)


select ST_Intersects(
 ST_CurveToLine(ST_GeomFromEWKT(
  'MULTISURFACE(((563145 151701,563144 151530,
                  563106 151523,563107 151701,
                  563145 151701)))'
 )),
 ST_GeomFromEWKT(
   'POLYGON((0 0, 600000 180000, 600000 0, 0 0))'
 )
);
 st_intersects
---------------
 t
(1 row)


Mike Toews

unread,
Apr 23, 2017, 10:32:40 PM4/23/17
to PostGIS Users Discussion
The list of functions that are supported for polyhedral surface
geometries are documented for PostGIS 2.2 here:
https://postgis.net/docs/manual-2.2/PostGIS_Special_Functions_Index.html#PostGIS_PS_GeometryFunctions

So, for instance, try replacing ST_Intersects with ST_3DIntersects,
and your example should work.

Many of the functions were written before curve support, which is why
you may see a generic-looking "unknown geometry type" error.

On 22 April 2017 at 06:59, James Klassen <klass...@gmail.com> wrote:
> I have been getting "ERROR: Unknown geometry type: 12 - MultiSurface" on
> some operations since importing a File GeoDatabase containing curved
> geometries into PostGIS using a recent OGR (2.2.0dev trunk@37918). Using
> ST_CurveToLine(geom) instead or the original curved geometry is a work
> around, but it would be desirable to directly use the original geometry if
> possible. Is this the expected behavior?
>
> I am running PostgreSQL 9.5.5/PostGIS 2.2.2 from
> http://apt.postgresql.org/pub/repos/apt/ on Ubuntu 12.04.
>
> It is unclear to me from the documentation if Curved geometries are
> generally supported or only with a few specific functions. I have found
> some references to "Unknown geometry type" errors from long ago that
> reference closed tickets against PostGIS 1.x and a Stack Exchange question
> "Smallworld > FME > PostGIS > QGIS" that seems similar but different.

_______________________________________________
postgis-users mailing list
postgi...@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/postgis-users

Jim Klassen

unread,
Apr 24, 2017, 12:50:56 PM4/24/17
to postgi...@lists.osgeo.org
Thanks, that works. I wouldn't have guessed to try the 3D functions for
support of 2D curves. Also, good to know that information is available
in Ch 14. I didn't realize I needed to think of Intersects as "Special"
depending on geometry type.
Reply all
Reply to author
Forward
0 new messages