altering the value of
$scaleyou can zoom in and out. By adding/subtracting
$min_yyou can provide scrolling. You could also just
save the image and use it as a base map for other maps or as a server side cache
to speed things up. Tidy it up in Photoshop or add custom symbols for even better
base maps with no copyright as you made it!!!!. Take it out to dinner and let
it meet your parents.
have a bunch of MIF files ( or one big one ) containing the whole of North America,
or even the world. Then you have a scalable, scrollable map of the freakin’
world! But before you go off celebrating, there are a few things to remember.
Don’t stress out PHP
are not far off doing some major number crunching here. PEI is the smallest
province around ( awwww .. cutie!!! )… when you get to a complicated region
like Quebec with 30000 polygons in it ( or even the world ) .. things really
start to get slow … very slow. These problems will be addressed in the next
article as we let POSTGRESQL do some of the hard work, and we also talk about
making a custom PHP module in C to do some of the donkeywork. However, as a
work-around, consider the following options/modifications:
Make a bunch of scale dependant MIF/E00 file. You are looking at PEI at a scale
of 100000 – you don’t need all that coastline detail. So create another MIF
file with less details, and load it dependant on a preset scale range ( ie pei_1_to_60000.mif,
pei_60000_to_100000.mif and so on ).
( and you said that code wasn’t being used .. shame on you ), feel free to use
them. If a polygon is outside your display, don’t bother with it. Don’t convert
it and don’t display it! ( this is dealt with in the next article along with
a “reverse” getlocationcoords for this purpose ). This is where a
GIS tool comes in handy. Calculate the scale/size you use most often and split
your map into chunks that just cover that area.
to a script on most PHP installations is not enough to handle a large MIF file
with thousands of polygons ( like British Columbia ). POSTGRESQL will cure some
of this, but try to split large maps into smaller chunks. You can then filter
them in the LoadMIF program ( with some tweaking ).
of POSTGRESQL. You want roads? Where we’re going we don’t need roads, but I
show you how to plot them anyway. And maybe we’ll do some work on caching …
you never know.
conversion tools. All the things you need are out there for free, just look
for them. Thats how I found them.