private int getPolyHedralSurfaceSize(PolyHedralSurface geom) {
   int size = ByteBuffer.UINT_SIZE;
   for (int i = 0; i < geom.getNumPatches(); i++) {
     size += getPolygonSize(geom.getPatchN(i));
   }
   return size;
 }
 @Override
 public void visit(PolyHedralSurface geom) {
   writeByteOrder(output);
   DimensionalFlag dimension = DimensionalFlag.valueOf(geom.is3D(), geom.isMeasured());
   writeTypeCodeAndSrid(geom, dimension, output);
   output.putUInt(geom.getNumPatches());
   for (Polygon pg : geom) {
     pg.accept(this);
   }
 }