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.
_______________________________________________
MapServer-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to