[GLLUG] Re: PHP GD Question

Thomas Alan Hearn hearntho@msu.edu
Fri, 16 May 2003 12:41:01 -0400


The FillToBorder function should work fine, and I would agree that you 
shouldn't do any math in PHP if at all possible, it runs very slowly. 

Cheers,
Tom 

Sean writes: 

> Oh that is a good idea =) Couldnt you use GD fillToBorder() 
> command instead of writing the recurse yourself?  
> 
> You would need to start off with a blank bitmap map, then you could do the 
> fill, and then overlay the county name and % number in it, and finally add 
> the Key wherever you have space left in the image.  
> 
> That actually wouldnt take very long or be to hard if you had a decent 
> bitmap editor that showed you the positions of the pixels and the image 
> didn't have leaky borders to begin with. 
>  
> The sql for the database will be the hardest, since you will want to do as
> much as possible with the sql query ie leave the math OUT of php for speed
> And depending on your dataset, you might seriously consider postgresql
> instead of mysql. I have a gut feeling mysql isnt going to easily handle
> the dataset nearly as easily or as efficiently as postgres will. 
> 
>  
> 
>  On Fri, 16 May 2003, Thomas Alan Hearn wrote: 
> 
>> Lee,
>>   I have worked with GD and PHP as well as MySQL quite a bit, and I would 
>> agree that it would most likely be easier to have predefined colored maps 
>> for the counties of michigan.  Drawing shapes with GD around county borders 
>> could be quite a gruesome task, however it is possible.  One way to do this 
>> is to use a map with borders that are clearly white or black, and write a 
>> script with GD that recursively colors in between two points, checking if 
>> they have exceeded the white or black colors of the border.  Hope this 
>> helps.  
>> 
>> Cheers,
>> Tom Hearn  
>> 
>> 
>> Ex Fed writes:  
>> 
>> > Hello Everyone! 
>> > 
>> > We use models to predict the possiblity of a plant disease or pest 
>> > emergence.  This is based upon an algorithm that takes as input hourly 
>> > weather information to include humidity, temperature and precipitation.  
>> > It requires  seven days of data to calculate this probability. 
>> > 
>> > On a dynamic webpage, I want to display these percentages on the screen 
>> > with a color legend and have the appropriate county on the Michigan Map 
>> > colored corresponding to the statistical probability calculated.  I would 
>> > like the user to be able to select past weeks to see the probability, but 
>> > the default map displayed would show the probability of the past seven 
>> > days. 
>> > 
>> > Does anybody out there know if it would be feasible to use PHP and GD 
>> > somehow to color in individual counties on a State Map image.   The 
>> > coloration would be determined values that were stored in a Mysql database 
>> > or determined by an algorithm that worked upon the values in a Mysql 
>> > database.  Unfortunately, these are not simple rectangles, arcs, squares, 
>> > the counties are pretty complex shapes. 
>> > 
>> > Or would this be a lot of work that might be accomplished by use of a good 
>> > GIS/mapping package?  Does anybody out there have any experiences with GIS 
>> > with Linux / Mysql acting as a server/datasource, serving up dynamic maps 
>> > in users web browsers? 
>> > 
>> > Appreciate your input, 
>> > 
>> > Lee Duynslager 
>> > 
>> > _________________________________________________________________
>> > Add photos to your e-mail with MSN 8. Get 2 months FREE*.  
>> > http://join.msn.com/?page=features/featuredemail 
>> > 
>> > _______________________________________________
>> > linux-user mailing list
>> > linux-user@egr.msu.edu
>> > http://www.egr.msu.edu/mailman/listinfo/linux-user
>>   
>> 
>> _______________________________________________
>> linux-user mailing list
>> linux-user@egr.msu.edu
>> http://www.egr.msu.edu/mailman/listinfo/linux-user 
>> 
>