[postgis-users] WKT-saving instead of WKB
"Daniela Stärke"
daniela.staerke at gmx.de
Mon Jul 9 02:12:45 PDT 2007
Hi everyone,
I wanted to know if it is possible to save a geometry-column in a database immediately in WKT-format without converting it into WKB automatically.
For instance when I insert the geometry-data I use the sql-command:
insert into tablename ( id, x) values ( 'line', GeometryFromText ( 'LINESTRING (10 20, 20 30, 50 44)', -1));
Then this coordinates are changed/saved in Well-Known-Binary (WKB), or??? But this changing/converting I don't want, because the program (mezogis), which I use to watch the content of the database crashes, when I want to open it.
Which means I get these messages:
Traceback (most recent call last):
File "/usr/local/lib/python2.5/site-packages/mezoGISlib/_guicore.py", line 291, in __goButton
if self.runQuery(query) == True:
File "/usr/local/lib/python2.5/site-packages/mezoGISlib/_guicore.py", line 400, in runQuery
self.showResults(cursor, query, layer, resultset, tablelist)
File "/usr/local/lib/python2.5/site-packages/mezoGISlib/_guicore.py", line 434, in showResults
mapview = openMapView(layer.resultset)
File "/usr/local/lib/python2.5/site-packages/mezoGISlib/_guiwindows.py", line 33, in openMapView
m = MapWindow(resultset)
File "/usr/local/lib/python2.5/site-packages/mezoGISlib/_guiwindows.py", line 139, in __init__
self.canvas = MapCanvas()
File "/usr/local/lib/python2.5/site-packages/mezoGISlib/_canvas.py", line 86, in __init__
self.__createNewCanvas()
File "/usr/local/lib/python2.5/site-packages/mezoGISlib/_canvas.py", line 524, in __createNewCanvas
self.ctx = self.pixmap.cairo_create()
cairo.Error: NULL pointer
and then this, when I want to work with a SQL-command:
SELECT * FROM "public"."geodatenpoint";
Exception in thread Thread-14:
Traceback (most recent call last):
File "/usr/lib/python2.5/threading.py", line 460, in __bootstrap
self.run()
File "/usr/local/lib/python2.5/site-packages/mezoGISlib/_geodata.py", line 465, in run
gtk.gdk.threads_leave()
File "/usr/local/lib/python2.5/site-packages/GeoTypes/_Point.py", line 64, in __init__
or a psycopg cursor."""
ValueError: Second param to __init__ is not a %s
or a psycopg cursor.
I had the impression, that somehow mezogis couldn't convert the WKB back into a "well-known-text" format. Thats why I ask, if it is possible to make an explicit statement, that insert geometry-data is not saved in WKB.
Thanks you for your help in advance
Daniela
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
More information about the postgis-users
mailing list