Re: [mapserver-users] PHP mapscript createLegendIcon doesn't follow style maxscaledenom

2017-03-30 Thread Paul Moen
In case anyone else wants the createLegendIcon to return the image based what 
would be drawn at the current mapscale, here is what I did.

In the mapserver 7.0.4 source code, mapscript/php/mapscript_i.c line 1116  has 
scale_independant hard coded to MS_TRUE.  I changed it to MS_FALSE, recompiled 
and have the behavior that I was expecting.  

Thanks,




On Mar 30, 2017, at 11:01 AM, Moen, Paul T.  wrote:

Sorry I forgot to say that I have tried the script with the following versions 
with the same results.
 
MapServer version 7.0.3 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ 
SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=WMS_SERVER 
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER 
SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
 
MapServer version 6.4.4 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ 
SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=WMS_SERVER 
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER 
SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
 
 
From: mapserver-users mailto:mapserver-users-boun...@lists.osgeo.org>> on behalf of Paul Moen 
mailto:pm...@nd.gov>>
Date: Thursday, March 30, 2017 at 10:45 AM
To: "mapserver-users@lists.osgeo.org " 
mailto:mapserver-users@lists.osgeo.org>>
Subject: [mapserver-users] PHP mapscript createLegendIcon doesn't follow style 
maxscaledenom
 
CAUTION: This email originated from an outside source. Do not click links or 
open attachments unless you know they are safe.

I am finding that createLegendIcon returns a different legend item than what is 
used in the map output when using scaledenom in the style.
 
Below is a test script that produces what I am talking about. 
 
The script will create 4 images.
 
map_scale_873.png -> map->draw output with a 873 scaledenom
map_scale_2618.png -> map->draw with a 873 scaledenom
legimg_scale_873.png -> createLegendIcon output with a 873 scaledenom
legimg_scale_2618.png -> createLegendIcon output with a 873 scaledenom
 
 
I was expecting that the legend image at the 873 scale, legimg_scale_873.png 
would match the map output, map_scale_873.png.  Can anyone see a problem, is 
this a bug, or is this expected behavior?
 
selectOutputFormat('png');
$img=$map->draw();
$name=round($map->scaledenom);
$img->saveImage("map_scale_$name.png");
$tmpLay =$map->getLayer(0);
$tmpclass = $tmpLay->getClass(0);
$tmpImg = $tmpclass->createLegendIcon(50,50);
$tmpImg->saveImage("legimg_scale_$name.png");
$map->setextent(200,200,300,300);
$img2=$map->draw();
$name=round($map->scaledenom);
$img2->saveImage("map_scale_$name.png");
$tmpImg->saveImage("legimg_scale_$name.png");

?>
 
Thanks,
 
Paul
___
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

Re: [mapserver-users] PHP mapscript createLegendIcon doesn't follow style maxscaledenom

2017-03-30 Thread Moen, Paul T.
Sorry I forgot to say that I have tried the script with the following versions 
with the same results.

MapServer version 7.0.3 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ 
SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=WMS_SERVER 
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER 
SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

MapServer version 6.4.4 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ 
SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=WMS_SERVER 
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER 
SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE


From: mapserver-users  on behalf of 
Paul Moen 
Date: Thursday, March 30, 2017 at 10:45 AM
To: "mapserver-users@lists.osgeo.org" 
Subject: [mapserver-users] PHP mapscript createLegendIcon doesn't follow style 
maxscaledenom


CAUTION: This email originated from an outside source. Do not click links or 
open attachments unless you know they are safe.
I am finding that createLegendIcon returns a different legend item than what is 
used in the map output when using scaledenom in the style.

Below is a test script that produces what I am talking about.

The script will create 4 images.

map_scale_873.png -> map->draw output with a 873 scaledenom
map_scale_2618.png -> map->draw with a 873 scaledenom
legimg_scale_873.png -> createLegendIcon output with a 873 scaledenom
legimg_scale_2618.png -> createLegendIcon output with a 873 scaledenom


I was expecting that the legend image at the 873 scale, legimg_scale_873.png 
would match the map output, map_scale_873.png.  Can anyone see a problem, is 
this a bug, or is this expected behavior?

selectOutputFormat('png');
$img=$map->draw();
$name=round($map->scaledenom);
$img->saveImage("map_scale_$name.png");
$tmpLay =$map->getLayer(0);
$tmpclass = $tmpLay->getClass(0);
$tmpImg = $tmpclass->createLegendIcon(50,50);
$tmpImg->saveImage("legimg_scale_$name.png");
$map->setextent(200,200,300,300);
$img2=$map->draw();
$name=round($map->scaledenom);
$img2->saveImage("map_scale_$name.png");
$tmpImg->saveImage("legimg_scale_$name.png");

?>

Thanks,

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

[mapserver-users] PHP mapscript createLegendIcon doesn't follow style maxscaledenom

2017-03-30 Thread Moen, Paul T.
I am finding that createLegendIcon returns a different legend item than what is 
used in the map output when using scaledenom in the style.

Below is a test script that produces what I am talking about.

The script will create 4 images.

map_scale_873.png -> map->draw output with a 873 scaledenom
map_scale_2618.png -> map->draw with a 873 scaledenom
legimg_scale_873.png -> createLegendIcon output with a 873 scaledenom
legimg_scale_2618.png -> createLegendIcon output with a 873 scaledenom


I was expecting that the legend image at the 873 scale, legimg_scale_873.png 
would match the map output, map_scale_873.png.  Can anyone see a problem, is 
this a bug, or is this expected behavior?

selectOutputFormat('png');
$img=$map->draw();
$name=round($map->scaledenom);
$img->saveImage("map_scale_$name.png");
$tmpLay =$map->getLayer(0);
$tmpclass = $tmpLay->getClass(0);
$tmpImg = $tmpclass->createLegendIcon(50,50);
$tmpImg->saveImage("legimg_scale_$name.png");
$map->setextent(200,200,300,300);
$img2=$map->draw();
$name=round($map->scaledenom);
$img2->saveImage("map_scale_$name.png");
$tmpImg->saveImage("legimg_scale_$name.png");

?>

Thanks,

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

Re: [mapserver-users] PHP-mapscript: composite block in layer definition

2017-03-30 Thread Jeff McKenna

On 2017-03-30 6:14 AM, Jan Hartmann wrote:

Hi folks,

Perhaps I overlooked something, but I don't see how to define a
composite block within a layer with php-mapscript. In a regular mapfile
it works beautifully (http://mapserver.org/mapfile/composite.html)



Hi Jan, there is already a ticket for that issue at 
https://github.com/mapserver/mapserver/issues/5358


-jeff




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





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

[mapserver-users] PHP-mapscript: composite block in layer definition

2017-03-30 Thread Jan Hartmann

Hi folks,

Perhaps I overlooked something, but I don't see how to define a 
composite block within a layer with php-mapscript. In a regular mapfile 
it works beautifully (http://mapserver.org/mapfile/composite.html)


Regards,

Jan Hartmann
Amsterdam
___
mapserver-users mailing list
mapserver-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users