[gdal-dev] Re: [mapserver-users] Investigating OpenLayers ->
MapServer (WMS) -> OGR -> db
Frank Warmerdam
warmerdam at pobox.com
Sun Apr 20 08:58:37 EDT 2008
P Kishor wrote:
> My issue is simple -- OpenLayers is sending a CGI query (whether
> asking mapserv to respond via CGI or via WMS, I am calling it a CGI
> query as it is a query via http). That query string has a param called
> BBOX (in the case of OpenLayers.Layer.WMS) or mapext (in the case of
> OpenLayers.Layer.MapServer). All I am interested is in the bit of code
> that MapServer runs via its OGR driver to extract the data. Since my
> DATA string says "SELECT wkt_geometry FROM database", it seems to me
> that MapServer is extracting all the rows for every tile that
> OpenLayers is requesting. If that is true, that would be very
> inefficient. If that is not true, what exactly is MapServer
> extracting?
Puneet,
That is true. OGR does not use any spatial indexing for sqlite at this
time. It just reads all the rows and discards those that don't match the
current spatial query.
> This must be specified somewhere in the code for MapServer/OGR
> connection, because, I am assuming, OpenLayers doesn't directly query
> the database -- after it hands the right query to MapServer, it simply
> waits for whatever data it gets back.
Right, it is up to the SQLite OGR driver to manage construction of the SQL.
It would be nice if the OGR SQLite driver recognised when it was working
with a SpatialLite database, and knew how to load the spatiallite extension
and could then take advantage of whatever spatial indexing spatiallite offers.
In the meantime, sqlite + ogr + mapserver is not a suitable arrangement for
really large volumes of spatial data from which you want to full small spatial
regions frequently. Us a format with spatial indexing that we can take
advantage of.
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 | President OSGeo, http://osgeo.org
More information about the gdal-dev
mailing list