Problem using OGR VRT data
Matthew Holger
mholger at OPTERA.NET
Thu Aug 12 11:27:59 PDT 2004
I have managed to solve my problems in regards to this issue...unfortunately,
there's no "quick" fix or explanation, but here's as much of a summary as I
can provide at the moment (silly me, didn't document what I did or how many
times, but this should get you going):
The system is an Intel x86 box running Debian 3.0 ("sarge" as it were). I
had installed unixodbc, MySQL, and the associated MyODBC software via Debian's
packages, built gdal-1.2.1 (including OGR) from source, and then built
mapserver 4.2.2 from source.
Tracing back through where things were breaking, I ended up removing the
Debian unixodbc and building unixODBC-2.2.9 from source. Included with
unixODBC-2.2.9 is MyODBC v3.51, which unfortunately, doesn't compile out of
the box. There was a spurious line of "garbage" at the very top of
catalog.c that needed to be removed, and a reference to
dbc->mysql.net.timeout, to which the compiler complains about 'timeout' not
being an existing member of the structure. I just commented that whole block
out. Once I had unixODBC installed (in /usr/local), and MyODBC installed
(again in /usr/local), I copied my odbc.ini and odbcinst.ini files from /etc
to /usr/local/etc, and changed the references in odbcinst.ini from:
Driver = /usr/lib/odbc/libmyodbc.so
Setup = /usr/lib/odbc/libodbcmyS.so
to:
Driver = /usr/local/lib/libmyodbc3.so
Setup = /usr/local/lib/libodbcmyS.so
I made sure to run ldconfig after building/installing unixODBC, again after
building/installing MyODBC, then rebuilt gdal-1.2.1, ldconfig, and rebuilt
mapserv. *poof* -- ODBC/VRT using OGR under mapserv works flawlessly!
During my testing, I found that it probably wasn't necessary to rebuild gdal
or mapserv after replacing libraries and running ldconfig, but it never
hurts...
Cheers!
-Matt.
On Wed, Aug 11, 2004 at 11:58:08AM -0500, Matthew Holger wrote:
> I've been trying to get an OGR VRT layer to work under mapserver 4.2.2, but I
> keep running into trouble.
>
> Using ogrinfo to view the individual layers specified in my .ovf file, I have
> no problems, but when trying to access the data with mapserver I get an
> internal server error, with no diagnostics in my Apache error logs, and the
> only thing seen in my apache trace logs being a query for geometry_columns
> (which I created by finessing the shp2mysql.pl script, using ogr2ogr to dump
> the layer using the ovf file to a shape file, then reimporting the shapefile,
> finessing the newly create geometry_columns table, then dropping the other
> tables created by shp2mysql). Messy, but it worked...
>
> (The specific query I see is:
> SELECT f_table_name, f_geometry_column, geometry_type FROM geometry_columns
> limit 136662716
> But...the last number (136662716) changes from time to time...)
>
> What I find curious is that the geometry_columns table isn't referenced by
> ogrinfo, and in the mapserver source I only see it referenced in MyGIS and
> PostGIS, of which I'm using neither.
>
> Anyone have any thoughts? I've been banging my head on this one for awhile.
>
> The OVF file reads as follows:
> <OGRVRTDataSource>
> <OGRVRTLayer name="Geocaches">
> <SrcDataSource>ODBC:webuser/tItb2Ur!@Keyori</SrcDataSource>
> <SrcLayer>Waypoints</SrcLayer>
> <GeometryType>wkbPoint</GeometryType>
> <LayerSRS>WGS84</LayerSRS>
> <GeometryField encoding="PointFromColumns" x="longitude"
> y="latitude"/>
> </OGRVRTLayer>
>
> <OGRVRTLayer name="zipcodes">
> <SrcDataSource>ODBC:mholger/ph1r3d at Keyori</SrcDataSource>
> <SrcLayer>ZipTable</SrcLayer>
> <GeometryType>wkbPoint</GeometryType>
> <LayerSRS>WGS84</LayerSRS>
> <GeometryField encoding="PointFromColumns" x="lon" y="lat"/>
> </OGRVRTLayer>
> </OGRVRTDataSource>
>
>
> The layer in the MAP file is:
> LAYER
> NAME caches
> TYPE point
> CONNECTIONTYPE OGR
> CONNECTION "keyori.ovf"
> DATA Geocaches
> STATUS on
> PROJECTION
> "init=epsg:4326"
> END
> CLASS
> SYMBOL "triangle"
> SIZE 5
> COLOR 128 45 45
> END
> END
>
> there are several other layers in the map file as well, but they work
> flawlessly, and the problem only arises when the status for this layer is set
> to 'on' or 'default' (ie: I turn it off, everything works fine).
>
> mapserv -v says:
> MapServer version 4.2.2 OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP SUPPORTS=PROJ
> SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
> SUPPORTS=WFS_CLIENT INPUT=EPPL7 INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
>
> And of course, GDAL/OGR was compiled with ODBC support, and works fine in and
> of itself....
>
> Thanks in advance for any assistance!
>
> Cheers!
> -Matt.
> --
> _
> Matthew Holger (mholger at optera.net) || ASCII ribbon campaign ( )
> Unix Systems Administrator || against HTML Email X
> http://www.Optera.NET/ :: m:651.271.3248 || http://arc.pasp.de/ / \
--
_
Matthew Holger (mholger at optera.net) || ASCII ribbon campaign ( )
Unix Systems Administrator || against HTML Email X
http://www.Optera.NET/ :: m:651.271.3248 || http://arc.pasp.de/ / \
More information about the MapServer-users
mailing list