Skip to Content

directement avec PostGIS

  1. >>> polys = testpoly._connection.queryAll("""SELECT Srid(the_geom), AsText(the_geom) FROM testpoly""")
  2. >>> polys
  3. [(4326, 'POLYGON((0.09094470046083 0.807557603686636,0.141635944700461 0.80147465437788,0.360622119815668 0.702119815668203,0.240990783410138 0.548018433179723,0.086889400921659 0.584516129032258,0.054447004608295 0.742672811059908,0.09094470046083 0.807557603686636))'),[...]')]
  4. >>> polys[0][1]
  5. 'POLYGON((0.09094470046083 0.807557603686636,0.141635944700461 0.80147465437788,0.360622119815668 0.702119815668203,0.240990783410138 0.548018433179723,0.086889400921659 0.584516129032258,0.054447004608295 0.742672811059908,0.09094470046083 0.807557603686636))'
  6. # et donc
  7. b = loads(polys[0][1]]