Hi,

On 31.05.06, trevorw wrote:
> I'm very happy with the graphs I've produced with PyX and not entirely
> happy with the maps I've produced using GMT, so I'm wondering if anyone 
> has used PyX for generating maps using the drawing functions.
> 
> I was thinking of writing something which would draw PostGIS data using
> PyX, in which case I was going to convert the PostGIS objects to text
> and convert them to canvas draw commands. If this were to work nicely, I
> would then want to try getting output from GRASS using swig Python
> interface.
> 
> Any suggestions or comments about this would be appreciated.

For the moment I suggest to just use the basic drawing capabilities of
PyX and do your things yourself. On the other hand there could be some
very different solutions in the future. There's even some funny code
in PyX already. You can download some map data from
http://sepwww.stanford.edu/ftp/World_Map/ and run the following code:

    from pyx import *

    g = graph.graphxy(width=10, height=10,
                      x=graph.axis.lin(min=5.5, max=15.5),
                      y=graph.axis.lin(min=45.5, max=55.5))
    g.plot(graph.data.cbdfile("Map/europe.Map/cil.cbd", x=1, y=2),
           [graph.style.line([style.linewidth.THIN, color.rgb.blue])])
    g.plot(graph.data.cbdfile("Map/europe.Map/riv.cbd", x=1, y=2),
           [graph.style.line([style.linewidth.THIN, color.rgb.blue])])
    g.plot(graph.data.cbdfile("Map/europe.Map/bdy.cbd", x=1, y=2, maxrank=1),
           [graph.style.line([style.linewidth.THIN, color.rgb.red])])
    g.writeEPSfile("maptest")
    g.writePDFfile("maptest")

For the moment we don't have proper graph geometries for the usual
geographic mappings and the cbdfile code was just some finger exercise
to see what the pstricks people always use for their maps (well, they
use some preprocessed (converted to PostScript) version of that data).
I'm not at all aware of other data sources and this really just is
some experiment (also in order to learn more on what kind of
functionality a graph should have in terms of graph geometries).

Overall I would really like to see some experiments with creating maps
out of some data sources I may not even know about yet. Those
experiments may use PyX just for simple drawing (or may not even use
PyX at all and still one could learn a lot from those experiments or
just the evaluation of other solutions). So while I do not have any
really useful code for the moment, I would very much like to know
about your experiments ... :-)


André

-- 
by  _ _      _    Dr. André Wobst
   / \ \    / )   [EMAIL PROTECTED], http://www.wobsta.de/
  / _ \ \/\/ /    PyX - High quality PostScript and PDF figures
 (_/ \_)_/\_/     with Python & TeX: visit http://pyx.sourceforge.net/


_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to