[mapserver-users] Using grid and bounding box to make query faster

Arun Cherian archerian at gmail.com
Wed Oct 9 06:00:52 PDT 2013


Hello,

I am using Mapserver to serve WMS to a browser based application using
Openlayers as the client-side library. The map is a hexagonal grid of a
country, I have divided the whole area into a unique (q,r) hexagonal
co-ordinate system, and the postgis DB has the hexagons stored in a table
as POLYGONs. When the user clicks on a grid, it executes a query on another
table with additional data (linked via hexagon grid id) to retrieve data
about that particular grid. All tables have appropriate indexing.  The
tables are two in number - one with the hexagon as POLYGON (around 50M) and
the other with the actual points under each gridbox as POINT (around 400M).

Is there some way to make the data retrieval from the hexagon POLYGON table
faster using the unique hexgrid ID? I can convert between lat/lon and
hexgridid, so I was wondering if I could get the maps current view's
bounds, convert it to the bounding hexgrids and send that as WMS paramaters
and somehow set a limit on the search grid? I am hoping this would speed up
the mapserver query if it was possible somehow to bound the output with
hexagon gridid in addition to the standard lat/lon bounding query mapserver
sends. Or is that just not a good idea?

Thanks,
Arun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20131009/763198aa/attachment-0001.html>


More information about the mapserver-users mailing list