[postgis-users] WKT-saving instead of WKB
alex bodnaru
alexbodn at 012.net.il
Mon Jul 9 07:27:02 PDT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
hi daniela,
i hardly see differences between your programs and yours: my python is
2.4.4 and python-cairo 1.4.0, but i hardly suspect those.
i'd rather suspect the mezogis version. before sending it to you, i had
to adjust it to support psycopg2 (although i haven't had the failures
you complain of).
if you haven't received the mezogis i've sent you privately, please tell
me and i'll resend.
n.b.
> insert into tablename ( id, name) values ( 'line', GeometryFromText (
> 'LINESTRING (10 20, 20 30, 50 44)', -1))
>
should be
insert into tablename (name, geom) values ( 'line', GeometryFromText (
'LINESTRING (10 20, 20 30, 50 44)', -1))
best regards,
alex
Daniela Stärke wrote:
> 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
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iQCVAwUBRpJFttpwN1sq38njAQIxGwP7B1Z0psf8X9b7IN214z7hb+hfzJbF8J6H
XjF03glY6rNJsIvyRSbEISRd52DFg2eXIUtzZux1hSWqlrddcFuWuVmgtzPtxVG3
kDepArqVwi92ZHWUNY3oGQSZbzBVIfQndQ+c1kniD1vIjUNIznZx7cEIOcVxrS2U
rk9hgf7X8UM=
=PScJ
-----END PGP SIGNATURE-----
More information about the postgis-users
mailing list