[mapserver-users] tile_map_edge_buffer and python mapscript

Baev Alexandr oldbay at bk.ru
Sun Apr 11 12:39:44 PDT 2021


Hi Steve: thanks for the advice!
I will implement Tile buffer logic in python.
  
>Суббота, 10 апреля 2021, 0:19 +03:00 от Steve Lime <sdlime at gmail.com>:
> 
>Looks like I misspoke. I checked the code and it shows tile_map_edge_buffer being limited to mode=tile only. I don't think that param has any impact on the test you referenced.
> 
>There's another metadata parameter that is more generally useful with metatile generation called "labelcache_map_edge_buffer". It reserves space around the edge of the map to deal with labels at the edge of tiles. Typically you generate metatiles and then carve them up into actual tiles. Mode=tile only generates single tiles which limits utility although it has its place.
> 
>I think if you really wanted similar behaviour for your script to mode=tile you'd have to replicate that logic in your python code - so create a larger image and then clip out the center. What is your ultimate goal?
>   
>On Mon, Apr 5, 2021 at 5:57 PM Baev Alexandr < oldbay at bk.ru > wrote:
>>Н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
>>oldbay at bk.ru
>>  
>>>Вторник, 6 апреля 2021, 0:33 +03:00 от Steve Lime < sdlime at gmail.com >:
>>> 
>>>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 at 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
>>>>oldbay at bk.ru _______________________________________________
>>>>mapserver-users mailing list
>>>>mapserver-users at lists.osgeo.org
>>>>https://lists.osgeo.org/mailman/listinfo/mapserver-users 
>> 
>> 
>>С уважением,
>>Baev Alexandr
>>oldbay at bk.ru
>>  
 
 
С уважением,
Baev Alexandr
oldbay at bk.ru
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20210411/85d3b253/attachment.html>


More information about the mapserver-users mailing list