[gdal-dev] PGeo driver errors
Ryk DeYoe
rdeyoe at clarksville.com
Mon Jan 14 15:31:27 EST 2008
I'm using the PGeo driver to try to read some ESRI geodatabases to feed
Mapserver. I'm running Ubuntu Edgy. The standard Ubuntu gdal didn't have
PGeo compiled in so I've compiled gdal 1.3.1 (to match the Ubuntu libs) with
PGeo. I've created the necessary ODBC connections to the mdb files. I also
have the standard mdb-tools package installed. I'm getting a "stack
smashing detected" error when trying to read the layers from the mdb file.
I think I've narrowed it down to reading the SRTEXT field from the
GDB_SpatialRefs table. If i put dummy values in the field, it will read the
tables and give me layers but of course, the SRS is completely wrong. I've
compiled gdal with stack protection turned off and then it just segfaults...
I have two ODBC sources: mdbcrash is the original mdb files in our GIS. The
mdbtest source is the exact same file with dummy values in the SRTEXT field.
/*---------On the original mdbcrash source------------
user at gis:~# ogrinfo PGeo:mdbcrash
*** stack smashing detected ***: ogrinfo terminated
Aborted
/*---------On the modified mdbtest source------------
user at gis:~# ogrinfo PGeo:mdbtest
ERROR 1: importFromWKT() failed on SRS 'dummy srtext1'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext2'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext3'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext2'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext4'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext5'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext6'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext7'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext8'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext9'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext10'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext1'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext7'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext7'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext7'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext7'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext7'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext11'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext11'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext11'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext11'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext11'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext11'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext11'.
ERROR 1: importFromWKT() failed on SRS 'dummy srtext12'.
INFO: Open of `PGeo:mdbtest'
using driver `PGeo' successful.
1: ww_val_shts
2: ww_treatment_plant
3: ww_pmp_arnd_ports (Point)
4: ww_plug (Point)
5: ww_ovrflw_wtrshd
6: ww_monitorpoints (Point)
7: ww_low_pressure_system (Point)
8: ww_laterals (Line String)
9: ww_cso (Point)
10: ww_cleanout (Point)
11: ww_chemical_feed_site (Point)
12: ww_basin
13: ww_sub_basin
14: ww_pump_station (Point)
15: ww_valves (Point)
16: ww_gravity_sewer (Line String)
17: ww_force_main (Line String)
18: T_1_DirtyAreas
19: T_1_PointErrors (Point)
20: T_1_LineErrors (Line String)
21: T_1_PolyErrors
22: Forcemain_Junctions (Point)
23: ww_manhole (Point)
24: gravity_sewer_Junctions (Point)
25: FlowMeter (Point)
----------------------------------------------------------
The SRTEXT field in the crashing file contains:
PROJCS["NAD_1983_StatePlane_Tennessee_FIPS_4100_Feet",GEOGCS["GCS_North_Amer
ican_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137.0,298.2
57222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJEC
TION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",1968500.0],PARAMET
ER["False_Northing",0.0],PARAMETER["Central_Meridian",-86.0],PARAMETER["Stan
dard_Parallel_1",35.25],PARAMETER["Standard_Parallel_2",36.41666666666666],P
ARAMETER["Latitude_Of_Origin",34.33333333333334],UNIT["Foot_US",0.3048006096
012192]]
The SRTEXT field in the modified file just has "dummy srtext" and the row
number of the record.
--------------------------------------------------------
odbc.ini:
[mdbtest]
Description=Sample PGeo Database
Driver=MDBDriver
Database=/tmp/good_sewer.mdb
#Host =
Port=5432
#User =
#Password =
Trace=Yes
TraceFile=/var/log/odbc.log
Debug=yes
DebugFile=/var/log/odbc.dbg
[mdbcrash]
Description=Sample PGeo Database
Driver=MDBDriver
Database=/tmp/bad_sewer.mdb
#Host =
Port=5432
#User =
#Password =
Trace=Yes
TraceFile=/var/log/odbc.log
Debug=yes
DebugFile=/var/log/odbc.dbg
-----------------------------------------------------
I have an sql.log file tracing the odbc calls. Looks ok until it starts
selecting the srtext values. I'm not sure but the buffer length seems to be
set to 511 where my srtext string is 542 in length. Could this be the
problem? And where can I increase this value?....in the ODBC source?...or
in gdal? (I've downloaded the odbc source just in case i have to rebuild)
[ODBC][21774][SQLAllocHandle.c][523]
Entry:
Handle Type = 3
Input Handle = 0x804e658
[ODBC][21774][SQLAllocHandle.c][1058]
Exit:[SQL_SUCCESS]
Output Handle = 0x8088bc0
[ODBC][21774][SQLExecDirect.c][236]
Entry:
Statement = 0x8088bc0
SQL = [SELECT srtext FROM GDB_SpatialRefs WHERE srid
= 1][length = 49 (SQL_NTS)]
[ODBC][21774][SQLExecDirect.c][499]
Exit:[SQL_SUCCESS]
[ODBC][21774][SQLNumResultCols.c][149]
Entry:
Statement = 0x8088bc0
Column Count = 0xbffb8dc0
[ODBC][21774][SQLNumResultCols.c][234]
Exit:[SQL_SUCCESS]
Count = 0xbffb8dc0 -> 1
[ODBC][21774][SQLDescribeCol.c][231]
Entry:
Statement = 0x8088bc0
Column Number = 1
Column Name = 0xbffb8c58
Buffer Length = 256
Name Length = 0xbffb8c56
Data Type = 0x80879a0
Column Size = 0x8087a58
Decimal Digits = 0x80880f0
Nullable = 0x8087b68
[ODBC][21774][SQLDescribeCol.c][474]
Exit:[SQL_SUCCESS]
Column Name = Indicator = -18715
Data Type = 0x80879a0 -> -1
Column Size = 0x8087a58 -> 0
Decimal Digits = 0x80880f0 -> 0
Nullable = 0x8087b68 -> 1
[ODBC][21774][SQLFetch.c][158]
Entry:
Statement = 0x8088bc0
[ODBC][21774][SQLFetch.c][340]
Exit:[SQL_SUCCESS]
[ODBC][21774][SQLGetData.c][230]
Entry:
Statement = 0x8088bc0
Column Number = 1
Target Type = 1 SQL_CHAR
Buffer Length = 511
Target Value = 0xbffb8b78
StrLen Or Ind = 0xbffb8b5c
[ODBC][21774][SQLGetData.c][494]
Exit:[SQL_SUCCESS]
Buffer =
[PROJCS["NAD_1983_StatePlane_Tennessee_FIPS_4100_Feet",GEOGCS["GCS_North_Ame
rican_1983",D
ATUM["D_North_American_1983",SPHEROID["G]
Strlen Or Ind = 0xbffb8b5c -> 12
-------------------- That's where it
stops ------------------------------------
Everything else with gdal seems to run great. Shape files aren't a problem
but our GIS department doesn't update the shape files anymore....they work
in the geodatabases exclusively now. Our geotiff aerial photos look very
nice and the gdaltindex stitched them together pretty simply. I've been
trying to find the place to set the buffer size but not being a programmer
has me at a disadvantage.
Any help or direction is greatly appreciated.
Ryk DeYoe
More information about the gdal-dev
mailing list