[mapserver-users] Class maxscaledenom performance

Jeff McKenna jmckenna at gatewaygeomatics.com
Wed May 31 13:46:40 PDT 2017


oh, also be sure to remove all "WARNING" messages from the 
GetCapabilities response from your WMS service.  This is really 
important for downstream WMS clients, and can save you grief later.

Ok, I am sure others will have more advice...  Good night from the east 
coast of Canada!

-jeff



-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/




On 2017-05-31 5:40 PM, Jeff McKenna wrote:
> Hi Pierre,
> 
> This is tricky to debug over email without access to the data, but I'll 
> give you some points as to how I normally tackle such problems:
> 
> - verify that the issue isn't only limited to WMS, by testing with the 
> shp2img commandline utility
> (http://mapserver.org/utilities/shp2img.html)
> 
> - pass it the problem layername, and also the problem extent (I often 
> zoom into the problem area in QGIS, and then click on the "Toggle 
> Extents" button below the map and copy the extent values)
> 
>    shp2img -m my.map -o ttt.png -all_debug 5 -l layername -e minx miny 
> maxx maxy
> 
> - analyze the response, and look for a "msPostGISLayerWhichShapes query" 
> line, which is actually the query sent to PostGIS by MapServer, such as:
> 
> select encode(ST_AsBinary(ST_Force2D("wkb_geometry"),'NDR'),'hex') as 
> geom,"ogc_fid" from "layername" where wkb_geometry && 
> ST_GeomFromText('POLYGON((-151.4 57.2675406758448,-151.4 
> 57.4624593241552,-151.14 57.4624593241552,-151.14 
> 57.2675406758448,-151.4 57.2675406758448))',4326)
> 
> - run that same query directly into PostGIS, through the psql 
> commandline utility.  It should return a list of geometries at that 
> exact extent.
> 
> - also run shp2img to see draw speeds for that layer, such as:
> 
>    shp2img -m my.map -o ttt.png -map_debug 3 -l layername -e minx miny 
> maxx maxy
> 
> 
> Some other notes:
> 
> - if you need to debug the WMS command generated by QGIS, get the exact 
> GetMap problem request, and open it in your browser, and analyze the 
> parameters visually in the url : 
> https://github.com/mapserver/mapserver/wiki/Get-the-Raw-WMS-Request-Generated-by-QGIS 
> 
> 
> - follow general good practices:
>     - include an EXTENT parameter for each LAYER (this is often helpful 
> for WMS requests, to database layers)
> 
>     - be sure to set for all database layers:  PROCESSING 
> "CLOSE_CONNECTION=DEFER"
> 
>     - be sure to have PostGIS create OIDs by default in your databases 
> (see the "default_with_oids" setting in postgresql.conf)
> 
>     - verify that a "gist" index is set on the geometry column of your 
> problem table in PostGIS (view this by describing that table, in psql 
> command)
> 
>     - verify that the speed issue is not due to a reprojection
> 
> - maybe also turn off any labels for that layer/class and re-test
> 
> There are likely other points/tips that I follow, but this a start (it's 
> hard when I don't have access to your data).  Hope this helps a little 
> though.
> 
> -jeff
> 
> 




More information about the MapServer-users mailing list