nhueffme: thuban/Extensions/ogr ogrshapes.py, NONE, 1.1 ogrstart.py, NONE, 1.1
Bernhard Herzog
bh at intevation.de
Fri Dec 10 22:14:19 CET 2004
cvs at intevation.de writes:
> --- NEW FILE: ogrshapes.py ---
line 29f:
# Raw data in ogr format
RAW_OGRSHAPES = "RAW_OGRSHAPES"
What do we need that for? We don't have a low-level renderer for OGR
yet, so it might be best to simply use RAW_PYTHON for now.
line 170 (doc string of ShapesInRegion)
The method GetFID() returns feature IDs starting from 0. In Thuban feature IDs start with 1.
If "Thuban feature IDs" means e.g. the shapeids in shape files or the
ids of shapes read from a postgis database then that's wrong. The only
thing Thuban assumes about shape ids is that they're integers.
Also, ogr's feature ids probably don't start at 0 either, I would guess.
lines 290ff
def RowIdToOrdinal(self, gid):
"""Return the row ordinal given its id"""
return self.layer.GetFeature(gid).GetFID()
def RowOrdinalToId(self, num):
"""Return the rowid for given its ordinal"""
return self.layer.GetFeature(num).GetFID()
At most one of these can be correct. In fact they're probably both
wrong. If a table is to be shown in the table view, we need to have a
way to convert from the row-number as used by the wxGrid to the row id
so that we can get the corresponding data from the table. The row
number is an int 0 <= N < table.NumRows(). The row id is the same as
the shape-id for tables that contain the attributes for a shape store.
The methods RowOrdinalToId and RowIdToOrdinal convert between these two
kinds of ways to identify a row in a table.
> --- NEW FILE: ogrstart.py ---
line 36ff:
if hasattr(canvas, "export_path"):
export_path = canvas.export_path
else:
export_path="."
Please don't use the export_path. It's a kludge which makes some sense
in the svg extension, but unless there's a very good reason, it should
not be used for anything else until we have a real mechanism for that
kind of thing. Even then, I doubt you really would want to use it here.
Bernhard
--
Intevation GmbH http://intevation.de/
Skencil http://skencil.org/
Thuban http://thuban.intevation.org/
More information about the Thuban-devel
mailing list
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)