Advertisement
Guest User

Untitled

a guest
Nov 7th, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.09 KB | None | 0 0
  1. from shapely import geos
  2. import binascii
  3. geos.WKBWriter.defaults['include_srid'] = True
  4. from shapely import wkb
  5.  
  6. connection = pymysql.connect(host=***,
  7. user=***,
  8. password=***,
  9. db=***
  10. )
  11.  
  12. df = pd.read_sql_query('SELECT geometry, building_count, created_at FROM boundaries LIMIT 10', con=connection)
  13. df.head(3)
  14.  
  15. geometry building_count created_at
  16. 0 �t+~��}R�)�ǺD@�ʡE�}R�'�UH�]... 2892 2011-03-24 01:59:15
  17. 1 �.�o�}R�R�8�cD@�'�X}R��ǵ�bd... 1317 2011-03-30 15:02:45
  18. 2 �r-��燎R�����]D@{�/L��R��?�Ŋ^D@... 5810 2011-03-30 23:05:02
  19.  
  20.  
  21.  
  22. z = df.loc[0, 'geometry']
  23. zh = z.encode('hex')
  24. zh
  25.  
  26. 'e6100000010300000001000000090000002b137ea99f7d52c029cb10c7ba5c4440c1caa145b67d52c027da5548f95d444081b22957787d52c0d1e80e62675e44403a92cb7f487d52c0ad86c43d965e4440c959d8d30e7d52c0ca54c1a8a45e4440bc3fdeab567c52c075594c6c3e5e4440aa436e861b7c52c07767edb60b5d444094a46b26df7c52c09bc937dbdc5c44402b137ea99f7d52c029cb10c7ba5c4440'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement