tag:blogger.com,1999:blog-157529842024-03-07T19:42:05.892-08:00John Deck's BlogGIS, farming, and fun stuffJohn Deckhttp://www.blogger.com/profile/03050568439150665411noreply@blogger.comBlogger13125tag:blogger.com,1999:blog-15752984.post-16809172889105208042011-11-07T15:30:00.000-08:002011-11-10T16:16:13.991-08:00How to measure areas using a free GIS SystemIf you want a really a quick and easy way to measure areas using an online tool, i recommend <a href="http://acme.com/planimeter/">Google Planimeter</a>. If you want a more robust solution and have the need to manage multiple fields, read on...<br /><br />Measuring areas and tracking land units is a common task for environmentalists, farmers, ranchers, and land planners. This tutorial is meant to get you started in not only measuring areas, but tracking information related to fields, creeks, and any other spatial management units.<br /><br />This tutorial covers how to download free imagery online, install a free GIS application, build a geographic layer (GIS layer), and measure areas. The examples given in this tutorial assumes that you live in Oregon but other sources of data in other areas can be used.<br /><br />The length of time for going through this tutorial is about 2 hours and requires a good working knowledge of computers.<br /><br /><span style="font-weight:bold;">Step 1: Downloading Imagery<br /></span><br />The State of Oregon has a great resource called the Oregon Imagery Explorer:<br /><a href="http://imagery.oregonexplorer.info/DHTML.htm">http://imagery.oregonexplorer.info/DHTML.htm</a><br /><br />Using this tool, you can navigate to a specific address and download geo-rectified imagery. A geo-rectified image knows where it is on the earth’s surface and is important for being able to accurately measure areas. Downloading imagery from this application is easy, but you when saving your image, you must do the following:<br /><br />Click on “Extract Defined Area”.<br />• Projection = NAD83/UTM Zone10N (western Oregon) OR substitute NAD83/Zone 11N (eastern Oregon)<br />• Output Format = JPEG<br />• Enter your name and email address and leave all other settings as they area.<br />• Click “Submit”<br /><br />I recommend creating a directory on your hard drive to store all of the data relating to this image and subsequent layers from the following step (there should be two files that are kept together). When you download your image it should be compressed as a zip file and so you can usually just click on this and your computer will extract the files.<br /><br /><span style="font-weight:bold;">Step 2: Downloading and Installing QGIS<br /></span><br />QGIS is a powerful Geographic Information System (GIS) software, equivalent to other packages that cost thousands of dollars. The drawback is that installation is a bit more difficult and documentation is not as good. You will need to follow the installation instructions at the QGIS site very carefully.<br /><br />Download QGIS from<a href="http://www.qgis.org/wiki/Download "> http://www.qgis.org/wiki/Download </a>. You will need to choose your operating system and follow instructions for downloading a couple of other pieces of software that must first be installed before installing QGIS.<br /><br /><span style="font-weight:bold;">Step 3: Setting up your QGIS Project<br /></span><br />Create a new project and save this project in the directory you made in Step #1. I recommend saving often as occasionally this software may crash and will need to be restarted.<br /><br />Add your Imagery by clicking “Layer”, then “Add Raster Layer” and pointing to the directory where you extracted your imagery. Choose the file with the *.jpg extension.<br /><br /><br /><span style="font-style:italic;">Setting the Projections:</span><br /><br />This step is very important. Essentially, you are letting QGIS where the image that you downloaded sits on the Earth’s surface. All of your future measurements and area calculations rely on this step in order to work properly.<br /><br />Click on “Settings”, then “Project Properties”, then click “Coordinate Reference System (CRS)”. In the Coordinate Reference System List, choose “NAD83 / UTM Zone 10.”, the click OK<br /><br />Highlight the Layer in the view window. Then click “Layer”, then “Set CRS of layer(s)”, and choose “NAD83/UTM Zone 10” again.<br /><br />Now, you are also setup to begin working with your project. I recommend saving your project at this point and pour yourself another cup of coffee.<br /><br /><span style="font-style:italic;">Creating a Layer: </span><br /><br />Supposing you are a farm owner with a number of different fields that you manage. This next step will show you how to create a digital representation of those fields in your GIS software.<br /><br />Click “Layer”, “New”, then “New Shapefile Layer”.<br />In the dialog box, choose Type = “Polygon”<br />• New Attribute = “areaMeters”, decimal, width=20, precision = 4<br />• Click on “Add to Attributes List” (it should appear below)<br />• New Attribute = “areaAcres”, decimal, width = 20, precision = 4<br />• Click on “Add to Attributes List” (it should appear below)<br /><br />Click “OK” and then save your new layer to the directory that you made.<br /><br /><span style="font-style:italic;">Editing the Layer:</span><br /><br />In the view window right click or control click on the layer name, and select “Toggle Editing”. This will allow you to edit this layer.<br /><br />Click the little circle with nodes on it on the menu bar. If you hover your mouse over it, it will say “Capture Polygon”. You can draw polygons around your features with this, draw as many features as you like. Using the imagery as a backdrop you can easily trace your fields with this tool and create a separate polygon for each field.<br /><br /><span style="font-style:italic;">Updating Area:</span><br /><br />In this step, you will figure out the square meters and acreage of your polygons.<br /><br />1. Right click the layer you just added, and select “open attribute table”<br /><br />2. Update areaMeters <br />• Click on field calculator (little calculator image at bottom)<br />• Select “Update existing field” in the dropdown select “areaMeters”<br />• Under operators, click “area” (Under “Field Calculator expression”, there should appear a $area) then click OK<br /><br />3. Update areaAcres<br />• Click on field calculator again<br />• Select “Update existing field”, select areaAcres <br />• In “Field Calculator Expression”, type “area*0.000247105381”, then click OK<br />• Finally, you may need to click the“areaAcres”to get the calculations to show up.<br /><br />If you made it this far and everything works then congratulations! If not, don’t despair, there is plenty of documentation available online—look at the QGIS site for their documentation which will be helpful. You may also want to consider hiring a specialist to get you setup and give you a personal tutorial so you can get going.John Deckhttp://www.blogger.com/profile/03050568439150665411noreply@blogger.com0tag:blogger.com,1999:blog-15752984.post-40700165395755574812010-12-07T15:15:00.000-08:002010-12-07T15:19:39.715-08:00Machine to create single-ply toilet paper<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLghV-43LDnhJKXtiOCXsfwGX15A5H9mQ5QsbvMzdr8CUpwg-g4dcRnJ9B6B1kgncSDEsm2KhdlAu3uYNfS8OVk7pL2JGwFvVQyR28AAM4mL2D_docKfpwM8_NzF4c_CdsxnVh/s1600/TPde-plyer.jpg"><img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 320px; height: 174px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLghV-43LDnhJKXtiOCXsfwGX15A5H9mQ5QsbvMzdr8CUpwg-g4dcRnJ9B6B1kgncSDEsm2KhdlAu3uYNfS8OVk7pL2JGwFvVQyR28AAM4mL2D_docKfpwM8_NzF4c_CdsxnVh/s320/TPde-plyer.jpg" alt="" id="BLOGGER_PHOTO_ID_5548082968601143282" border="0" /></a><br />As seen on The Office... an actual machine that creates single-ply toilet paper out of 2-ply toilet paper. Click the picture for more detail .... this really does look like a piece of Amish ingenuity.<br /><br />This is all part of Dwight's diabolical plans to reduce costs in his building.John Deckhttp://www.blogger.com/profile/03050568439150665411noreply@blogger.com2tag:blogger.com,1999:blog-15752984.post-1159565509044577382006-09-29T14:27:00.000-07:002006-09-29T14:33:08.956-07:00Deck Family Farm Website is Up<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://www.deckfamilyfarm.com/"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7633/1468/320/steer_height120b.jpg" border="0" alt="" /></a><br />I've been posting farming related topics over the last year in conjunction with my more nerdly posts on GIS. We now have a website for our farming venture at <a href="http://www.deckfamilyfarm.com/">Deck Family Farm</a>. Check it out if you are interested in natural meats. We are starting to take orders for direct-shipped frozen meat boxes!John Deckhttp://www.blogger.com/profile/03050568439150665411noreply@blogger.com3tag:blogger.com,1999:blog-15752984.post-1156889304476669412006-08-29T14:59:00.001-07:002006-08-29T15:09:26.350-07:00Fence for home on a farm update<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7633/1468/1600/fence.jpg"><img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7633/1468/320/fence.jpg" border="0" alt="" /></a> Here is a photo of the fence that I wrote about last November. Most of it is done with the exception of gates. I am very pleased with the design as the fence went up pretty quick, even counting the phone and septic lines we managed to precisly locate with our auger. <br /><br />In the photo is a small section of cob wall we have near our front gate. The cob is built using <a href="http://www.cobcottage.com/">Oregon Cob</a>, a new method based on a very old technique using clay, sand, and straw to build the wall. The straw acts like rebar, holding the whole mass together, while the clay holds the sand together, and the sand adds the mass. We have yet to put the outer coat on, which will be a clay-dung (yes, its dung-- we are going to use llama poop) mix and on top of that a linseed oil/ beeswax mix.John Deckhttp://www.blogger.com/profile/03050568439150665411noreply@blogger.com1tag:blogger.com,1999:blog-15752984.post-1149264849201480742006-06-02T08:35:00.000-07:002006-08-12T14:24:58.923-07:00Alternatives to Synthetic Nitrogen FertilizerWe are raising organic beef. Though we are not certified at this time, we are following the rules. One particular aspect of being organic is not using synthetic nitrogen fertilizers. This is a big deal when most livestock producers around you are using synthetic nitrogen. The benefits touted are more grass for hay and forage and the grass responding to the nitrogen will respond better than the weeds. In the words of one rancher on our decision to not use synthetic nitrogen fertilizer- "You won't get nothin' from that land without it".<br /><br />After some reading its clear that there are a number of ills associated with using synthetic nitrogen, including: reliance on fossil fuels to produce it, changing soil chemistry, investing in methods requiring intervention as opposed to using time & energy in other methods that may be more productive.<br /><br />A few sites detailing the ills of synthetic nitrogen:<br /><br />http://hollandimac.chem.rochester.edu/n2cycle.pdf <br /><br />http://www.nofa.org/tnf/nitrogen.php<br /><br />http://www.farmandranchguide.com/articles/2006/05/25/bullseye/production_news/prod10.txt<br /><br /><br />Finally, i mentioned "other methods" above that could be used instead of synthetic nitrogen. This is where I want to begin to focus my attention. Some ideas are:<br /><br />1) Management intensive grazing. For reading see: http://www.amazon.com/gp/product/0961780738/102-1149708-9712913?v=glance&n=283155<br /><br />2) Overseeding legumes. Legumes fix nitrogen so used in permanent pastures can have a positive impact. Timing on this is critical.<br /><br />3) Planting combinations of early & late season grasses to extend the grazing season. (I have some references on this that i'll post when i find them)<br /><br />4) Fencing off creeks and providing water in the pasture. This helps keep nutrients on the pastures where they belong instead of the creeks where they cause no end of problems. We are pursuing options with WRP and CREP currently to help fence our nearly 2 miles of creek frontage.<br /><br />More on this topic later!John Deckhttp://www.blogger.com/profile/03050568439150665411noreply@blogger.com3tag:blogger.com,1999:blog-15752984.post-1147983087636474112006-05-18T13:01:00.000-07:002006-05-18T13:11:27.636-07:00MapWikiMy friend Collin Bode and I were sitting around one afternoon bouncing ideas around & through a lemonade and a beer. The big idea came up to create MapWiki. The name says it all. I realized later others have done this. (e.g. <a href="http://www.citeulike.org/user/ianturton/article/559523">http://www.citeulike.org/user/ianturton/article/559523</a>).<br /><br />We specifically wanted something that could integrate well with natural history collections databases and also include spatial certainty, linking back to source specimen records, and a registry of organizations and names. <br /><br />Anyway, a rough prototype lives at: <a href="http://mapwiki.berkeley.edu/">http://mapwiki.berkeley.edu/</a>John Deckhttp://www.blogger.com/profile/03050568439150665411noreply@blogger.com1tag:blogger.com,1999:blog-15752984.post-1140710524329963242006-02-23T07:58:00.000-08:002006-06-09T10:32:01.930-07:00Layerwing WMS services with GoogleMaps >= v2.36With the change in code in the Google Maps API v2.36, some things broke in my previous post about how to do WMS layering in V2 of Google Maps. I've posted a working sample of the WMS code for v2.36 and up <a href="http://chignik.berkeley.edu/google/wmstest236.html">here</a>. <br /><br />NOTE #1 (June 9th, 2006): I deleted the code references in the blog and instead point people to the sample link above, where a working version of the code is maintained (the key component is the file called wms236.js).<br /><br />NOTE #2 (June 9th, 2006): Thanks to Guilhem Vellut for fixing up some Javascript code to make the Mercator Projection work more accurately. Now, it can be used at all zoom levels.<br /><br />Attributions:<br />->Mike Williams http://www.econym.demon.co.uk/googlemaps2/ V2 Reference & custommap code<br /><br />->Brian Flood http://www.spatialdatalogic.com/cs/blogs/brian_flood/archive/2005/07/11/39.aspx V1 WMS code<br /><br />->Kyle Mulka http://blog.kylemulka.com/?p=287 V1 WMS code modifications<br /><br />->http://search.cpan.org/src/RRWO/GPS-Lowrance-0.31/lib/Geo/Coordinates/MercatorMeters.pm<br /><br />->Modified by Chris Holmes, TOPP to work by default with GeoServer.<br /><br />->Guilhem Vellut <guilhem.vellut@gmail.com> for more accurate Javascript Mercator FxnJohn Deckhttp://www.blogger.com/profile/03050568439150665411noreply@blogger.com3tag:blogger.com,1999:blog-15752984.post-1138425186254850092006-01-27T20:58:00.000-08:002006-06-09T10:22:18.726-07:00Layering WMS services using GoogleMaps API V2<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://chignik.berkeley.edu/google/wmstest.html"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;" src="http://photos1.blogger.com/blogger/7633/1468/400/capture2.jpg" border="0" alt="" /></a><br />NOTE: I changed this posting substantially on February 1st as the previous code did not work when using GPolyline methods. This code now works with polylines.<br /><br />Here is my method for creating GoogleMaps API V2 WMS Layers. In version 1, I started with code developed by Brian Flood and <a href="http://blog.kylemulka.com/?p=287">Kyle Mulka</a> and ended up re-writing most of that class for V2 using code and examples from <a href="http://www.econym.demon.co.uk/googlemaps2/"> Mike Williams</a>. The dd2Mercator conversion bits can be left off if dealing with small scale maps only.<br /><br /><a href="http://chignik.berkeley.edu/google/wmstest.html">Click here</a> for a working example of this code. NOTE: On June 9th, i deleted the code references in this blog and instead refer people to view the source of the working example linked to above.John Deckhttp://www.blogger.com/profile/03050568439150665411noreply@blogger.com6tag:blogger.com,1999:blog-15752984.post-1131458599402607182005-11-08T05:50:00.000-08:002005-11-08T06:03:19.410-08:00Fence for home on a farmSince moving to our farm a little more than a year ago, we've acquired an assortment of animals: geese, chickens, dogs, goats, llamas, etc... Some of the more annoying of these animals are very good at escaping from designated pens and finding their way to our porch and pool and laying waste to vegetation, pooping on our mats, defecating in the pool. sheesh!<br /><br />It became abundantly clear, at least to me, we need a fence to keep out the riff-raff from our home area. The fence needed to be aesthetic, not too tall to block our view over the top, and inexpensive. We have heard that deer do not like to jump fences they cannot see through, but we didn't want to spend the $ on a pure wood fence. Hence we decided on a wire mesh fence created with treated fir posts.<br /><br />Here is the design: 5' treated fir posts (3-4" diameter) set 2' in the ground with 3/4" gravel surrounding. The gravel is 3/4" open (meaning there are no smaller pieces than 3/4"-- it does not pack as tight as a 3/4" minus but drains a bit better. We figure the top posts will help secure the fence itself so we don't have to worry too much about packing). The posts are braced on the top with another post that is notched to sit firmly on top of each post. The posts are spaced 10' apart from each other with 5" galvanized spikes holding the tops in place. We will be using a 2"x4" welded mesh wire stapled to the posts and stretched (not too tight!) and held in place with staples. The galvanized mesh is 36" high. When the fence is done, we will be planting vines, shrubs, and some small trees along the fence to create a visual barrier for animals attempting entry or perhaps jumping.<br /><br />Approximate cost of fence:<br />100 10' 3-4" treated fir posts .... $700<br />9 rolls 2x4" welded wire,36" high... $385<br />~4 tons 3/4" Open gravel ..... $40<br />5" galvanized spikes .... $65<br />plants, etc.... $200<br /><br />Many thanks to the Tilt-Reuben Family who helped us start this project a couple of weeks ago. I'll post some pictures in a few weeks when we hope to have this project completed!John Deckhttp://www.blogger.com/profile/03050568439150665411noreply@blogger.com0tag:blogger.com,1999:blog-15752984.post-1126790478165461182005-09-15T06:00:00.000-07:002005-09-15T09:08:24.900-07:00Overlaying Mercator Projected WMS Layers on GoogleMapsOne troubling aspect of the GoogleMaps API is their use of the Mercator Projection. This projection is not so bad for looking at large-scale maps (zoomed in), but is awful for visualizing small-scale (zoomed out) data, due to the large degree of exaggeration of land masses near the poles. Making matters more complicated is the fact that most Mercator Projections deal in meters as units while GoogleMaps delivers content to and from their API in decimal degrees. This makes things difficult especially when layering global WMS layers on GoogleMaps. <a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7633/1468/1600/snapshot2.jpg"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://photos1.blogger.com/blogger/7633/1468/320/snapshot2.jpg" alt="" border="0" /></a><br /><br />The screenshot to the left illustrates what happens when layering country boundaries from a WMS using a geographic projection on top of GoogleMaps. The interesting thing is that if we were to zoom in on a particular portion of the world, the boundaries would line up. This is why many people are able to use a geographic projection with Google Maps if only using for large-scale mapping projects.<br /><br />OK, so what if we wanted to utilize a Mercator Projection from a WMS service on top of GoogleMaps? Here is how I did it, using Mapserver and Proj4 for the WMS content (details at the <a href="http://mapserver.gis.umn.edu/">mapserver</a> website):<br /><br />1. Add the appropriate Mercator definition in the Proj4 EPSG file:<br /># Mercator<br /><54004> +proj=merc +lat_ts=0 +lon_0=0 +k=1.000000 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m no_defs <><br /><br />2. Alter the Mapserver Map File so the Output Projection looks like:<br />PROJECTION<br /> "init=epsg:54004"<br />END<br /><br />3. Add the epsg:54004 projection definition to the WEB section of the Mapfile like:<br />WEB<br /> METADATA<br /> "wms_srs" "EPSG:4326 EPSG:54004"<br /> .....<br /><br />4. Make sure that the layers in the mapfile reflect their native projection.<br /><br />5. Alter the Javascript in the GMaps_WMSSpec_0.1.js code (references to the source of this code appear in an earlier post). Primarily, I added two functions to convert decimal degrees to Mercator Meters so the GoogleMaps API can call the WMS service in a language it can understand:<br /><br />// dd2MercMeters Conversion Functions<br />// from http://search.cpan.org/src/RRWO/GPS-Lowrance-0.31/lib/Geo/Coordinates/MercatorMeters.pm<br />//<br />var MAGIC_NUMBER=6356752.3142;<br />var DEG2RAD=0.0174532922519943;<br />var PI=3.14159267;<br />function dd2MercMetersLng(p_lng) {<br /> return MAGIC_NUMBER*(p_lng*DEG2RAD);<br />} <br />function dd2MercMetersLat(p_lat) {<br /> if (p_lat >= 85) p_lat=85;<br /> if (p_lat <= -85) p_lat=-85;<br /> return MAGIC_NUMBER*Math.log(Math.tan(((p_lat*DEG2RAD)+(PI/2)) /2));<br />}<br /><br />6. Make a couple of alterations in the WMSSpec.prototype.getWMSURL function. Attached here is the whole function as I code it:<br /><br />WMSSpec.prototype.getWMSURL=function(a,b,c, url, layers, format) {<br /> if (!this.Styles) this.Styles="default";<br /> var ts = this.tileSize;<br /> var ul = this.getLatLng(a*ts,(b+1)*ts, c);<br /> var lr = this.getLatLng((a+1)*ts, b*ts, c);<br /> // user mercator for small scale<br /> if (map.getZoomLevel() > 12) { <br /> var bbox = dd2MercMetersLng(ul.x) + "," + dd2MercMetersLat(ul.y) + "," + dd2MercMetersLng(lr.x)+ "," + dd2MercMetersLat(lr.y);<br /> var l_strSRS="SRS=EPSG:54004";<br /> } else {<br /> var bbox = ul.x + "," + ul.y + "," + lr.x + "," + lr.y;<br /> var l_strSRS="SRS=EPSG:4326";<br /> }<br /> var url = url + "REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&LAYERS=" + layers + "&STYLES=" + this.Styles + "&FORMAT=" + format + "&BGCOLOR=0xFFFFFF&TRANSPARENT=TRUE&"+l_strSRS+"&BBOX=" + bbox + "&WIDTH=" + ts + "&HEIGHT=" + ;<br /> this.cURL=url; <br /> return url;<br />}<br /><br /><br />You'll notice in step #6 above that I don't use Mercator for resolutions below 13. This is because I believe the nifty little javascript re-project is not quite as accurate as it can be (hey-- what do you expect from javascript doing reprojections!). Anyway, reverting to latlong at lower zoom levels will fix this.<br /><br />Thats it! The resulting map will looksomething like the screenshot below. The lines going across the top of the Russian Federation, by the way, I think are an artifact of drawing country boundaries across the international dateline. Since I'm only using point data for my real application i didn't worry about this. Not sure if this is an issue but I think it crept in because my source data is stored in geographic units.<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7633/1468/1600/snapshot.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/7633/1468/320/snapshot.jpg" alt="" border="0" /></a>John Deckhttp://www.blogger.com/profile/03050568439150665411noreply@blogger.com4tag:blogger.com,1999:blog-15752984.post-1126025061577512422005-09-06T09:43:00.000-07:002005-10-01T20:44:33.880-07:00Measuring flow in a small creek using a simple weirRecently, I constructed a simple weir for measuring flow in Owen's Creek at the point where our ranch-road crosses the creek. There is an old metal pipe, 8' in diameter which the water flows through, under the road. In front of this pipe I laid a rough-cut 2x10 at the base by digging out gravel in the stream bed. On top of this I placed another rough-cut 2x10 with a four foot rectangular notch. By measuring the head (height of water flowing over the notch) one can determine the flow rate of the water in the stream (See table below).<br /><p>One improvement I want to make is placing a piece of metal in front of the board and up an inch or so from the level of the notch. This will make a thinner area for the water to flow over which gives a more accurate measurement.<br /></p><p>There are still some leaks from the bottom of the weir, running about 25gpm (a conservative guess on my part).<br />Following are some estimates of streamflow using this method, with an estimated accuracy of +/- 30gpm:<br /></p><br /><li>July 30th, 2005: 400gpm</li><br /><li>September 4th, 2005: 315gpm</li><br /><li>September 23rd, 2005: 250gpm</li><br /><li>October 1, 2005: 577gpm (1 inch rain in last 24 hours after no rain all summer)</li><br /><p>Assuming irrigation rates of 96-146gpm, I will be leaving a downstream flow of 165-215gpm flow (using September 4th measurements).<br /><br /><b>DISCHARGE FROM A RECTANGULAR WEIR WITH A FOUR-FOOT WIDE CREST GIVEN IN US GALLONS PER MINUTE</b><br /><table border="1"><br /><tr><td><b>Gauge Reading in Inches</b></td><td><b>GPM</b></td></tr><br /><tr><td>0.5</td><td>47</td></tr><br /><tr><td>0.75</td><td>86</td></tr><br /><tr><td>1</td><td>145</td></tr><br /><tr><td>1.25</td><td>199</td></tr><br /><tr><td>1.5</td><td>258</td></tr><br /><tr><td>1.75</td><td>320</td></tr><br /><tr><td>2</td><td>387</td></tr><br /><tr><td>2.25</td><td>476</td></tr><br /><tr><td>2.5</td><td>552</td></tr><br /><tr><td>2.75</td><td>628</td></tr><br /><tr><td>3</td><td>708</td></tr><br /><tr><td>3.25</td><td>792</td></tr><br /><tr><td>3.5</td><td>880</td></tr><br /><tr><td>3.75</td><td>968</td></tr><br /><tr><td>4</td><td>1080</td></tr><br /><tr><td>4.25</td><td>1176</td></tr><br /><tr><td>4.5</td><td>1268</td></tr><br /><tr><td>4.75</td><td>1364</td></tr><br /><tr><td>5</td><td>1472</td></tr><br /></table>John Deckhttp://www.blogger.com/profile/03050568439150665411noreply@blogger.com0tag:blogger.com,1999:blog-15752984.post-1125433101737501462005-08-30T12:43:00.000-07:002005-08-30T13:24:34.450-07:00WMS overlays and GoogleMap TransparencyFollowing are some notes on my experiences in working with <a href="http://en.wikipedia.org/wiki/WMS">WMS</a> layers and GoogleMaps API. Am posting these notes here as I spent alot of time testing in the last couple of weeks on this and maybe this will help someone else out. Following is an image which illustrates what i'm talking about:<br /><br /><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7633/1468/1600/wmssample2.jpg"><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://photos1.blogger.com/blogger/7633/1468/400/wmssample2.jpg" alt="" border="0" /></a><br />These ideas are not definitive, just some general notes about how to get around.<br /><br />1) WMS layering on Googlemaps. Some posts reccomended having two map objects overlaying in separate divs. I drove myself nuts getting the maps to sync and things become more problematic when implementing multiple events to trigger different actions. Plus, this was all super slow. Hence, I opted for combining WMS layers into a single map object.<br /><br />2) I integrated a combination of <a href="http://www.spatialdatalogic.com/cs/blogs/brian_flood/archive/2005/07/11/39.aspx">Brian Flood's WMS code</a> and <a href="http://blog.kylemulka.com/index.php?cat=23">Kyle Mulka's suggestions for handling overlays</a> into a single function to handle WMS overlays (can overlay WMS ontop of GoogleMaps data or other WMS layers such as terraserver). I reccomend working with scripts they have posted rather than anything i have done.<br /><br />3) When Google handles overlays in the map object the Style sheets force transparent images to become opaque. Hence filled polygons with translucent properties block out everything. Worse, Google doesn't assign unique id's to any of the divs they create to simplify working with divs. To get around this, I pointed my javascript DOM to the div container for my map container and then searched all child nodes for references to my overlay WMS service and then dynamically changed the style properties. Here is the JS function which updates the appropriate JS elements:<br />// adjust Opacity<br />function adjustOpacity(p_pctOpacity) {<br />if (p_pctOpacity < .01) p_pctOpacity=.01 if (p_pctOpacity >1) p_pctOpacity=1;<br /> l_intOpacity=p_pctOpacity*100;<br /> // adjust opacity of overlay layers<br /> var JStopmap=document.getElementById('topmap').firstChild.childNodes;<br /> // loop all elements (google tiles)<br />for (var i=JStopmap.length-1;i>0;i--) {<br /> // search for string of overlay layer<br /> if (JStopmap[i].src!=null) {<br /> // HACK -- berkeleymapper is a unique string of the WMS service i'm calling<br /> // this can be anything.<br /> if (JStopmap[i].src.indexOf('berkeleymapper') > 0) {<br /> // browsers handle opacity differently, these settings should handle most common methods<br /> JStopmap[i].style.KthmlOpacity=p_pctOpacity;<br /> JStopmap[i].style.MozOpacity=p_pctOpacity;<br /> JStopmap[i].style.filter='Alpha(opacity='+l_intOpacity+')';<br /> JStopmap[i].style.opacity=p_pctOpacity;<br /> }<br /> }<br /> }<br />}<br /><br />4) Finally, I implemented a slider bar with some modifications in my script to link it up with the adjustOpacity function. This is from <a href="http://www.howtocreate.co.uk/jslibs/">Mark Wilton-Jones library of JS functions</a><br />There were other slider scripts out there but this one seemed easiest to work with, though i don't care much for the colors and it is a bit involved to change the look of the control.John Deckhttp://www.blogger.com/profile/03050568439150665411noreply@blogger.com1tag:blogger.com,1999:blog-15752984.post-1124903384826647452005-08-24T10:00:00.000-07:002005-08-24T10:09:44.830-07:00Fun with projections<a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7633/1468/1600/bm.jpg"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://photos1.blogger.com/blogger/7633/1468/320/bm.jpg" alt="" border="0" /></a><br /><div style="text-align: left;"><a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://photos1.blogger.com/blogger/7633/1468/1600/google.jpg"><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://photos1.blogger.com/blogger/7633/1468/320/google.jpg" alt="" border="0" /></a><br />Two error circles representing point certainty are displayed on the first map in geographic space. This rendering is from my first implementation of <a href="http://berkeleymapper.berkeley.edu/">BerkeleyMapper</a> which used geographic space for all maps.<br /><br />The second map displays these same error radii in the second implementation of BerkeleyMapper which leverages GoogleMaps API. Google uses a Mercator projection, which preserves local shape but has a large degree of exaggeration towards the poles. Both of these samples are technically correct I suppose but I'm not so happy with the vertically exaggerated ellipse from the GoogleMaps API example.<br /><br />The vertical exaggeration of the ellipse in the second sample, however, is preferable to the "squishing" affect of geographic space, particularly when underlaying USGS topos (as the map text will appear flattened in northern and southern latitudes).<br /><br /><br /></div>John Deckhttp://www.blogger.com/profile/03050568439150665411noreply@blogger.com0