[mapserver-users] Giving us a sample of draw dynamic thematic map

Rui Jianxun gis at shnu.edu.cn
Fri Oct 2 10:38:02 EDT 2009


Professor Steve.Lime,
How are you!
I am a beginner for MapServer. I want to draw dynamic thematic map via MapServer.
My ques is  : There is only one  polygon layer (.shp files)with several attributes fields.I will develop a web app via MapServer that allows users selecting the number of  classification for this layer via the dropdown list components or  write  into the text field on the web app ,such as ie or firefox. In this case,one could draw thematic map of the layer with 4 subclass,and others with 5 subclass. How can i do? Would you like to give me a sample?
Best Regards,
Rui jx




ÔÚÄúµÄÀ´ÐÅÖÐÔø¾­Ìáµ½:
>From: "Steve Lime" <Steve.Lime at dnr.state.mn.us>
>Reply-To: 
>To: "PatB" <pbarnhart at gis-services.com>, <mapserver-users at lists.osgeo.org>
>Subject: Re: [mapserver-users] Scale Bar Size Issue
>Date:Tue, 29 Sep 2009 10:11:09 -0500
>
>I thought about this more last night and settled on using a negative width to imply bar width
>and a positive width to imply image width. Wouldn&apos;t affect the mapfile defs or anything like that
>and a relatively easy addition on my part.
>
>Steve
>
>>>> On 9/29/2009 at 10:06 AM, in message
><1254236781386-3736841.post at n2.nabble.com>, PatB <pbarnhart at gis-services.com>
>wrote:
>
>> Gotcha - I meant that the image size I&apos;d need to calculate would change
>> because of the text etc.
>> 
>> I don&apos;t think changing the ms source code is an option for me, I&apos;d prefer to
>> go that route but don&apos;t have direct access to the produciton server.  If,
>> however, you come up with a patch please pass it along, maybe I can talk my
>> boss into letting me use it :)  It could also help someone else down the
>> line, I can&apos;t be the only person that wants control of the interval size.
>> 
>> So anyway, I know the output dpi and I know I want 1/2" intervals for
>> english and 1 cm for metric so I may end up just making a one size fits all
>> graphic and sticking text underneath it.  Sucks though.
>> 
>> Thanks for your help,
>> Pat
>> 
>> 
>> Steve Lime wrote:
>>> 
>>> No, the image size is held constant and changes in the bar itself are made
>>> to accommodate for
>>> that restriction, at least that what we try to do. We know how much space
>>> we have for the 
>>> bar and the various text elements and work backwards from that. You say,
>>> if the bar is
>>> so big the text is this, does it fit? If not then make the bar a touch
>>> shorter and re-compute 
>>> things. Again, that  was done to  facilitate websites where just image
>>> elements change and 
>>> not printing.
>>> 
>>> I suppose one could hack the scalebar code to interpret the size to mean
>>> "the bar" and not
>>> the image, or at least have that as an option. I&apos;ll take a peek and get
>>> back to you (or feel free
>>> if you&apos;re so inclined). Probably easier to hack the source than make your
>>> own.
>>> 
>>> Steve
>>> 
>>>>>> On 9/28/2009 at 2:12 PM, in message
>>>>>> <1254165139306-3731312.post at n2.nabble.com>,
>>> PatB <pbarnhart at gis-services.com> wrote:
>>> 
>>>> The image size will vary because of the length of the last callout under
>>>> the
>>>> bar, right?  100000 km will stick out past the bar farther than 5000 m. 
>>>> I
>>>> guess I could eyeball how much based on the font size, number of
>>>> characters
>>>> and ouput dpi but, well, bleach.  Is there a better way?  Plan B is to
>>>> make
>>>> my own scalebar but I&apos;m not wild about that idea either.
>>>> 
>>>> Engineers all over the world just cringed when I wrote &apos;eyeball&apos;.
>>>> 
>>>> Thanks.
>>>> 
>>>> 
>>>> Steve Lime wrote:
>>>>> 
>>>>> When you set a size for a scalebar the width you provide is what you get
>>>>> back. The height is for
>>>>> the bar only. This was done so that scalebar images could retain the
>>>>> same
>>>>> image size and you 
>>>>> could just swap img.src in a web app (assuming you&apos;re not mucking with
>>>>> font sizes). You&apos;ll likely
>>>>> have to experiment a bit with the width then to get it roughly the right
>>>>> size (e.g ask for 750).
>>>>> 
>>>>> Steve
>>>>> 
>>>>>>>> On 9/24/2009 at 11:04 PM, in message
>>>>> <1253851467382-3710334.post at n2.nabble.com>, PatB
>>>>> <pbarnhart at gis-services.com>
>>>>> wrote:
>>>>> 
>>>>>> Hi,
>>>>>> 
>>>>>> I&apos;m using the code below to request a scalebar from mapserver.  My
>>>>>> understanding of the documentation is that the size parameter sets the
>>>>>> size
>>>>>> of the scalebar itself not including the text, border, etc but that&apos;s
>>>>>> not
>>>>>> what I&apos;m getting back.  The url below returns an image that is 600 x
>>>>>> 153
>>>>>> (I&apos;m requesting 600 x 75) when it should be more like 750 x 153 to
>>>>>> account
>>>>>> for the surrounding stuff.  The height works as expected and the
>>>>>> units/distances look right, the width of the scalebar itself is the
>>>>>> issue.
>>>>>> 
>>>>>> This is for a print app, the output res is 300dpi so by setting the
>>>>>> width
>>>>>> to
>>>>>> 600 I was hoping to print a 2 inch wide scale bar with four 1/2"
>>>>>> intervals. 
>>>>>> This seems like it would be a common task but I&apos;ve been digging though
>>>>>> the
>>>>>> forum for hours without success.  A little help?  I&apos;m using MS version
>>>>>> 5.4.2
>>>>>> 
>>>>>> mapserv.exe?MAP=C:/ms4w/tmp/maps/mp.map&mode=scalebar&mapext=-8798233+4184184+-8
>>>>>> 
>>>> 
>> 793280+4188502&mapsize=11700+10200&map.scalebar=units+feet+size+600+75+interval
>> 
>>>> 
>>>>>> s+4+label+size+40+end
>>>>>> 
>>>>>> and my map file goes something like:
>>>>>> 
>>>>>> MAP
>>>>>> ...
>>>>>> UNITS meters
>>>>>> ...
>>>>>> SCALEBAR
>>>>>>   STYLE 0
>>>>>>   IMAGECOLOR 255 255 255
>>>>>>   LABEL
>>>>>>     TYPE TRUETYPE
>>>>>>     FONT "tahoma"
>>>>>>     SIZE 40
>>>>>>     COLOR 0 114 255
>>>>>>   END
>>>>>>   SIZE 600 75
>>>>>>   COLOR 235 235 235
>>>>>>   BACKGROUNDCOLOR 0 114 255
>>>>>>   OUTLINECOLOR 0 0 0
>>>>>>   UNITS meters
>>>>>>   INTERVALS 4
>>>>>>   STATUS on
>>>>>>   TRANSPARENT on
>>>>>> END
>>>>>> ...
>>>>>> 
>>>>>> Thanks - and yes, the map size is friggin huge.
>>>>> 
>>>>> _______________________________________________
>>>>> mapserver-users mailing list
>>>>> mapserver-users at lists.osgeo.org 
>>>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users 
>>>>> 
>>>>> 
>>> 
>>> _______________________________________________
>>> mapserver-users mailing list
>>> mapserver-users at lists.osgeo.org 
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users 
>>> 
>>> 
>_______________________________________________
>mapserver-users mailing list
>mapserver-users at lists.osgeo.org
>http://lists.osgeo.org/mailman/listinfo/mapserver-users
> 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20091002/95ae53fc/attachment-0001.html


More information about the mapserver-users mailing list