Re: Building a botanical tree of wood

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



First, "in the meantime" while deciding on how to do this in a database 
fashion, you should at least be trying to store your data in a 
spreadsheet or some other format that can be easily imported into a 
database.

In the past, I've done this with Excel or other spreadsheets.. or even in a 
text file that's formatted in such a way that you can either write a PHP 
script to import or even turn the text file itself into a PHP script that 
generates the INSERTs and such.

Using a text editor like Crimson Editor, you can create macros to easily 
transform thousands of lines of data into PHP code or something useful.  
Just hit RECORD, perform the predictable edits you'd need to do on a few 
lines.  Stop recording.  Then just hold down the macro key that executes 
the actions.   Take a nap until it's done.  Release keys.  hah   Yeah, 
crude, but it's come in very handy a few times.


On to coding...  since what you're doing is fundamentally simiar to a 
family tree and since that's a more common application, you might look 
into some of the apps already made that handle people's family trees.   
There's a family tree data format called "GEDCOM" you might look into and 
there's at least one free PHP based family tree app called PHPGedView:  
http://www.phpgedview.net/


If you really wanted to roll your own, then you could also research methods 
of handling threaded conversations like on message boards, since that's 
going to be a similar algorithm..  with parent and child messages/data 
which also allows sibling messages (children of same parents).


Good luck, however you plan on executing this.  I know I didn' answer your 
questions directly, but I think some of these suggestions may indirectly 
answer the questions.  :)

-TG

----- Original Message -----
From: Bill Mudry <billmudry@xxxxxxxxxx>
To: PHP Windows Forum <php-windows@xxxxxxxxxxxxx>
Date: Thu, 05 Feb 2009 10:44:43 -0500
Subject:  Building a botanical tree of wood

> Greetings to all,
> 
> I was subscribed a couple years ago to this group and got busy with 
> other priorities until recently. Since then, I have learned more PHP,
> at least to the point that I do get things to work at times but not a 
> proficient coder yet.
> 
> In another strong interest and endeavor, I have spent about 7 years 
> researching (via books, Internet, etc.) and recording as many woods
> and woody plants of the world as I can. I started with a text file 
> and this has grown to a massive 5.8 meg. plus in size (over 151,000 
> lines!). My research will not stop so, with such a huge knowledge 
> base, the longer I wait for a conversion over to a database driven 
> receptacle for
> all this data, the more horrendous will be the job of hand bombing 
> all that data into the new PHP/MySQL application. There is, therefore,
> a certain urgency to finally build this knowledge base repository. 
> For ease of conversation, I nicknamed the file my TAXA (short for
> "Taxonomy") and thereby the name also for the research project.
> 
> There are 4 levels of organization with each level in a one to many 
> set of relationship --- like a large upside down tree structure. The
> names of these levels are the same as used in scientific naming of 
> living things, namely order, family, genus and species. Anyone
> who has taken any biology or botany will probably quickly relate to 
> this. Eventually, I wish to be able to travel up and down this data
> tree and be able to display recorded information for each element 
> stored. For now, I will be content to be able to travel from highest
> level (ie. order) all the way down to showing details of individual 
species.
> 
> I had a number of months where priorities took me away from all this 
> but I am back in earnest determined to get this done.
> At each level, one element has its information displayed with all 
> relevant subservient elements listed below so you can click on one and
> proceed down to the next level and show the details on that element 
> (and on and on right down to the species level that has the most
> details for any level -- even photos of what that wood looks like 
> when available). As we drop down from Order to Species, the number of
> elements grows exponentially:
>          Woody Orders - about 95 --------> Woody Families
>          Woody Families - about 435 -------> Woody Genera (singular: 
"Genus" )
>          Woody Genera  - over 3,300 --------> Woody Species
>          Woody Species - 10,000 and more.
> 
> Even at the top Orders level, it makes sense to have the data show in 
> columns and pretty much mandatory any place below this. In my
> prior efforts before I had to break off for a spell (... months ago), 
> I actually was able to write code that would count the number of elements
> in a table and make columns of proper length.  I wasn't quite be 
> successful in populating data properly in those columns from table
> ---- close but no bananas (or --- err --- should that be woods).
> 
> If you got this far reading, much thanks. I know this may seem a bit 
> long winded but at least you will know just where I am coming from.
> With that behind, now I can ask some questions that might help:
>          1 - Does anyone have code that can read names from a MySQL 
> table and present it in columns?
>          2 - Each element displayed is not just static text. Clicking 
> on one would look up data on it and display it (numerous fields).
>          3 - Then the format as in #1 displays the elements 
> subservient below that --- all the way from order to finally full details 
of a
>               wood at species level.
> 
> Any code suggestions? This all needs to be dynamically reading data 
> from MySQL tables, displaying it and then letting a user choose
> from a list an element in the next lower level (except species --- 
> end of the line). I am reasonably convinced that the code can be similar
> at the different levels and can be largely modularized and semi 
> repeatable at each level.
> 
> Hope I didn't scare everyone away with such a long introduction ;-) . 
> I look forward to seeing what you have to say.
> 
> With thanks in advance,
> Bill Mudry
> Mississauga, Ontario Canada


-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux