Wim,

You can do these offsets in pixel values at a class level, just not a feature 
level.  This pretty much does what you are describing, although it gets a 
little funky when the lines are diagonal and not straight.

    CLASS
        STYLE
            COLOR 0 0 0
            WIDTH 2
        END
        STYLE
            COLOR 255 0 0
            WIDTH 2
            OFFSET 10 10
        END
        STYLE
            COLOR 0 255 0
            WIDTH 2
            OFFSET -10 -10
        END

    END

David.

From: [email protected] 
[mailto:[email protected]] On Behalf Of Wim Vanbelle
Sent: Thursday, August 12, 2010 9:32 AM
To: [email protected]
Subject: Re: [mapserver-users] Offset values from database

Maybe this pic helps elaborate on what i'm trying to accomplish: 
http://fileshare.myroute.be/exchange/asymmetriclinedrawing.png
It should be noted that the distance between the 2 (new) lines, should be a 
fixed value over the zoomlevels. It must not be the case that at the furthest 
zoomlevel the lines are further apart.

I've looked all over for this, but never really found a proper solution. I 
tried cartographic symbol drawing, but it only draws on the same side every 
time. Maybe I'm just doing it wrong :).

On 12 August 2010 16:28, Wim Vanbelle 
<[email protected]<mailto:[email protected]>> wrote:
Hello,

thanks for your feedback.

The issue with this, is that the underlying linestrings (the 2 that would lie 
on top of eachother), have different colors :(.

So they have to be moved apart from one another. I have not found a way to do 
this with asymmetric line drawing either, as it will always offset to the same 
side.

This is why i would need the offset value to be configurable in the database. I 
could select a different pixel offset for each line and they would always 
appear next to eachtoher (no matter what zoomlevel).

I can elaborate on the problem more if I am a little too confusing !


On 12 August 2010 16:20, Cristiano Sumariva 
<[email protected]<mailto:[email protected]>> wrote:
If it is a display problem why not try create some special symbology to overlap 
one line with another using different symbol strokes. So the user will se that 
are 2 lines overlayed.
2010/8/12 Wim Vanbelle <[email protected]<mailto:[email protected]>>
Hi David,

I read that documentation before though. I was hoping it just hadn't been 
updated... Is this possibly a feature for 6.0 ?

Are there any other ways how one could offset a feature in pixels, rather than 
in lat/long coords?

Maybe I should elaborate on the original problem a little. Consider 2 line 
segments that lie above one another. The general idea is to 'offset' them a 
given x , y value, so they will both display next to one another, rather than 
on top of eachother.

If you would however perform this code simply on lat/long values, it would 
imply, that when scaling your map at the most detailed zoom level, the lines 
would lie very far apart, and when zoomed out, they would appear to lie on top 
of eachother.

I find it hard to believe that I would need to pre calculate all the data in 
order to obtain geometry objects for each zoom level.

Maybe some veterans have some good insight in this :).

On 12 August 2010 15:26, Fawcett, David (MPCA) 
<[email protected]<mailto:[email protected]>> wrote:
Wim,

If you don’t want me to tell you, you will likely want to look at the mapfile 
documentation at: http://mapserver.org/mapfile/style.html

[Spoiler Alert]
You can’t use values from an attribute table to set the value of this property
[/Spoiler Alert]

David.
From: 
[email protected]<mailto:[email protected]>
 
[mailto:[email protected]<mailto:[email protected]>]
 On Behalf Of Wim Vanbelle
Sent: Thursday, August 12, 2010 5:48 AM

To: [email protected]<mailto:[email protected]>
Subject: [mapserver-users] Offset values from database

Hi,

I'm trying to load offset X, Y data from the postgis database.

Each feature has an offset value defined there.

My mapfile (relevant part) looks like this:

In the layer:
                DATA                    "geom_mercator from map_links using 
unique Id using SRID=900913"

                        STYLE
                                WIDTH 6
                                COLOR 0 255 0
                                ANTIALIAS TRUE
                                ANGLE AUTO
                                OFFSET [offsetX] [offsetY]
                        END

Please don't tell me the offsetX, Y values cannot be read from the database. 
That would be a huge issue for me.

Thank you for your time.

Best regards


_______________________________________________
mapserver-users mailing list

[email protected]<mailto:[email protected]>
http://lists.osgeo.org/mailman/listinfo/mapserver-users



_______________________________________________
mapserver-users mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/mapserver-users

Reply via email to