[DB-SIG] thoughts about OpenGIS extensions
Mario Frasca
mfrasca at zonnet.nl
Tue Oct 3 17:24:25 CEST 2006
just a note about parsing points, which worked...
>>> import GeoTypes
...
>>> cr.execute("select asBinary(geomFromText('POINT(34214.3412 34214.3412)'))")
1L
>>> obj = cr.fetchone()[0]
>>> obj
'\x01\x01\x00\x00\x00-C\x1c\xeb\xca\xb4\xe0 at -C\x1c\xeb\xca\xb4\xe0@'
>>> cr.execute("select geomFromText('POINT(34214.3412 34214.3412)')")
1L
>>> obj = cr.fetchone()[0]
>>> obj
'\x00\x00\x00\x00\x01\x01\x00\x00\x00-C\x1c\xeb\xca\xb4\xe0 at -C\x1c\xeb\xca\xb4\xe0@'
>>> obj[4:]
'\x01\x01\x00\x00\x00-C\x1c\xeb\xca\xb4\xe0 at -C\x1c\xeb\xca\xb4\xe0@'
>>> g = GeoTypes.OGGeoTypeFactory()
>>> p = GeoTypes.WKBParser(g)
>>> p.parseGeometry(obj[4:])
>>> g.getGeometry()
34214.341200 34214.341200
>>>
tried to parse polygons, but 17:30 is too late for clear thought...
a domani (I'll be reading you tomorrow),
Mario
--
Die Welt wird nicht bedroht von den Menschen, die böse sind, sondern
von denen, die das Böse zulassen
-- Albert Einstein
More information about the DB-SIG
mailing list