def approximate_wkb(wkb_in):
 (input, output) = (StringIO(wkb_in), StringIO())
 approx_geometry(input, output)
 wkb_out = output.getvalue()
 assert (len(wkb_in) == input.tell()), 'The whole WKB was not processed'
 assert (len(wkb_in) == len(wkb_out)), 'The output WKB is the wrong length'
 return wkb_out

def approximate_wkb ( wkb_in ) : ( input , output ) = ( StringIO ( wkb_in ) , StringIO ( ) ) approx_geometry ( input , output ) wkb_out = output . getvalue ( ) assert ( len ( wkb_in ) == input . tell ( ) ) , 'The whole WKB was not processed' assert ( len ( wkb_in ) == len ( wkb_out ) ) , 'The output WKB is the wrong length' return wkb_out
return an approximation of the input wkb with lower-precision geometry .