I have no experience with GIS whatsoever. I really know squat about it.
I'm currently working on a project to plot locality data for wildlife on a map of Shasta County. This is for a new herpetological club that hopes to track strength of our local herp populations, since it seems evident that in the last 20 years we lost one species of frog and are close to losing another (probably less than 100 left and they don't seem to be successfully breeding) and the declines were known, but the extent of the declines was not known well enough until it was too late. We want to try and prevent that with other species in our county by keeping records of where they currently are and where they use to be but are no longer found. When we see what appears to be shrinking range, we can investigate and if need be, request surveys by wildlife management before it is too late.
Basically - the data will be plotted as a grid of regular hexagons. When locality information (museum record or photo voucher record in our own database) exists, the hexagon the record sits in gets drawn a pretty color (depending on type and age of records).
I have it working on a raster (jpg) map where I guessed the latitude/longitude borders - working well enough with sample data that I know my php code works, but while it is ballpark accurate I need to do it with maps of known values.
Quick and dirty option - obtain (possibly pay for) a large (at least 2k pixels wide) raster map with known lat/lon borders that has the county outline, major lakes and rivers, nothing else. The maps could be made and then resized for web view. The major problem with that model is that drawing colored hexagons near the county border and near rivers will make it more difficult to see them, thus making it harder to interpret the map.
What I would prefer to do -
Draw my data hexagons on a blank slate [ via imagecreate(width,height) function), then draw the county border on top of that, and then on top of that either draw the lakes/rivers and/or basic topographical lines.
My preference obviously includes getting data sets for those things (county border, lakes/rivers, topography) in a format that I can parse with php to draw them with gd.
My county does have some GIS data available: http://www.shastagis.co.shasta.ca.us/gissearch/search_new.aspx
I don't have a clue how to get that data into format useful for drawing with gd via php.
Anyone have experience with this? Can anyone recommend a (preferably free) Linux GIS program that works on CentOS that could potentially convert data files into format useful for drawing with gd?
I don't need to get fancy with zoom, rotate, etc. capabilities - just a basic static flat map output.
Thanks for any suggestions. I may try to find a "GIS for dummies" type book, though I've generally not been fond of dummy books, I kind of feel like one when it comes to GIS.
I don't know much about GIS software, but I gather that there is an extensive set of extensions to PostgreSQL known as PostGIS which provide a very powerful set of primitives for storing and processing large sets of GIS data.
At 23:44 -0800 22/12/08, Michael A. Peters wrote:
Thanks for any suggestions. I may try to find a "GIS for dummies" type book, though I've generally not been fond of dummy books, I kind of feel like one when it comes to GIS.
Hi Michael,
If you get no satisfactory answers here, you might try talking to the Antiquist group (http://www.antiquist.org/ and http://groups.google.com/group/antiquist) who work extensively with GIS and open source tools.
Regards Simon
Dear Micheal,
are there any good reasons not to use a normal cartesian grid? I can no tremember any GIS software that can use haxagonal tiles as a raster.
Anyway, there is quite a lot of GIS software that you can obtain via EPEL [http://fedoraproject.org/wiki/EPEL].
In case you want to publish geographical informations, do yourself a favor and use some of the many excellent tools out there, have a look at http://www.osgeo.org. A good part of the world's leading open source GIS people works on those projects.
Some, trying to summarize: If you want to keep your data on a database, go with PostgreSQL and PostGIS or SQLLite with it's spatial extensions.
If you want to work with desktop applications, have a look at QGIS and, at a more advanced level, GRASS.
If you want to publish your data on the web and feel more inclibned to PHP then to JAVA have a look at MapServer for creating the rendered images of your geographical data and to OpenLayers or Mapbender or eventulally p-mapper for publishing the rendered images on the web. These are the tools that we been are using here for years and your can go any distance with them.
Regards,
Peter
Michael A. Peters wrote:
I have no experience with GIS whatsoever. I really know squat about it.
I'm currently working on a project to plot locality data for wildlife on a map of Shasta County. This is for a new herpetological club that hopes to track strength of our local herp populations, since it seems evident that in the last 20 years we lost one species of frog and are close to losing another (probably less than 100 left and they don't seem to be successfully breeding) and the declines were known, but the extent of the declines was not known well enough until it was too late. We want to try and prevent that with other species in our county by keeping records of where they currently are and where they use to be but are no longer found. When we see what appears to be shrinking range, we can investigate and if need be, request surveys by wildlife management before it is too late.
Basically - the data will be plotted as a grid of regular hexagons. When locality information (museum record or photo voucher record in our own database) exists, the hexagon the record sits in gets drawn a pretty color (depending on type and age of records).
I have it working on a raster (jpg) map where I guessed the latitude/longitude borders - working well enough with sample data that I know my php code works, but while it is ballpark accurate I need to do it with maps of known values.
Quick and dirty option - obtain (possibly pay for) a large (at least 2k pixels wide) raster map with known lat/lon borders that has the county outline, major lakes and rivers, nothing else. The maps could be made and then resized for web view. The major problem with that model is that drawing colored hexagons near the county border and near rivers will make it more difficult to see them, thus making it harder to interpret the map.
What I would prefer to do -
Draw my data hexagons on a blank slate [ via imagecreate(width,height) function), then draw the county border on top of that, and then on top of that either draw the lakes/rivers and/or basic topographical lines.
My preference obviously includes getting data sets for those things (county border, lakes/rivers, topography) in a format that I can parse with php to draw them with gd.
My county does have some GIS data available: http://www.shastagis.co.shasta.ca.us/gissearch/search_new.aspx
I don't have a clue how to get that data into format useful for drawing with gd via php.
Anyone have experience with this? Can anyone recommend a (preferably free) Linux GIS program that works on CentOS that could potentially convert data files into format useful for drawing with gd?
I don't need to get fancy with zoom, rotate, etc. capabilities - just a basic static flat map output.
Thanks for any suggestions. I may try to find a "GIS for dummies" type book, though I've generally not been fond of dummy books, I kind of feel like one when it comes to GIS. _______________________________________________ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Peter Hopfgartner wrote:
Dear Micheal,
are there any good reasons not to use a normal cartesian grid? I can no tremember any GIS software that can use haxagonal tiles as a raster.
What I'm doing at the moment - I input the width of the map, max/min lon/lat - it calculates the height of the map needed for pixels for to have the same pixel/kilometer ratio both north/south and east/west.
Another php function converts lat/lon coordinates to x/y coordinates that are oriented like gd wants them:
function getsquarelocation($lon, $lat, $maxlon, $minlon, $maxlat, $minlat, $width, $height) { $x = $width * (($lon - $minlon) / ($maxlon - $minlon)); $y = $height * (($maxlat - $lat) / ($maxlat - $minlat)); return array("x"=>round($x),"y"=>round($y)); }
Obviously there's a little distortion but not much-
Sample data points in google earth: http://homepage.mac.com/mpeters/misc/500flags.png Same data points in my script: http://homepage.mac.com/mpeters/misc/500flags2.png
They look like they have the same spacial relationship to me.
So I am using cartesian coordinates, I just feed the output of that function to another function that finds the data points for the gd imagefilledpolygon and the hexagons are created. I actually have the hexagons overlap a tiny bit (2 pixels) to prevent a possible 1 pixel space between them from rounding issues.
I think I may have found what I need - I found some articles on parsing e00 files into arrays that I can then use to draw them with gd. Now the only issue is the e00 files I have have *too* much information - they are statewide - so I need to figure out which datasets in the files are the ones I want ,,,
I may just write a shell script that parses the e00 file and turns the data sets into php include files. There may be some scripts out there that already do a similar thing I can steal, as e00 seems fairly common and has been around awhile.
Anyway, there is quite a lot of GIS software that you can obtain via EPEL [http://fedoraproject.org/wiki/EPEL].
In case you want to publish geographical informations, do yourself a favor and use some of the many excellent tools out there, have a look at http://www.osgeo.org. A good part of the world's leading open source GIS people works on those projects.
Some, trying to summarize: If you want to keep your data on a database, go with PostgreSQL and PostGIS or SQLLite with it's spatial extensions.
If you want to work with desktop applications, have a look at QGIS and, at a more advanced level, GRASS.
If you want to publish your data on the web and feel more inclibned to PHP then to JAVA have a look at MapServer for creating the rendered images of your geographical data and to OpenLayers or Mapbender or eventulally p-mapper for publishing the rendered images on the web. These are the tools that we been are using here for years and your can go any distance with them.
Thank you! I will look into those.
Michael A. Peters wrote:
I think I may have found what I need - I found some articles on parsing e00 files into arrays that I can then use to draw them with gd. Now the only issue is the e00 files I have have *too* much information - they are statewide - so I need to figure out which datasets in the files are the ones I want ,,,
I may just write a shell script that parses the e00 file and turns the data sets into php include files. There may be some scripts out there that already do a similar thing I can steal, as e00 seems fairly common and has been around awhile.
I think ogr2ogr does what I want - it looks like it has a driver for putting the contents of various formats into database (including MySQL which is already being used for the wildlife database) and then I can probably get the coordinates I need to draw the county border and lakes/rivers from there.
-=-
With respect to other GIS apps - after building Fedora 9 versions of qt3,qt4,sip,PyQT4 - and grass from a spec file (slightly modified) grabbed from a Fedora SVN server, I was able to get qgis to build from a slightly modified spec file that targets Fedora.
Haven't played with grass or qgis yet, though, but hopefully they aren't too hard to figure out and I can start learning more about GIS.
On Wed, 2008-12-24 at 03:28 -0800, Michael A. Peters wrote:
Michael A. Peters wrote:
I think I may have found what I need - I found some articles on parsing e00 files into arrays that I can then use to draw them with gd. Now the only issue is the e00 files I have have *too* much information - they are statewide - so I need to figure out which datasets in the files are the ones I want ,,,
I may just write a shell script that parses the e00 file and turns the data sets into php include files. There may be some scripts out there that already do a similar thing I can steal, as e00 seems fairly common and has been around awhile.
I think ogr2ogr does what I want - it looks like it has a driver for putting the contents of various formats into database (including MySQL which is already being used for the wildlife database) and then I can probably get the coordinates I need to draw the county border and lakes/rivers from there.
Hmm, using MySQL...You are aware that it supports High Level Graphing as of version 5.1? IMO I think your are overloading yourself in PHP Code. Why not let the DB do this for you since you already have some of the data in it? You could use SPROCS and Triggers to do this all. As in Plotting all your corordinates you need.
JohnStanley <snip/>
JohnS wrote:
On Wed, 2008-12-24 at 03:28 -0800, Michael A. Peters wrote:
Michael A. Peters wrote:
I think I may have found what I need - I found some articles on parsing e00 files into arrays that I can then use to draw them with gd. Now the only issue is the e00 files I have have *too* much information - they are statewide - so I need to figure out which datasets in the files are the ones I want ,,,
I may just write a shell script that parses the e00 file and turns the data sets into php include files. There may be some scripts out there that already do a similar thing I can steal, as e00 seems fairly common and has been around awhile.
I think ogr2ogr does what I want - it looks like it has a driver for putting the contents of various formats into database (including MySQL which is already being used for the wildlife database) and then I can probably get the coordinates I need to draw the county border and lakes/rivers from there.
Hmm, using MySQL...You are aware that it supports High Level Graphing as of version 5.1? IMO I think your are overloading yourself in PHP Code. Why not let the DB do this for you since you already have some of the data in it? You could use SPROCS and Triggers to do this all. As in Plotting all your corordinates you need.
Quite possibly - but what I got works and works well now -
http://homepage.mac.com/mpeters/misc/500flags4.png
I didn't use the ogr2ogr export into MySQL - I found it (lack of my experience with gis no doubt) less than useful.
What I did was the following:
ogr2ogr -f "MapInfo File" FNRGC_CASIL.mif -t_srs EPSG:4326 FNRGC_CASIL.shp
The .mif file was cake to then parse with a shell script that made a .sql file for uploading the lon and lat
My image.php then gets those data points, converts them into x,y for use with php, and draws the polygon.
The downside, and where a real GIS solution would be better, is that distortion will be extreme near north/south poles - which is probably why (even though my distortion is minor give ~ 42 latitude) to be proper I should look for a solution that uses a real gis engine and can pick an appropriate projection. But this will work for now until I learn more about GIS. A real solution would probably make it easier for users to look at range map comparisons of different species etc. - either dynamically on the web, or by downloading our data files for their own GIS software. It looks like some real cool stuff could be done (IE comparing frog range locality data with DF&G trout stocking data, rainfall data, cow grazing data, whatever)
I definitely need to buy some books, and now that I have qgis installed and working, play with it some more.
Just for those who wish to know, I wrote up my RPM based installation process for grass and qgis here:
http://forum.qgis.org/viewtopic.php?f=3&t=4423
(second post in the thread)
Michael A. Peters wrote:
Basically - the data will be plotted as a grid of regular hexagons. When locality information (museum record or photo voucher record in our own database) exists, the hexagon the record sits in gets drawn a pretty color (depending on type and age of records).
mashup's with google maps are easy to do, and there are plenty of examples and resources out there that let you work with them in most mainstream languages - I am sure php code exists too.
Is that a route you considered ?
- KB
On 12/23/08, Karanbir Singh mail-lists@karan.org wrote:
Michael A. Peters wrote:
Basically - the data will be plotted as a grid of regular hexagons. When locality information (museum record or photo voucher record in our own database) exists, the hexagon the record sits in gets drawn a pretty color (depending on type and age of records).
mashup's with google maps are easy to do, and there are plenty of examples and resources out there that let you work with them in most mainstream languages - I am sure php code exists too.
Is that a route you considered ?
- KB
We use the google maps api for all our GIS work. It integrates really well with php. We use it to plot pharmacies in Glasgow and the various services that they provide along with the number of spaces that they have for substitute prescibing for patients with drug misuse problems so it is very dynamic.
As long as the website is publically available then the licencing terms seem reasonable.
mike