Hi Alan
Your suggestion for a single function which does everything was also my initial
thought, and this function already exists behind the scenes. The prototype is
void
drawmap( void ( *mapform )( PLINT, PLFLT *, PLFLT * ), const char *type,
PLFLT dx, PLFLT dy, int shapetype, PLFLT just, const char *text,
PLFLT minlong, PLFLT maxlong, PLFLT minlat, PLFLT maxlat, int*
plotentries, int nplotentries )
The four frontend functions simply call this backend function with appropriate
variables and the shapetype variable defines whether we want line, text/point
or fill. The reasons why I added the front ends were:
1) Convenience for the user and a simpler front end.
2) It allows us to keep the current plmap function without having to dream up a
non-obvious new name for the new function. plmap in the current implementation
is equivalent to plmapline with plotentries set to NULL to cause all elements
to be plotted .
3) It gives flexibility in the future. Your gradient version is a useful
example. Currently I cannot imagine much need for it, but perhaps in the future
someone might decide they want this feature. To do this we could change the
drawmap function and add a plmapgradient function without breaking the existing
public API.
However if you still think a single function is better I can easily rename
drawmap to something more relevant to our front end. Also if you want to try to
catch more use scenarios then I can easily add a gradient option. Are there any
other versions that may be useful?
Regarding documentation - I will be happy to make the needed changes to the
docbook documentation. I now have Cygwin installed so I should be able to build
the documentation, although when I tried yesterday I wasn't quite successful. I
think because I was trying to build it from a Windows build.
Phil
From: Alan W. Irwin <[email protected]>
To: phil rosenberg <[email protected]>
Cc: PLplot development list <[email protected]>
Sent: Wednesday, 21 May 2014, 18:38
Subject: Re: [Plplot-devel] shapelib find module
On 2014-05-21 04:22-0700 phil rosenberg wrote:
> Hi All
> I've just been able to go back and finish sorting the plmap changes to more
> fully support shapefiles. I just wanted to run the changes past the list
> before I submitted them.
>
> I have left the current plmap function intact. I have added the functions
> plmapline, plmapstring, plmapfill and plmaptex, which are essentially
> equivalent to plline, plstring, plfill, plptex, but the data points are taken
> from a shapefile. These functions can also be passed an array of indices of
> objects which will be drawn, to allow a subset of the objects within a
> shapefile to be drawn (e.g. passing {0, 4, 10} will draw the 1st, 5th and
> 11th object from a shapefile). Passing NULL will draw all objects.
> There have also been some improvements to the speed, quality and reliability
> of wrapping longitudes.
> Example 19 has been updated to show what can be achieved with the changes. If
> anyone would like a patch to test out the changes themselves let me know.
> I have propagated the changes to the C++ binding and the C++ example. But I'm
> at a bit of a loss when it comes to other bindings. If anyone could lend a
> hand there it would be much appreciated.
>
> Assuming nobody has any objections to this change to the public API I will
> submit it later this week.
Hi Phil:
From my overview perspective and realizing I still don't have much map
experience, I am bit concerned about four additions to our API that
have to be documented and propagated. What exactly is the issue that
requires four different functions to draw map objects? I am pretty
sure I can guess the general answer (in short, maps are complex
beasts), but I would like you to expand on that question so we all
understand your motivation here.
Would you need a fifth function or map object attribute to handle
gradients as well or do those never occur in maps?
One possible change to the suggested API might be to consolidate the
four added functions (or five added functions if gradients are a
concern) into one where there is an extra argument to allow the user
to control what map object attributes (line, etc.) are plotted.
A much lower-level API alternative that uses just one additional
function as well would be to implement one plmapdata function that
returned sampled arrays describing map objects which could
subsequently be plotted using plline, etc., in a loop over map
objects. The advantage of this approach is if the plline, etc.,
implementation gets improved in the future, then mapping automatically
benefits without similar code changes having to be implemented in the
"shadow" map routines. But the drawback of course is it is a
lower-level API.
It is your code and you are far more experienced with maps than I am
so your opinion carries the most weight here, but I would nevertheless
like to hear more from you on your motivations for implementing your
new API additions in their present form as opposed to some other
obvious high-level or low-level single-function alternatives that come
to mind.
Note, I don't want you to get the impression from my questions above
that I am negative about your proposed changes at all. For example, I
am very much looking forward to seeing some outstanding new map
examples made part of PLplot. I am thinking in particular about the
Exmoor National Park example you put together.
Alan
__________________________
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________
Linux-powered Science
__________________________------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos.
Get unparalleled scalability from the best Selenium testing platform available
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Plplot-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/plplot-devel