Round-tripping geometries through hex-encoded binary
====================================================

Hex-encoded binary is the PostGIS geometry representation, and so this is a
test of the ability to store Shapely geometries in PostGIS.

Point
-----

  >>> from shapely.geometry import Point
  >>> point = Point(0.0, 0.0)
  >>> import binascii
  >>> x = binascii.b2a_hex(point.wkb)
  >>> from shapely import wkb
  >>> shape = wkb.loads(binascii.a2b_hex(x))
  >>> shape # doctest: +ELLIPSIS
  <shapely.geometry.point.Point object at ...>

LineString
----------

  >>> from shapely.geometry import LineString
  >>> line = LineString(((0.0, 0.0), (1.0, 1.0)))
  >>> x = binascii.b2a_hex(line.wkb)
  >>> shape = wkb.loads(binascii.a2b_hex(x))
  >>> shape # doctest: +ELLIPSIS
  <shapely.geometry.linestring.LineString object at ...>

Polygon
----------

  >>> from shapely.geometry import Polygon
  >>> polygon = Polygon(((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0)))
  >>> x = binascii.b2a_hex(polygon.wkb)
  >>> shape = wkb.loads(binascii.a2b_hex(x))
  >>> shape # doctest: +ELLIPSIS
  <shapely.geometry.polygon.Polygon object at ...>

Polygon with hole
-----------------

  >>> polygon = Polygon(((0.0, 0.0), (0.0, 1.0), (1.0, 1.0), (1.0, 0.0)), [((0.1,0.1), (0.1,0.2), (0.2,0.2), (0.2,0.1))])
  >>> x = binascii.b2a_hex(polygon.wkb)
  >>> shape = wkb.loads(binascii.a2b_hex(x))
  >>> shape # doctest: +ELLIPSIS
  <shapely.geometry.polygon.Polygon object at ...>

