[mapserver-users] Help with symbol layer

Adam Eskreis aeskreis at gmail.com
Fri May 22 23:44:58 EDT 2009


Thank you for your help so far Bob.

Your suggestion gave me an idea.  What I am doing now, I calculated the
center point for each polygon, and inserted that geometry into the database
table.  I am now displaying the symbol centered on the polygon, however
there is still the issue of sizing it properly.

My idea is to write a stand alone program that will size the images properly
depending on the polygon size. The problem of having a different image for
every polygon is another story in itself, but I want to focus on getting
just a few images in there first.

Is it crazy to try to calculate what the screen pixel size of the bounding
box surrounding the polygon, depending on scale, in order to resize the
image to a size that will fit just right into the polygon?

-Adam

On Fri, May 22, 2009 at 5:27 PM, Bob Basques <Bob.Basques at ci.stpaul.mn.us>wrote:

>  Oh, well, that's slight different, you want to scale an image/symbol, to
> fit (once) in a closed polygon, right?
>
>  That's harder to do (if at all), are all the polygons the same size, or
> variable in size.  Are they the same aspect as th, height to width as the
> symbol?
>
>  You may be able to scale on a attribute value if you have the size (width
> or height) as a attribute for example.
>
>  SIZE [attributeValueFromDataSource]   ## This uses the value in the
> attributes from the data source to size the symbol.  Clipping the symbol to
> fit an irregular polygon will be another complication, unless you allow for
> repeating symbols (which is what I thought you were looking for originally.
>
>  bobb
>
>
>
> >>> Adam Eskreis <aeskreis at gmail.com> wrote:
>
> Ok, I read through this, and it was helpful, but i can't figure how to do
> exactly what I need.
>
> What I essentialy want to do is make the symbol act as though it were the
> "background image" of the polygon. No repeating, and stretched or compressed
> to fit, so that the entire image is viewable.
>
> Is somethign like this possible?
>
> -Adam
>
>   On Fri, May 22, 2009 at 3:46 PM, Bob Basques
>
> <Bob.Basques at ci.stpaul.mn.us>
>
> wrote:
>
>>  Yes,
>>
>>
>>  see here. . .
>>
>>
>>
>>  *
>> http://mapserver.org/mapfile/symbology/construction.html?highlight=symbol%20fill
>> *
>>
>>
>>
>> >>> Adam Eskreis <aeskreis at gmail.com> wrote:
>>
>> Hello all.
>>
>> I have a question that may or may not have been answered before, but I
>> can't seem to find anything on it.
>>
>> Is it possible with mapserver to make a symbol fill the entire area of a
>> polygon feature? In other words, can I provide an image as the symbol, and
>> have that symbol completely fill the polygon, regardless of the width and
>> height dimensions of the image?
>>
>> Thank you,
>>
>> -Adam
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapserver-users/attachments/20090522/526ad1b6/attachment-0001.html


More information about the mapserver-users mailing list