Re: [mapserver-users] data parameter in tileindex

2021-04-05 Thread Peter Schmitt
On Wed, Mar 24, 2021 at 1:47 AM Rahkonen Jukka (MML) <
jukka.rahko...@maanmittauslaitos.fi> wrote:

> perhaps OGR connection to PostGIS would work better than the native one
> with tileindex.
>

I am trying to do this as a proof-of-concept tile index of vector files
where the geom is stored in a Postgis database.  Does anyone have
experience with the Postgres driver and a MapServer OGR layer?  I can get
OGR to read my database with something like this:

ogrinfo -ro PG:"host='db' user='test' dbname='testdb' password='123'" -sql
"SELECT id, geom FROM boundaries LIMIT 1"

# service=WFS=1.1.0=getfeature=example_layer
LAYER
NAME example_layer
TYPE POLYGON
CONNECTIONTYPE OGR
CONNECTION "host=db user=test dbname=testdb password=123"
END

I've tried passing the query (-sql "SELECT id, geom FROM boundaries LIMIT
1") in the CONNECTION string, as a separate DATA and also CONNECTIONOPTIONS
as in the ElasticSearch example in the docs
https://www.mapserver.org/input/vector/ogr.html However none of these
work.  How do you pass something like "-sql ..." to a MapServer layer of
type OGR?

Thanks!
Pete
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] tile_map_edge_buffer and python mapscript

2021-04-05 Thread Baev Alexandr via mapserver-users

Нi Steve: Тhanks for the answer!

Are there features of activating tile mode for mapscript? Whether it is 
necessary to pass in the request variable  mode=tile  (as mapserv CGI), or  
TILED=TRUE  (as test in git version  
https://github.com/MapServer/MapServer/blob/main/msautotest/wxs/wms_tiled.map  
… something like a geoserver).
By simply including metadata tile_map_edge_buffer - tile buffer does not work 
for me.

My Mapfile header (this template):

    MAP
        NAME "test map"
        SIZE 1280 1024
        MAXSIZE 4096
        UNITS meters
        IMAGETYPE PNG
        EXTENT {{extent_x_min}} {{extent_y_min}} {{extent_x_max}} 
{{extent_y_max}}
        IMAGECOLOR 255 255 255  
        SYMBOLSET "{{symbolset}}"
        FONTSET "{{fontset}}"
        WEB
            METADATA
                "tile_map_edge_buffer" "64"
                wms_title "test map"
                wms_featureinfoformat "text/plain"
                wms_srs "EPSG:3857 EPSG:32638 EPSG:4326"                  
                wms_enable_request "*"
                wms_encoding "UTF8"
            END
        END
        PROJECTION
          "init=epsg:{{db_epsg}}"
        END
 
    LAYER
        NAME "test layer"
        PROCESSING "LABEL_NO_CLIP=True"
        PROCESSING "CLOSE_CONNECTION=DEFER"
        EXTENT {{extent_x_min}} {{extent_y_min}} {{extent_x_max}} 
{{extent_y_max}}
        PROJECTION
            "init=epsg:{{db_epsg}}"
        END
        METADATA
            wms_title "test layer"
        END
        CONNECTIONTYPE postgis
        CONNECTION "{{db_string}}"
        DATA "{{query_string}}"
        STATUS       ON
        TYPE POLYGON
        
        ……...
  Runing this on python mapscript:

            map_obj = mapscript.mapObj(mapfile) #mapfile described earlier
            request = mapscript.OWSRequest()
            mapscript.msIO_installStdoutToBuffer()
            request.loadParamsFromURL(query_string) #query_string — request of 
web framework
            status_id = map_obj.OWSDispatch(request)
            content_type = mapscript.msIO_stripStdoutBufferContentType()
            result = mapscript.msIO_getStdoutBufferBytes()
            mapscript.msIO_resetHandlers()
Сan this work in tile mode? Тhanks in advance!

Baev Alexandr
old...@bk.ru
  
>Вторник, 6 апреля 2021, 0:33 +03:00 от Steve Lime :
> 
>Hi Baev: That metadata element is used by the tile mode and by the WMS/GetMap 
>code. So a WMS GetMap request though MapScript should make use of it. --Steve  
>On Sun, Apr 4, 2021 at 2:39 PM Baev Alexandr via mapserver-users < 
>mapserver-users@lists.osgeo.org > wrote:
>>Mapserver last release version 7.6.2 
>>Will tile_map_edge_buffer work in python mapscript? Or does it only work with 
>>mapserv CGI (mode=tile)?
>>If it works, what should be done? Additional configuration may be required 
>>mapscript.OWSRequest() ?
>> 
>>Help me, please!
>>
>>Baev Alexandr
>>old...@bk.ru ___
>>mapserver-users mailing list
>>mapserver-users@lists.osgeo.org
>>https://lists.osgeo.org/mailman/listinfo/mapserver-users 
 
 
С уважением,
Baev Alexandr
old...@bk.ru
 ___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users


Re: [mapserver-users] tile_map_edge_buffer and python mapscript

2021-04-05 Thread Steve Lime
Hi Baev: That metadata element is used by the tile mode and by the
WMS/GetMap code. So a WMS GetMap request though MapScript should make use
of it. --Steve

On Sun, Apr 4, 2021 at 2:39 PM Baev Alexandr via mapserver-users <
mapserver-users@lists.osgeo.org> wrote:

> Mapserver last release version 7.6.2
> Will tile_map_edge_buffer work in python mapscript? Or does it only work
> with mapserv CGI (mode=tile)?
> If it works, what should be done? Additional configuration may be
> required mapscript.OWSRequest() ?
>
> Help me, please!
>
> Baev Alexandr
> old...@bk.ru
> ___
> mapserver-users mailing list
> mapserver-users@lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users