[fusion-users] Proper Class Names in MapServer Mapfile

Paul Spencer pspencer at dmsolutions.ca
Wed Sep 9 13:16:37 EDT 2009


Sounds good Tim.  Note the 2.0 branch will be replaced by trunk and we  
are going to restart the 2.0 release.  But I don't think LoadMap.php  
has changed between 2.0 and trunk so no matter.

Cheers

Paul

On 2009-09-09, at 10:42 AM, Nolte, Tim wrote:

> Does anyone object if I just build a ticket in Trac for this? I'm
> proposing this as a change to the 2.0 branch.
>
> - Tim
>
> ----
> Timothy J Nolte - tnolte at ilpcs.com
> Network Planning Engineer
>
> iPCS Wireless, Inc.
> 4717 Broadmoor Ave, Suite G
> Kentwood, MI 49512
>
> Office: 616-656-5163
> PCS:    616-706-2438
> Fax:    616-554-6484
> Web: www.ipcswirelessinc.com
>
> -----Original Message-----
> From: fusion-users-bounces at lists.osgeo.org
> [mailto:fusion-users-bounces at lists.osgeo.org] On Behalf Of Nolte, Tim
> Sent: Wednesday, September 09, 2009 9:40 AM
> To: Julien-Samuel Lacroix
> Cc: dmorissette at mapgears.com; fusion-users at lists.osgeo.org
> Subject: RE: [fusion-users] Proper Class Names in MapServer Mapfile
>
> It would seem to me that if $class->title was add that long ago there
> should be no question of whether this can be incorporated into  
> Fusion. I
> wouldn't think people would be using Fusion with anything older then  
> 4.x
> MapServer/MapScript.
>
> - Tim
>
> ----
> Timothy J Nolte - tnolte at ilpcs.com
> Network Planning Engineer
>
> iPCS Wireless, Inc.
> 4717 Broadmoor Ave, Suite G
> Kentwood, MI 49512
>
> Office: 616-656-5163
> PCS:    616-706-2438
> Fax:    616-554-6484
> Web: www.ipcswirelessinc.com
> -----Original Message-----
> From: Julien-Samuel Lacroix [mailto:jlacroix at mapgears.com]
> Sent: Wednesday, September 09, 2009 9:31 AM
> To: Nolte, Tim
> Cc: dmorissette at mapgears.com; fusion-users at lists.osgeo.org
> Subject: Re: [fusion-users] Proper Class Names in MapServer Mapfile
>
> Hi,
>
> It seems to have been added in MapServer 3.6. I'm not sure if Fusion
> with a version that old.
>
> http://trac.osgeo.org/mapserver/changeset/1389
>
> Julien
>
> Nolte, Tim wrote:
>> Daniel,
>>
>> Do you have further insight into Paul's question?
>>
>> - Tim
>>
>> ----
>> Timothy J Nolte - tnolte at ilpcs.com
>> Network Planning Engineer
>>
>> iPCS Wireless, Inc.
>> 4717 Broadmoor Ave, Suite G
>> Kentwood, MI 49512
>>
>> Office: 616-656-5163
>> PCS:    616-706-2438
>> Fax:    616-554-6484
>> Web: www.ipcswirelessinc.com
>>
>> -----Original Message-----
>> From: Paul Spencer [mailto:pspencer at dmsolutions.ca]
>> Sent: Tuesday, September 08, 2009 4:48 PM
>> To: Nolte, Tim
>> Cc: fusion-users at lists.osgeo.org
>> Subject: Re: [fusion-users] Proper Class Names in MapServer Mapfile
>>
>> Tim, do you know in which mapserver version $class->title got added  
>> to
>
>> mapscript?  What will happen in older mapserver installs, will it
>> return an empty string?
>>
>> Paul
>>
>> On 2009-09-08, at 4:45 PM, Nolte, Tim wrote:
>>
>>> OK, so I decided to do a little digging in the MapServer code. I'd
>>> like
>>> to propose the following code change in the LoadMap.php:
>>>
>>>        //create classes and slot them into the scale breaks
>>>        for ($j=0; $j<$layer->numclasses; $j++) {
>>>            $oClass = $layer->getClass($j);
>>>            $classObj = NULL;
>>>            // Use formatted legend label as defined by CLASS->TITLE
>>>            $classObj->legendLabel = $oClass->title != '' ?
>>> $oClass->title : $oClass->name;
>>>            //$classObj->legendLabel = $oClass->name;
>>>            $classObj->filter = $oClass->getExpression();
>>>            $classMin = $oClass->minscale == -1 ? $layerMin :
>>> max($oClass->minscale, $layerMin);
>>>            $classMax = $oClass->maxscale == -1 ? $layerMax :
>>> min($oClass->maxscale, $layerMax);
>>>            $classObj->minScale = $classMin;
>>>            $classObj->maxScale = $classMax;
>>>            $classObj->index = $j;
>>>            for ($k=0; $k<count($aScaleRanges); $k++) {
>>>                if ($classMin < $aScaleRanges[$k]->maxScale &&
>>>                    $classMax > $aScaleRanges[$k]->minScale) {
>>>                    array_push($aScaleRanges[$k]->styles, $classObj);
>>>                }
>>>            }
>>>        }
>>>
>>> This block starts around line 306. My code change looks for a
>>> CLASS->TITLE and uses that and if not found falls back on the
>>> CLASS->NAME. I've tested and it works perfectly! I would really like
>
>>> to
>>> not have to manually maintain my custom code here. Thanks!
>>>
>>> - Tim
>>>
>>> ----
>>> Timothy J Nolte - tnolte at ilpcs.com
>>> Network Planning Engineer
>>>
>>> iPCS Wireless, Inc.
>>> 4717 Broadmoor Ave, Suite G
>>> Kentwood, MI 49512
>>>
>>> Office: 616-656-5163
>>> PCS:    616-706-2438
>>> Fax:    616-554-6484
>>> Web: www.ipcswirelessinc.com
>>> -----Original Message-----
>>> From: fusion-users-bounces at lists.osgeo.org
>>> [mailto:fusion-users-bounces at lists.osgeo.org] On Behalf Of Nolte,  
>>> Tim
>>> Sent: Tuesday, September 08, 2009 4:14 PM
>>> To: fusion-users at lists.osgeo.org
>>> Subject: [fusion-users] Proper Class Names in MapServer Mapfile
>>>
>>> I have figured out how to give properly formatted names to groups  
>>> and
>>> layers. The problem I run into now is I have a few layers that I am
>>> classifying. These classified layers are showing the crude CLASS ->
>>> NAME
>>> (e.g. 'on_air_evdo') but I want to have Fusion show a properly
>>> formatted
>>> name (e.g. 'EVDO On-Air'). Thanks.
>>>
>>> - Tim
>>>
>>> ----
>>> Timothy J Nolte - tnolte at ilpcs.com
>>> Network Planning Engineer
>>>
>>> iPCS Wireless, Inc.
>>> 4717 Broadmoor Ave, Suite G
>>> Kentwood, MI 49512
>>>
>>> Office: 616-656-5163
>>> PCS:    616-706-2438
>>> Fax:    616-554-6484
>>> Web: www.ipcswirelessinc.com
>>> _______________________________________________
>>> fusion-users mailing list
>>> fusion-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/fusion-users
>>>
>>> _______________________________________________
>>> fusion-users mailing list
>>> fusion-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/fusion-users
>>
>>
>> __________________________________________
>>
>>    Paul Spencer
>>    Chief Technology Officer
>>    DM Solutions Group Inc
>>    http://research.dmsolutions.ca/
>>
>>
>> _______________________________________________
>> fusion-users mailing list
>> fusion-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/fusion-users
>>
>
> -- 
> Julien-Samuel Lacroix
> Mapgears
> http://www.mapgears.com/
>
> _______________________________________________
> fusion-users mailing list
> fusion-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-users
>


__________________________________________

    Paul Spencer
    Chief Technology Officer
    DM Solutions Group Inc
    http://research.dmsolutions.ca/



More information about the fusion-users mailing list