Judd,
On Mon, Apr 19, 2010 at 1:45 PM, Judd Taylor <[email protected]> wrote:
> Puneet,
>
> Thanks for posting your experiences in using this module.
Thank *you* for making this module. After beating my head against the
PDL::Graphics::* modules, your little module is the one that brought
some relief to me. Now I realize, I don't really need those Graphics
modules. As Chris explained, they are for "drawing and displaying" the
images, while ::IO::GD is for generating those images in the first
place. Since my choice of drawing and displaying the images is the
browser, I really don't want the ::Graphics::* stuff, I guess.
In other words, thank you again for making this.
..
>
> Finally, for your database problem. If I was using Class::DBI, I would
> do a:
>
> foreach ( DBI::FooTable->search({ $var => $want_val }) )
> {
> $im->plot( $color, $_->x, $_->y );
> }
> (with the exception that there using the PDL interface you've been
> talking about would probably be able to get around using that explicit
> foreach loop)
>
Right, and the above is why I would want to use a "database --> PDL
--> image" route. For example, once I get the values out, I might want
to expand the arrays (you might recall my recent "challenge" or
resampling a piddle) based on my image size and my Proj transformation
(Wisconsin Transverse Mercator, in my current case). For example, I
want an image that is 1000 px x 800 px. That image, in my projection,
represents, say, 500 kms x 200 kms. So, each km is represented by 2
pixels on the x axis and 3 pixels on the y axis. My data in the db is
for one km cells, so I need to resample my data by 2 and 3 in each
direction. I can do that with that little bit of magic that Chris
Marshall suggested (see
https://sourceforge.net/apps/mediawiki/pdl/index.php?title=Resampling_up_a_piddle)
Doing this (and other such manipulation would be probably easier in
PDL. This, plus, I also have to assign the colors based on the values
I have extracted from the DB and whatever my color scheme happens to
be. Ideally, I would like to provide some of the functionality that is
present at colorbrewer.org for choosing color schemes.
> I think you're using something similar to Class::DBI, so it should be
> possible to do the same type of thing within the framework of the
> package you're using.
>
> I think you should use the database engine to do the searching through
> the data, as it is built for doing just that, and it should be more
> reliable and (possibly a lot) faster than doing it directly in perl or
> PDL.
>
> Do a select unique records on the $var column, and then do a select on
> each of the unique values of that column, and then plot the results.
>
>
> Thanks,
> Judd
>
> On Mon, 2010-04-19 at 09:45 -0500, P Kishor wrote:
>> I have three generic questions about PDL's interface with GD -- I am
>> motivated by the logic that if I am confused, other n00bs will also be
>> confused -- and an actual methodology question.
>>
>> 1. (Very minor point). PDL::IO::GD's author is listed as "Judd Taylor"
>> and yet, it appears under the "Chris Marshall" namespace.. well,
>> actually, the PDL namespace which is under Chris Marshall as the
>> author. I guess that may be because all the PDL packages appear under
>> http://search.cpan.org/~chm/PDL-2.4.6_001/, but I wonder if there
>> might be some better way to "brand" them. Perhaps under the "Author"
>> section list the actual authors' name *with* some clarifying text.
>>
>> 2. (Minor point). Why are PDL's interfaces with various graphics
>> libraries under PDL::Graphics::*, but PDL's interface with GD is under
>> PDL::IO::*. On top of that, PDL::IO::GD is actually listed under the
>> "Documentation" sub-heading rather than under the "Modules"
>> sub-heading. This is fairly confusion inducing. Is there a method to
>> this madness? Shouldn't this be under the "Modules" sub-heading, and
>> named as PDL::Graphics::GD?
>>
>> 3. (Major point). Right now, at least on the Mac, at least for me, PDL
>> is severely crippled because of its (my) inability to successfully
>> build PDL with either PGPLOT or with PLplot. However, PDL::IO::GD
>> works very well, but is also severely crippled because of its almost
>> non-existent documentation. Almost a third of the documentation
>> consists of "$image->INSERT_NAME_HERE( INSERT_DOC_ARG_LIST_HERE )"
>> which doesn't help, and also lacks a lot in terms of generating
>> confidence in a n00b. To the extent that I have been able to figure it
>> out, PDL and GD seem to work very well, so it would be really nice to
>> have good docs for it. I would be happy to write up the docs *if* I
>> can figure out myself. I have been poring through the source code, but
>> if I really had to read the source code of libgd to understand how to
>> use it, it would be pointless trying to use Perl.
>>
>> 4. Finally, my question re. using PDL::IO::GD. I have a PDL
>> constructed out of a query from a db. It looks like so
>> $a = [
>> [$var, $x, $y]
>> [$var, $x, $y]
>> ..
>> ];
>>
>> I want to create a lookup table based on the values of $var (a generic
>> lookup table might not help, because the values may be very different
>> for different vars), and generate an image coloring every $x and $y
>> pixel in the image based on the value of $var and its corresponding
>> color in the lut. How do I go about doing that?
>>
>> Many thanks in advance,
>>
> --
> ____________________________
> Judd Taylor
> Software Engineer
>
> Orbital Systems, Ltd.
> 3807 Carbon Rd.
> Irving, TX 75038-3415
>
> [email protected]
> (972) 915-3669 x127
>
--
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
=======================================================================
_______________________________________________
Perldl mailing list
[email protected]
http://mailman.jach.hawaii.edu/mailman/listinfo/perldl