Problem using OGR VRT data

Frank Warmerdam warmerdam at POBOX.COM
Wed Aug 11 11:55:52 PDT 2004


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.

Matthew,

The SELECT statement you reference is normal with the ODBC driver. If it
finds a GEOMETRY_COLUMNS table it will try to define a set of spatial layers
based on that table rather than the list of all tables (or a list provided in
the dataset name).  I don't know where the "limit 136662716" part is coming
from.  I can't see anything in my code that generates that.  Perhaps something
in the ODBC middle where adds it?

As for why things are working with ogrinfo, and not within MapServer, I
really don't know.  All the "usual" reasons could apply:
  o did you *really* rebuild MapServer with the new OGR?  Replacing the
    DLL is not sufficient.
  o Are you sure you understand all the ODBC and file permissions issues involved?
  o Are you sure the .ovf file is even being found?
  o Are you sure you are escaping things properly in the .ovf file?  ie. Does the
    ovf file work properly with ogrinfo or just the direct ODBC connection?

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the MapServer-users mailing list