Creating a graphical map with dynamic population?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Serengeti
Forum Newbie
Posts: 19
Joined: Sat Jan 22, 2005 1:58 am

Creating a graphical map with dynamic population?

Post by Serengeti »

I envision a map of the USA divided into the 50 states. Each entry in our database has a state designated. I would like to create a map that will display the database information inside each state's border. Of course the smaller NE states would be out to the right.

Is this possible? How do I start something like this?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

this is the general idea:

gather positional information to create a rectangle to draw the text into. Use the text graphics functions to determine the size required for a particular state's data. If the size is too large, you need to draw a line to the nearest edge followed by the data for that rectangle area. It's not very simple unless you make a lot of assumptions and things.
Serengeti
Forum Newbie
Posts: 19
Joined: Sat Jan 22, 2005 1:58 am

Post by Serengeti »

one key piece i forgot to mention...the total population is 287 ;) so there will probably never be a 3 digit number in any state

but thanks for the info, i'll start researching the text graphics functions...i knew there was a specific part of php that dealt with this, just didn't know what it was called so I was lost on what to search for ;)
Post Reply