[postgis-users] WKT-saving instead of WKB

"Daniela Stärke" daniela.staerke at gmx.de
Mon Jul 9 05:01:16 PDT 2007


OK, I also had the assumption, that on my system is something different, than others have. 
I have on my system the following programs installed:

PostGreSQL: 8.1.5.
PostGis: 1.1.2
PyGTK:  2.10.4
PyGTK2: 2.10.6 
python-gtk: 2.10.3
WxGTK:  2.8.4
GeoTypes: 0.7.0
psycopg2: 2.0.6
python 2.4
python-cairo: 1.2.2
cairo:  1.2.4


A colleague of my had the idea, that mezogis can't create a geographical maps from the binary code of the geomtry-column.
When I use -Select geom from tablename- of the data, which is shown below
I get a table, but I want actually something, which shows me the shape of the geometry.
example of geometry: 
insert into tablename ( id, name) values ( 'line', GeometryFromText (
 'LINESTRING (10 20, 20 30, 50 44)', -1))

btw: ID is serial

Like, when there is a polygon I want to see a polygon and no coordinates of it, because you can't imagine, where these coordinates are, and how the polygon will look like. E.G. how the hexagon, pentagon or so look, if it is not regular. Or in which direction the Linestring shows.

Thanks in advance for your help

Daniela

> i can display this specific line with mezogis, the same i've sent to you
> previously.
> 
> maybe some other software is incompatible with mezogis on your system.
> 
> alex
> 
> Daniela Stärke wrote:
> > 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

-- 
Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: http://www.gmx.net/de/go/browser



More information about the postgis-users mailing list