[Mapserver-users] Using MapServer as a general graphing engine

Daniel Morissette morissette at dmsolutions.ca
Mon Jul 28 15:29:00 EDT 2003


Tyler Mitchell wrote:
> 
> I'm thinking more along these lines:
> 
> - I have x,y data where these are two non-geographic values that I want to
> graph.  I have z which is the magnitude, count, etc. that I want to graph.
> - Use a simple coordinate system to map the "location" of the x,y pairs and
> draw the symbol based on the z value.
> - z may be a value used as a radius for a circle or there may be a z- and
> z+ which defines the vertical offsets of the extents of a bar/rectangle.
> 

Actually, instead of a full integration with GDChart as suggested in my 
previous message, we could add support in MapServer for symbols that 
come from an URL, and this URL could contain [field] replacements, 
similar to what we can do with query template URLs already.

So you could define a layer like this:

   LAYER
     CLASS
       ...
       SYMBOL 
"http://127.0.0.1/cgi-bin/owtchart?type=pie&numpts=3&vals=[VALUE_A]![VALUE_B]![VALUE_C]&xlabels=A!B!C&w=400&h=400"
     END
   END

This wouldn't be very fast, but would work fine for relatively small 
number of symbols.  When MapServer encounters a symbol name that starts 
with http:// then it would do the field value replacements ([VALUE_A], 
[VALUE_B] and [VALUE_C]), and then call the URL to download the symbol, 
a chart in this case.

Another benefit of this approach is that you could link to about 
anything that can dynamically generate images, not just charts.

Daniel
-- 
------------------------------------------------------------
  Daniel Morissette               morissette at dmsolutions.ca
  DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------




More information about the mapserver-users mailing list