[Thuban-list] LINESTRING and PostGIS

Stephan Holl sholl at gmx.net
Thu Mar 18 18:07:22 CET 2004


Hello Luiko,

At Thu, 18 Mar 2004 05:02:17 +0100 Luiko Czub wrote:

> > I am trying to access a dataset stored in Postgis which has the
> > GEOMETRY of LINESTRING.
> > I have the same geometries stored in another table with
> > MUTLILINESTRING, which works perfect.
> > 
> 
> With following modification in thuban/Thuban/Model/postgisdb.py , you
> should work with LINESTRINGS. 
> 
> shapetype_map = {"POLYGON": SHAPETYPE_POLYGON,
>                  "MULTIPOLYGON": SHAPETYPE_POLYGON,
>                  "MULTILINESTRING": SHAPETYPE_ARC,
> ## NEW LC 250104 ADD geomtype LINESTRING
>                  "LINESTRING": SHAPETYPE_ARC,
> ## END LC 250104 ADD geomtype LINESTRING
>                  "POINT": SHAPETYPE_POINT}

THanks for this hint. This nearly solves my problem...but now its partly
my fault.
Here is the given output:
Traceback (most recent call last):
  File "/home/steph/cvs/thuban/Thuban/UI/view.py", line 206, in
_do_redraw
    if self.render_iter.next():
  File "/home/steph/cvs/thuban/Thuban/UI/view.py", line 255, in
_render_iterator
    for cont in renderer.RenderMapIncrementally():
  File "/home/steph/cvs/thuban/Thuban/UI/baserenderer.py", line 202, in
render_map_incrementally
    for i in self.draw_shape_layer_incrementally(layer):
  File "/home/steph/cvs/thuban/Thuban/UI/baserenderer.py", line 270, in
draw_shape_layer_incrementally
    for shape in self.layer_shapes(layer):
  File "/home/steph/cvs/thuban/Thuban/Model/postgisdb.py", line 534, in
ShapesInRegion
    cursor.execute("SELECT gid, AsText(%s) FROM %s"
ProgrammingError: ERROR:  Attribut »gid« nicht gefunden

SELECT gid, AsText("wkb_geometry") FROM "roads" WHERE "wkb_geometry" &&
GeometryFromText('POLYGON((3427000.290000 5787098.271461, 3427000.290000
5801372.438539, 3444004.000000 5801372.438539, 3444004.000000
5787098.271461, 3427000.290000 5787098.271461))', 104306) ORDER BY gid

My dataset does not have the "gid"-column, it is named ogc_fid (by
v.out.ogr).
After copying this column to "gid" everything is fine.

I am not quite sure why v.out.ogr does not name a gid-column...

But thanks so far.

Gruß
  Stephan

-- 
Stephan Holl

Check headers for GnuPG Key!
http://www.gdf-hannover.de

 18:00:40 up 54 min,  1 user,  load average: 0.25, 0.16, 0.11
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.intevation.de/pipermail/thuban-list/attachments/20040318/348d9501/attachment.bin


More information about the Thuban-list mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)