[MapServer-users] [EXTERNAL] Vector tileindex with connectiontype OGR

Even Rouault even.rouault at spatialys.com
Wed Dec 7 15:17:37 PST 2022


Pete,
> How do I specify such a query using the OGR PG driver as a Mapserver 
> layer to be used as a TILEINDEX of OGR vector files?
A potential solution would be to create a OGR VRT file that contains 
your SQL request, and reference that VRT file in the TILEINDEX

<OGRVRTDataSource>
     <OGRVRTLayer name="layer">
         <SrcDataSource>PG:"host='localhost' user='postgres' 
dbname='mydatabase' password='mypwd'</SrcDataSource>
         <SrcSQL>SELECT * FROM testtable</SrcSQL>

</OGRVRTDataSource>

Actually you may be able to inline the VRT file as the TILEINDEX value 
(it is a bit tricky regarding quoting however, but there's an example of 
that in https://mapserver.org/input/vector/VirtualSpatialData.html as 
the value of CONNECTION, not TILEINDEX, but that shouldn't make a 
difference)), since the OGR VRT XML content can be used as a valid OGR 
dataset name.

>
> Perhaps this is more of a GDAL question... or how does Mapserver's use 
> of OGR TILEINDEX of OGR vector files allow custom SQL?  Note that as a 
> TILEINDEX of Rasters the TILEINDEX can point to a Mapserver Layer, so 
> I /can/ add custom SQL queries in that case.  But I don't know how to 
> do it as a OGR TILEINDEX pointing to OGR vectors.

For vector layer, it doesn't look like it is possible to have TILEINDEX 
pointing to a MapServer vector layer (contrary to rasters), at least I 
can't see any related tests in mapserver regression test suite

Even


-- 
http://www.spatialys.com
My software is free, but my time generally not.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20221208/8b9aeb86/attachment.htm>


More information about the MapServer-users mailing list