Donut Symbol.

Bill Binko bill at BINKO.NET
Fri Aug 26 15:19:32 EDT 2005


Another approach is to handle this on the data side: either in Mapscript 
or in the database if your data is in PostGIS (and perhaps through OGR: 
Frank?)

What I do for this is simply have the data set return a buffer() around 
the point and then display the layer as a POLYGON rather than a point.

So, if your original data was in PostGIS and your DATA line was: 

DATA "myPoint from (SELECT oid, myPoint from myTable WHERE someField = 
      'someValue') as foo using unique oid using SRID=1234"

You could just change that to: 

DATA "myPoint from (SELECT oid, buffer(myPoint, myRingsize) from myTable 
      WHERE someField = 'someValue') as foo using unique oid using SRID=1234"

and change your layer from POINT to POLYGON

I don't know if OGR can do buffer(), but certainly you could look into it.

Bill



On Fri, 26 Aug 2005, Steve Lime wrote:

> A dynamic donut is not possible given the way MapServer currently works.
> 
> The way point symbols work is that a raster marker image is rendered based
> on the properties of the symbol and a SINGLE style. So this has to be accomplished
> within the context of a symbol definition or a style definition. Multiple styles will not
> help you because the base circle would already obscure anything underneath it.
> 
> We could change the way an ELLIPSE symbol is rendered so that if you have 
> additional second set of radii defined then that defines the hole. But the problem
> still remains that you need to specify sizes for the inner and outer ring which would
> involve changes to the style object- yuck. 
> 
> One could look at rendering all styles at once as well rather then in turn. You'd just
> define the hole somehow as a style. Nice idea but not doable at the moment.
> 
> I wonder if a better approach would be to think about this particular problem as
> an exercise in combining a couple of maps. You certainly can use MapServer to build
> the base image, and you can also use MapServer to draw the rings in a seperate
> images (draw the big ring, and then draw the hole using the background color for
> the whole image). You just need to figure out how to combine them.
> 
> You could use DHTML or MapScript to do this. I bet there's a way to do it using straight
> CGI (draw the rings as a raster layer in the second map) if we knew more about the
> application. For example, you might create the ring image and then refer to it as a
> layer in the base image. With AJAX you could do that using the CGI.
> 
> Steve
> 
> >>> Blammo <bob.basques at CI.STPAUL.MN.US> 08/26/05 11:46 AM >>>
> Jeff,
> 
> I tried that already.
> 
> What I'm basically after is a sysmbol that is a empty circle with a 
> thickness aplied to the line.  Ideally it would be a symbol like 
> anyother that I could apply a COLOR and OUTLINECOLOR to.
> 
> Paco's idea of the close "u" shap would work if I didn't need to outline it.
> 
> I also ran into another slight problem as well (may Paco has some ideas 
> about this too.)
> 
> I was trying to use this symbol as a distance measuring tool.  but 
> seemed to run into a snag with a size limit.   I couldn't get the symbol 
> to go over a certain pixel size.   The circle is supposed to represent  
> a distance buffer in miles (ground units).
> 
> If I zoom in too close, the symbol won't get any larger than a certain 
> size,  about 500 pixels I would guess.   I actually have three of these 
> symbols stacked on top of each other for different distances.   But the 
> size of the symbol grow as I zoom in, but once I hit this max pixel 
> size, the sysbol stop growing at this approx 500 pixel size.
> 
> Thanks
> 
> bobb
> 
> 
> 
> Jeff Portwine wrote:
> 
> >I haven't tried this , so it may not work, I've always used filled in 
> >shapes.. but couldn't you just use a non-filled in circle:
> >
> >SYMBOL
> >  NAME "circle"
> >  TYPE ellipse
> >  FILLED false
> >  POINTS
> >    1 1
> >  END
> >END
> >
> >and then set its size appropriately?   I'm not sure if there is a good way 
> >to affect the thickness though, other than stacking several of them with 
> >varying sizes.
> >
> >-Jeff
> >
> >----- Original Message ----- 
> >From: "Bob Basques" <bob.basques at CI.STPAUL.MN.US>
> >To: <MAPSERVER-USERS at LISTS.UMN.EDU>
> >Sent: Thursday, August 25, 2005 5:39 PM
> >Subject: [UMN_MAPSERVER-USERS] Donut Symbol.
> >
> >
> >  
> >
> >>Does anyone know of a good way to make a donut symbol.
> >>
> >>I need to be able to resize a symbol that is basically a donut.  Where the 
> >>donut part is semi-opaque, and the center is open.  It's basically a 
> >>min/max distance from a point overlay.  I have the dynamic handing off of 
> >>the sizing handled already, but haven't figured out a good way to make a 
> >>filled donut symbol.
> >>
> >>I did mange to make a stacked symbol, but I would really like to have the 
> >>center no be filled in, only the area between the MIN/MAX distance from 
> >>the point picked.
> >>
> >>Thanks
> >>
> >>bobb
> >>
> >>    
> >>
> >
> >
> >  
> >
> 
> 



More information about the mapserver-users mailing list