@Override
 public void visit(LinearRing geom) {
   writeByteOrder(output);
   DimensionalFlag dimension = DimensionalFlag.valueOf(geom.is3D(), geom.isMeasured());
   writeTypeCodeAndSrid(geom, dimension, output);
   writeRing(geom);
 }
 @Override
 public void visit(GeometryCollection geom) {
   writeByteOrder(output);
   DimensionalFlag dimension = DimensionalFlag.valueOf(geom.is3D(), geom.isMeasured());
   writeTypeCodeAndSrid(geom, dimension, output);
   output.putUInt(geom.getNumGeometries());
 }
 @Override
 public void visit(Point geom) {
   writeByteOrder(output);
   DimensionalFlag dimension = DimensionalFlag.valueOf(geom.is3D(), geom.isMeasured());
   writeTypeCodeAndSrid(geom, dimension, output);
   writePoints(geom.getPoints(), geom.getCoordinateDimension(), output);
 }
 @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);
   }
 }
 @Override
 public void visit(Polygon geom) {
   writeByteOrder(output);
   DimensionalFlag dimension = DimensionalFlag.valueOf(geom.is3D(), geom.isMeasured());
   writeTypeCodeAndSrid(geom, dimension, output);
   writeNumRings(geom, output);
   for (LinearRing ring : geom) {
     writeRing(ring);
   }
 }