SiteMinder / Webhosting
The Computer Merchant, Ltd
US-MA-North Quincy

Justtechjobs.com Post A Job | Post A Resume

GIS Mapping with PHP; Part Two
Getting it all in.
We have downloaded an outline map of PEI from http://geogratis.gc.ca/ . I won't give to the exact link as its good for you to browse around and get an idea of what data is available ( sorry, thats the school teacher in me - just remember to look for data in GEOG format, not LAMB. I could tell you why, but I'd have to shoot you.)
Next we have convert our E00 data into Mapinfo MIF using Mapinfos Universal Translator ( or some free utility on the web ). Although it doesn't really matter, try and keep all your projections constant when converting the data. Though in the MIF file the coordinates will look the same and will work for us, if you use different projections it can get messy if you ever decide to edit the files in Mapinfo at a later date.
So lets get the data into PHP. For this article our mission is to plot the location of my house on an outline map of Prince Edward Island. Why Prince Edward Island? Well, I live there and it is also has a smaller polygon count compared to other provinces. I'm gonna be nice to you all .... download the PEI MIF file here.
Sit down, have a piece of cake and get ready for the next part.
At it's most basic ( and minus a bunch of header information ) the MIF format looks like this:

 DATA
{VECTOR TYPE} {NUMBER OF SUB-REGIONS} {POINTS IN SUB-REGION 1} {LONGITUDE} {LATITUDE} {... POINTS IN SUB-REGION 2} {LONGITUDE} {LATITUDE} {VECTOR TYPE} {NUMBER OF SUB-REGIONS}> {POINTS IN REGION} {LONGITUDE} {LATITUDE} etc etc
  ie ( a 'Region' type is basically a set of polygons )
      Region 1
  3 
  -63.778904 46.515854
  -63.790916 46.518894
  -63.796062 46.524384
  Region 2
  3 
  -63.778904 46.515854
  -63.790916 46.518894
  -63.796062 46.524384
  4
  -63.778904 46.515854
  -63.790916 46.518894
  -63.796062 46.524384
  -63.796062 46.524384
[ Next Page ]

[Page 1]  [Page 2]  


Comments:
Good CallShawty07/28/09 21:10
problem:how to open dbf file using php muhammad ali08/03/05 20:17
help megigin ginanjar07/06/05 10:21
read mapinfo map with servletneo06/08/05 17:53
map imge creation with phpWondimagegn Desta04/28/05 17:06
locating with strings.chandra02/25/05 11:35
mapping to raster imagesDave04/01/04 08:30
.. a few comments ...Simon Moss03/06/04 19:50
Open Source GISPaul Ramsey02/28/04 16:42
MapServerbosmeeuw02/28/04 13:51
Free Desktop Mapping ToolsLuke Lincoln02/10/04 17:14
Kudos to SimonWorth Sparks02/10/04 12:09
Edits ...Simon Moss02/09/04 19:12
 

If you are looking for help, please post on the appropriate forum here. Your questions will be answered much more quickly.

Add A Comment:

Name:

Email:

Subject:

Message:

To reduce spam posts, messages are now manually approved

You are not [logged in]. That means your account will not get credit for this post.