OGR virtual spatial data

Bart van den Eijnden BEN at SYNCERA-ITSOLUTIONS.NL
Thu Sep 8 07:47:27 EDT 2005


Hi Tom,

yes you're correct, GDAL 1.3.0 will pass the X and Y values as a WHERE clause to the database. Make sure you do create indexes on them in the database.

The ovf syntax you use will try to read out all tables from your database. I never got the ODBC driver not to read out all tables and just use the table specified (Frank does have an option in there which should work).

I personally like to compile GDAL against the MySQL client and use the following syntax in the ovf file (see attachment). This won't scan the database for tables.

Best regards,
Bart

Bart van den Eijnden
Syncera IT Solutions
Postbus 270
2600 AG  DELFT

tel.nr.: 015-7512436
email: BEN at Syncera-ITSolutions.nl

>>> "Kralidis,Tom [Burlington]" <Tom.Kralidis at ec.gc.ca> 09/08/05 1:40 pm >>>

Thanks Bart.  I'll upgrade to the GDAL 1.3.0 and test again.

As far as the ovf file syntax:

<OGRVRTDataSource>
    <OGRVRTLayer name="somelayer">
        <SrcDataSource>ODBC:u/p at foo</SrcDataSource>
        <SrcLayer>somelayer</SrcLayer>
        <GeometryType>wkbPoint</GeometryType>
        <LayerSRS>WGS84</LayerSRS>
        <GeometryField encoding="PointFromColumns" x="x" y="y"/>
    </OGRVRTLayer>
</OGRVRTDataSource>

So I'm assuming newer versions of GDAL will pass the spatial filter
(from WMS, mapserv CGI, shp2img -e etc.) and apply them to the WHERE
clause to emulate a bbox filter?

..Tom



> -----Original Message-----
> From: UMN MapServer Users List 
> [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On Behalf Of Bart van 
> den Eijnden
> Sent: Thursday, 08 September, 2005 02:03
> To: MAPSERVER-USERS at LISTS.UMN.EDU 
> Subject: Re: [UMN_MAPSERVER-USERS] OGR virtual spatial data
> 
> 
> Tom,
> 
> this depends on your GDAL version. A few months ago Frank did 
> an enhancement for us which added the X and Y columns to the 
> WHERE clause. Before that, yes, all records were fetched.
> 
> Also, depending on your ovf file syntax, the driver might get 
> a list of all the tables in the database. I don't know if 
> your schema has many tables in there?
> 
> Best regards,
> Bart
> 
> Bart van den Eijnden
> Syncera IT Solutions
> Postbus 270
> 2600 AG  DELFT
> 
> tel.nr.: 015-7512436
> email: BEN at Syncera-ITSolutions.nl 
> 
> >>> "Kralidis,Tom [Burlington]" <Tom.Kralidis at EC.GC.CA> 
> 09/08/05 1:13 am 
> >>> >>>
> Hi,
> 
> I have a MySQL table which I'm connecting to via OGR's 
> virtual spatial data option and unixODBC.  The table has ~ 2 
> million records with x and y columns.  I have setup an .ovf 
> and mapfile accordingly.
> 
> When I run shp2img, CPU usage spikes up to 100% and then a 
> core dump results.  I am running shp2img with an extent which 
> will result in far less records.
> 
> Any idea what's going on here?  Are all the records being 
> fetched BEFORE the spatial filtering by shp2img?
> 
> Thanks
> 
> ..Tom
> 
> =========================
> Tom Kralidis
> Senior Systems Scientist
> Environment Canada
> Tel: +01-905-336-4409
> http://www.ec.gc.ca/ 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: bedrijven_mysqlclient.ovf
Type: application/octet-stream
Size: 413 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapserver-users/attachments/20050908/fe7cd2f1/bedrijven_mysqlclient.obj


More information about the mapserver-users mailing list