Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dynamic charting capabilities to mapserver #1800

Closed
mapserver-bot opened this issue Apr 3, 2012 · 15 comments

Comments

@mapserver-bot
Copy link

commented Apr 3, 2012

Reporter: thomas.bonfort@gmail.com
Date: 2006/06/13 - 16:30
Trac URL: http://trac.osgeo.org/mapserver/ticket/1800
In order to output thematic maps, dynamic charting features in mapserver would
be nice to have in mapserver. Such charts could include pie charts or bar
graphs, for example.

@mapserver-bot

This comment has been minimized.

Copy link
Author

commented Apr 3, 2012

Author: thomas.bonfort@gmail.com
Date: 2006/06/13 - 16:47

the proposed patch:
- adds a new layer type, namely "CHART"
- implements simple pie charts from values taken from the SIZE or SIZEITEM
values of each class belonging to the layer

open questions:
- the chart type (pie, bar, ...) and the size of each chart are specified in
PROCESSING attributes, even if only PIE types are implemented. maybe specific
attributes should be defined.
- the values of each class are  taken from the size/sizeitem of the
corresponding STYLE, which is semantically awkward.
- should the drawn charts be considered as labels or symbols, and cached to
avoid overlap?

an example of such a layer is:

LAYER
    NAME "ages"
    TYPE CHART
      CONNECTIONTYPE postgis
      CONNECTION "blabla"
      DATA "the_geom from demo"
    PROCESSING "CHART_TYPE=pie"
    PROCESSING "CHART_SIZE=30"
      STATUS ON
      CLASS
           NAME "population age 0-19"
          STYLE
        SIZEITEM "v1006"
        COLOR 255 244 237
    END
      END
      CLASS
          NAME "population age 20-39"
          STYLE
        SIZEITEM "v1007"
        COLOR 255 217 191
    END
      END
      CLASS
          NAME "population age 40-59"
          STYLE
        SIZEITEM "v1008"
        COLOR 255 186 140
    END
      END 
 END

note that the values "v1006" etc... aren't scaled to a specific value
@mapserver-bot

This comment has been minimized.

Copy link
Author

commented Apr 3, 2012

Author: dmorissette
Date: 2006/10/04 - 22:30

I had a quick look at the patch and it seems to be missing the
msDrawChartLayerGD() function. Do you already have code to render charts? How do
you plan to do the rendering?

Doing basic pie charts is simple, but when it comes to other chart types and
properly labelling the values/axis or doing 3-d effects then it quickly becomes
more involved. There are already a few libs for rendering charts. Ideally we
should see if it's possible to reuse an existing chart rendering lib, that would
give us more powerful charting without having to reimplement everything ourselves.
@mapserver-bot

This comment has been minimized.

Copy link
Author

commented Apr 3, 2012

Author: dmorissette
Date: 2006/10/06 - 20:20

OWTChart is just a CGI wrapper around the gdchart library, which is where all
the chart rendering logic is located. Since the original gdchart library was too
messy to be usable, the OWTChart package includes a gdchart2 directiory which is
an adapted version of gdchart with most of the portability issues fixed. It
takes a struct with the chart config details as input and draws the chart to a
gdImage.

I think it would be possible to use the gdchart2 sub-directory from MapServer,
but then we'd need to package and maintain gdchart2 as a new package and I'm not
sure if that's worth the investment.

I was kind of hoping that there might be another C/C++ lib that has more life
around it and that could be used as an alternative, but I do not have any
pointer to offer at the moment.

All this being said, since you already have the code working then I do not have
a strong objection to using your code instead of a specialized lib.
@mapserver-bot

This comment has been minimized.

Copy link
Author

commented Apr 3, 2012

Author: sdlime
Date: 2006/11/29 - 08:33

Dan: Have you installed and tried this out? I plan to this week...

Steve
@mapserver-bot

This comment has been minimized.

Copy link
Author

commented Apr 3, 2012

Author: thomas.bonfort@gmail.com
Date: 2006/11/29 - 11:31

rendering of small diameter arcs in gd is /horrible/ , especially with
even-sized diameters.
I'll work on the equivalent with imagemagick/agg when/if they are incorporated
with ms
@mapserver-bot

This comment has been minimized.

Copy link
Author

commented Apr 3, 2012

Author: dmorissette
Date: 2006/11/29 - 16:18

No, I haven't had time to play with this... it's all yours Steve.
@mapserver-bot

This comment has been minimized.

Copy link
Author

commented Apr 3, 2012

Author: dmorissette
Date: 2007/06/15 - 23:19
I have created MS RFC 29 for this:

http://mapserver.gis.umn.edu/development/rfc/ms-rfc-29

@mapserver-bot

This comment has been minimized.

Copy link
Author

commented Apr 3, 2012

Author: dmorissette
Date: 2007/07/09 - 15:05
I have committed in 60a2149 (r6279) the code from Thomas with a few fixes/changes to bring it up to date with MapServer 4.99.

What's left to do:

  • End-user documentation.

And two future enhancements were derived from this ticket:

  • #2136: Add ability to read chart size from an attribute
  • #2145: Add support for point/line layers (currently only polygon layers are supported).

We'll keep this bug open until documentation is done. Bugs or other enhancement discussions should get their own tickets.

@mapserver-bot

This comment has been minimized.

Copy link
Author

commented Apr 3, 2012

Author: dmorissette
Date: 2007/07/12 - 19:55
I had to change mapogr.cpp in 19b5c86 (r6299) to return the real geometry type for CHART layers as was done for postgis and mygis layers. None of the other input drivers seen to require this change.

@mapserver-bot

This comment has been minimized.

Copy link
Author

commented Apr 3, 2012

Author: tbonfort
Date: 2007/07/30 - 12:23
I created a howto documenting dynamic charting here: http://mapserver.gis.umn.edu/docs/howto/dynamic-charting

@mapserver-bot

This comment has been minimized.

Copy link
Author

commented Apr 3, 2012

Author: dmorissette
Date: 2007/07/31 - 16:45
Thanks for the howto! I added a link to it in RFC-29.

@mapserver-bot

This comment has been minimized.

Copy link
Author

commented Apr 5, 2012

attachment http://trac.osgeo.org/mapserver/attachment/ticket/1800/chart.diff :

   intial functionnality for pie charts
@mapserver-bot

This comment has been minimized.

Copy link
Author

commented Apr 5, 2012

@mapserver-bot

This comment has been minimized.

Copy link
Author

commented Apr 5, 2012

attachment http://trac.osgeo.org/mapserver/attachment/ticket/1800/bug1800.patch :

   Patch updated to work with current (4.99) SVN trunk
@mapserver-bot

This comment has been minimized.

Copy link
Author

commented Apr 5, 2012

attachment http://trac.osgeo.org/mapserver/attachment/ticket/1800/mapchart.c :

   mapchart.c updated for current (4.99) SVN trunk

@ghost ghost assigned dmorissette Apr 5, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.