[MapServer-users] Mapcache second level dimensions

Johannes Paul johannespaul92 at gmail.com
Thu Feb 16 02:38:16 PST 2023


Coming back on a semi-working 2nd level dimension use case, if I use the
below conf:
```
<cache name="test_cache" type="sqlite3">
    <dbfile>/nfs_tiles/test/{dim:product}.sqlite3</dbfile>
</cache>
<tileset name="mosa_test">
    <format>PNG</format>
    <grid>worldwind</grid>
    <cache>test_cache</cache>
    <dimensions>
      <dimension name="*product*" type="sqlite" default="default">
        <dbfile>/nfs_tiles/test/mosa.db</dbfile>
        <validate_query>select product from mosa where
sensor=:dim</validate_query>
        <list_query>select product from mosa</list_query>
      </dimension>
    </dimensions>
</tileset>
```
Then the *dim_product *is passed to the cache '*test_cache*' with the
sub-dimension result using parameters '
*&product=spot-img2&DIM_product=spot-img2*', only if the result returns
only 1 sud-dimension value ... if it returns X sub-dimensions values I
still get an error : `*dimension (product) for tileset (mosa_test) returned
invalid number (X) of subdimensions (1 expected)*`

It seems the mechanism is not working the way it should be, isn't it ?
Johannes

On Thu, 16 Feb 2023 at 09:54, Johannes Paul <johannespaul92 at gmail.com>
wrote:

> Hello,
>
> I'm trying to implement second level SQLite dimension as explained in the
> doc
> https://mapserver.org/mapcache/dimensions.html#second-level-dimensions
>
> Following that exemple on mapcache v1.12, I'm expecting that the below
> conf, with WMS request on 'mosa_test' tileset with 'dim_sensor=phr', shall
> use the “product” sub-dimension values to query the data source
> 'mosa_source' on tileset 'test_primary' with 'dim_product' for each product
> returned by the 2nd level dimension request (cache 'test_cache' is
> pre-existing) ...
>
> ```
> <cache name="test_cache" type="sqlite3">
>     <dbfile>/nfs_tiles/test/{dim:product}.sqlite3</dbfile>
> </cache>
> <tileset name="test_primary">
>     <cache>test_cache</cache>
>     <grid>worldwind</grid>
>     <dimensions>
>        <dimension name="product" type="regex" default="spot-img1">
>          <regex>.*</regex>
>        </dimension>
>     </dimensions>
>     <format>PNG</format>
> </tileset>
> <cache name="mosa_cache" type="sqlite3">
>     <dbfile>/nfs_tiles/test/mosa_{dim:sensor}.sqlite3</dbfile>
> </cache>
> <tileset name="mosa_test">
>     <format>PNG</format>
>     <grid>worldwind</grid>
>     <cache>mosa_cache</cache>
>     <source>mosa_source</source>
>     <dimensions>
>       <dimension name="sensor" type="sqlite" default="default">
>         <dbfile>/nfs_tiles/test/mosa.db</dbfile>
>         <validate_query>select product from mosa where
> sensor=:dim</validate_query>
>         <list_query>select product from mosa</list_query>
>       </dimension>
>     </dimensions>
> </tileset>
> <source name="mosa_source" type="wms">
>     <http>
>        <url>http://server/mapcache/</url>
>     </http>
>     <getmap>
>         <params>
>             <FORMAT>PNG</FORMAT>
>             <LAYERS>test_primary</LAYERS>
>             <TRANSPARENT>true</TRANSPARENT>
>         </params>
>     </getmap>
> </source>
> ```
>
> However all I get is a mapcache error in the httpd log, as follows :
> `dimension (sensor) for tileset (mosa_test) returned invalid number (X) of
> subdimensions (1 expected)`
> If my 'sensor' dimension returns X products (which is the use case), I get
> the error above, and if my 'sensor' dimension returns 1 product (let say
> spot-img2), I get an error on the mapcache generated WMS request to the
> source 'mosa_source' on tileset 'test_primary' with parameters
> '&sensor=spot-img2&DIM_sensor=spot-img2' ... which can obviously not work !
> Why is mapcache not using 'dim_product' in the WMS request ?
>
> Have I missed something ?
> Thanks,
> Johannes
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20230216/a90634ba/attachment.htm>


More information about the MapServer-users mailing list