Unknown geometry type: 12 - MultiSurface

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Unknown geometry type: 12 - MultiSurface

James Klassen
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)



_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|

Re: Unknown geometry type: 12 - MultiSurface

Mike Toews-2
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 <[hidden email]> 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
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users
Reply | Threaded
Open this post in threaded view
|

Re: Unknown geometry type: 12 - MultiSurface

James Klassen
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.

On 04/23/2017 09:31 PM, Mike Toews wrote:

> 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 <[hidden email]> 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
> [hidden email]
> https://lists.osgeo.org/mailman/listinfo/postgis-users


_______________________________________________
postgis-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/postgis-users