[mapserver-users] Offset values from database
Wim Vanbelle
wimvanbelle at gmail.com
Thu Aug 12 11:45:18 PDT 2010
Thank you very much everyone. And especially Thomas. That was indeed what I
was looking for. You saved me a lot of work!
Much appreciated.
On 12 August 2010 17:50, Fawcett, David (MPCA) <David.Fawcett at state.mn.us>wrote:
> Thanks Thomas
>
> That looks nice in my test example.
>
> David.
>
> -----Original Message-----
> From: thomas bonfort [mailto:thomas.bonfort at gmail.com]
> Sent: Thursday, August 12, 2010 10:45 AM
> To: Fawcett, David (MPCA)
> Cc: Wim Vanbelle; mapserver-users at lists.osgeo.org
> Subject: Re: [mapserver-users] Offset values from database
>
> the -99 is a special offset value that shifts the line as you are looking
> for.
>
> style
> color 255 0 0
> offset -2 -99
> width 2
> end
> style
> color 0 255 0
> offset 2 -99
> width 2
> end
>
>
> not perfect as there are artifacts on sharp angles, but worth a try.
>
> regards,
> thomas
>
> On Thu, Aug 12, 2010 at 16:56, Fawcett, David (MPCA)
> <David.Fawcett at state.mn.us> wrote:
> > 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: mapserver-users-bounces at lists.osgeo.org
> > [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Wim
> Vanbelle
> > Sent: Thursday, August 12, 2010 9:32 AM
> > To: mapserver-users at lists.osgeo.org
> > 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 <wimvanbelle at gmail.com> 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 <sumariva at gmail.com> 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 <wimvanbelle at gmail.com>
> >
> > 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) <
> David.Fawcett at state.mn.us>
> > 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: mapserver-users-bounces at lists.osgeo.org
> > [mailto:mapserver-users-bounces at lists.osgeo.org] On Behalf Of Wim
> Vanbelle
> > Sent: Thursday, August 12, 2010 5:48 AM
> >
> > To: mapserver-users at lists.osgeo.org
> >
> > 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
> >
> > 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/20100812/b878cfe6/attachment.htm>
More information about the MapServer-users
mailing list