0

I am using PostGIS (PostGIS 2.2.0 with SFCGAL extension) and I have data in postgres which is loaded using citygml2psql tool and it contains polyhedralSurface geometry.

But when i run query :

SELECT "gid",ST_AsGeoJSON(ST_Transform("geom"::geometry,3946),0, 1) AS "geom"  FROM "public"."citygml"

in pgadmin3 it gives an error :

ERROR:  lwgeom_to_geojson: 'PolyhedralSurface' geometry type not supported
********** Error **********
ERROR: lwgeom_to_geojson: 'PolyhedralSurface' geometry type not supported
SQL state: XX000

I found one question related to this here : GeoJSON: PolyhedralSurface geometry type not supported

But i want some fix for postgis as I can't change my query and need data in GeoJSON.

1
  • What OS, did you build from source, etc, etc. More details please. May 12, 2016 at 14:01

2 Answers 2

2

The error message and specifications are pretty clear:

GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, and MultiPolygon.

PolyhedralSurface is not in that list, so you'll need to convert it to another geometry type.

2
  • 1
    How can i convert PolyhedralSurface geometry into polygon or MultiPolygon for my above query.
    – vinni
    May 13, 2016 at 6:40
  • There is no equivalent GeoJSON geometry type, which is why the conversion is not supported! Try using ST_Dump and/or ST_GeometryN to extract part(s) to [Multi]Polygons, which can be converted to GeoJSON.
    – Mike T
    May 13, 2016 at 7:14
-1

If anybody came across this error please read this. I was able to solve this using this info.

1
  • Link is dead and gone, you really should have posted the info here so it was kept alive :} Aug 3 at 21:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.