#NEWLINE# def test_hexewkb( self ) : #NEWLINE# #INDENT# 'Testing (HEX)EWKB output.' #NEWLINE# ogc_hex = b'01010000000000000000000000000000000000F03F' #NEWLINE# ogc_hex_3d = b'01010000800000000000000000000000000000F03F0000000000000040' #NEWLINE# hexewkb_2d = b'0101000020E61000000000000000000000000000000000F03F' #NEWLINE# hexewkb_3d = b'01010000A0E61000000000000000000000000000000000F03F0000000000000040' #NEWLINE# pnt_2d = Point ( 0 , 1 , srid = 4326 ) #NEWLINE# pnt_3d = Point ( 0 , 1 , 2 , srid = 4326 ) #NEWLINE# self . assertEqual ( ogc_hex , pnt_2d . hex ) #NEWLINE# self . assertEqual ( ogc_hex_3d , pnt_3d . hex ) #NEWLINE# self . assertEqual ( hexewkb_2d , pnt_2d . hexewkb ) #NEWLINE# if GEOS_PREPARE : #NEWLINE# #INDENT# self . assertEqual ( hexewkb_3d , pnt_3d . hexewkb ) #NEWLINE# self . assertEqual ( True , GEOSGeometry ( hexewkb_3d ) . hasz ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# hexewkb = pnt_3d . hexewkb #NEWLINE# #UNINDENT# except GEOSException : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . fail ( 'Should have raised GEOSException.' ) #NEWLINE# #UNINDENT# #UNINDENT# self . assertEqual ( memoryview ( a2b_hex ( hexewkb_2d ) ) , pnt_2d . ewkb ) #NEWLINE# if GEOS_PREPARE : #NEWLINE# #INDENT# self . assertEqual ( memoryview ( a2b_hex ( pnt_2d ) ) , pnt_3d . ewkb ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# ewkb = pnt_3d . ewkb #NEWLINE# #UNINDENT# except GEOSException : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . fail ( 'Should have raised GEOSException' ) #NEWLINE# #UNINDENT# #UNINDENT# self . assertEqual ( 4326 , GEOSGeometry ( hexewkb_2d ) . srid )