web

Missing Natural Heritage Content?

Missing some content?

The main website of the Idaho Fish and Game underwent a massive facelift in mid-July, 2011. Amidst the shuffle, we've lost a few data and content links.

In order to keep that data available to you while a few kinks are ironed out, we've copied content here and made some updates of missing files. The way we're sharing this data will be changing, so don't update your bookmarks just yet. 

 

Looking for Special Status Species lists?

Try here to find Federally listed Endangered, Threatened, Proposed and Candidate species in Idaho, Idaho's special status vascular and nonvascular plants, and Idaho's Species of Greatest Conservation Need (SGCN) (vertebrates and invertebrates).

 

Interested in Comprehensive Wildlife Conservation Strategy (CWCS) information?

Specifically, we found the Appendix F section of the website went rogue. You can find the CWCS PDF documents from 2005 here now.

 

Something else that you can't find from the Idaho Natural Heritage Program (formerly Conservation Data Center) CDC?

Let us know what you're looking for.

 

That pesky IE compatibility view... how to turn compatibility view off

Internet Explorer is a tricky browser to design for. I, like others, spend countless hours making my web standards pages work in IE, too. 

Here's a patch/hack/fix I applied today to fix the problem of Internet Explorer rendering my web page differently to a user with IE's compatibility view "on" than "off." Just as a note, You can tell if IE compatibility mode is on if the little page icon in the browser shows up as a solid color instead of an outline.

You might need this method applied if your site works well without compatibility view (or in webkit browsers), but does weird things due, usually, to stylesheets using conditional formatting or for html5 compatibility.

<meta content="IE=8; IE=9" http-equiv="X-UA-Compatible" />

For a list of the different meta content options to include, this article was phenomal.

Make this be the first meta tag in the list of metas, otherwise IE9 won't be happy.

When the above meta tag is included in the <head> element of your page, the user is no longer presented the option to "toggle into" compatibility view. In my case, they don't need compatibility view. This is a great hack if rendering the page to work without compatibility view is not an option.

 

 

Note: This workaround won't do it for you if the user has already added your website specifically to the Compatibility View list from within IE's compatibility settings. You may have to direct them to instructions to remove it, if that's the case. But... let's face it, if they figured out how to add it to that list, then either they aren't in control (a domain policy may add the site via security settings) or they already know what they are doing and will probably google it faster than you can walk them through it.

 

 

 

How to Report Roadkill

Would you like to share roadkills you witness?  It's quick and easy and helps Idaho Fish and Game (IDFG) and the Idaho Department of Transportation (ITD) work to avoid future wildlife collisions.

Reporting Roadkill is Quick and Easy

How to Submit a Wildlife Collision in 5 Steps...

To get started visit https://fishandgame.idaho.gov/ifwis/roadkill

1.) Who

Enter a few details about yourself, the Observer.
Don't worry we won't share this, but we do need to contact you if we have questions.

We admit that entering all this information is quite a pain if you'll be reporting often.  That's why we encourage you to create an account.

Once you have created an account your contact information will auto-fill.  You'll also be able report for friends and family members with a single click.  In fact, all your commonly used settings will be stored in quick-access shortcuts.
 

2.) When

Enter the date of the observation and an accuracy
You may type a date, or pick a date from the calendar.  Choose from the list an accuracy for the selected date.

Optionally, you may enter any more details you may have about the time of the observation (e.g. "Observed at Time Zone Rapid in Riggins and I'm not sure if this observation was at 2:05PM or 3:05PM").

3.) What

Identify the species
Start typing a common name (e.g. Moose) or scientific name (e.g. Alces americanus) and pick a species from the dropdown list that appears.

Add some Detail
How many? How old? What gender? Was it still alive? Other details?

4.) Where

Provide a location of the roadkill
Use one of four options to provide a location:

  • Click on the map  (You can pan, zoom and click again to move the marker)
  • Pick a Highway and Mile Marker  (US 93, Milepost 486)
  • Type an Address or Intersection  (600 S. Walnut St. Boise)
  • Provide an X & Y Coordinate   (43.5,-114.72 or 43 30,114 43.2 or N43 30,W114 43 12)

Add a Confidence Level for your location and optionally any Additional Location Information and you're done!

5.) Click Save Wildlife Collision to submit your observation!

The full details of your observation will appear upon submission.

You may review and download your previous submissions in the sidebar.  For larger exports in a variety of formats from csv to xml use the Export Roadkill Data tool.
 

Using the Google Maps API v.3 and the Roadkill API to add a Real-Time Map to your webpage or blog

NOTE: This is an update to an earlier demonstration post using the Google Maps API v.2 to add recent roadkill information to your webpage or blog.

STEP 1. Configure the URL to request

Visit http://fishandgame.idaho.gov/ifwis/core/view/roadkills and design your query using the editor.  For example, you may just be interested in one Highway section such as the first 22 miles of Highway 21.

Stripped of the empty parameters your url should now resemble: http://fishandgame.idaho.gov/ifwis/core/view/roadkills?highway=94817&mpTo=22

Now, we can add some special parameters to grab the most recent observations.  Add to your url the following &start=-365&end=now to limit your results to the last year of observations.  The -365 is the number of days before the current date and time to include.  You may tailor this to your needs.  You can of course also use full dates, but this allows your query to be dynamic and useful in the future.

Possible parameters for date fields Observed Date (start, end) and Reported or iNsert Date (nstart, nend) include:

  • Valid dates in the format 1/10/2008
  • Now - current system datetime in Mountain Standard Time
  • Today - current day in Mountain Standard Time
  • Yesterday - previous day in Mountain Standard Time
  • Integer - positive or negative offset in days

Finally, add the kml extension, by copying the path from the kml icon or copying the following:

http://fishandgame.idaho.gov/ifwis/core/view/roadkills/list.kml?highway=94817&mpTo=22&start=-365&end=now

 

STEP 2: Add the Code

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>IFWIS Roadkill API Google Maps JavaScript API v3 Example</title>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
function initializeMap() {
  var mapCenter = new google.maps.LatLng(43.58, -116.06);
  var myOptions = {
    zoom: 12,
    center: mapCenter,
    mapTypeId: google.maps.MapTypeId.TERRAIN
  }
  var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  var ctaLayer = new google.maps.KmlLayer('https://fishandgame.idaho.gov/ifwis/core/view/roadkills/list.kml?highway=94817&mpTo=22&start=-365&end=now', {preserveViewport: true});
  ctaLayer.setMap(map);
}
</script>
</head>
<body onload="initializeMap()">
  <div id="map_canvas">Map Loading...</div>
</body>
</html>

 

STEP 3: Enjoy

Here's a Live Example

Loading...

What you see here is a live example of the same code from Step 2 above except instead of using the onload event of the html body, the scripts are placed immediately following the div element inside the html body.  Using this method you may place live maps on blogs, forums and other websites.

Explore the Google Maps Javascript v3 API and IFWIS Core API for more mashup ideas!

We feed so you can follow

Let us make this easy.

We're trying to make it easier for you to keep on top of what we are working on here at IFWIS.  Our work is not just to compile Natural Resources data, but to make it more open, accessible, and well, yours. 

We've just started this process with our new Roadkill App. Stripped of any personal details, save your username, all uploaded data are instantaneously available at http://fishandgame.idaho.gov/ifwis/core/view/roadkills where you are free to query, reuse and remix:

We are just getting started. Over the next year we'll be opening up

more data streams via the IFWIS Core API to allow you to remix, reuse and download IFWIS data and we needed a way to tell you about it.  Which brings us to this post.

RSS broadcasting RSS

We feed. You follow.

We've just started this little IFWIS Blog, but we realize that our projects, tastes and interest are pretty diverse. Though you are welcome to follow all our posts via RSS or email subscriptions, we expect the chatter - ranging from web server configs to PIT tagging - will get a little overwhelming.  To that end, we just added RSS Feeds for any tag (the keyword kind) and posted them in sidebar of the IFWIS Blog.  So if your passion *is* roadkill, you can follow those posts via RSS or HTML without all the extra noise.

And if you are passionate about RSS. You can follow the posts on RSS via RSS.

Enable Cross-Origin Resource Sharing to Allow Cross-Site JSON

We just discovered our open data wasn't nearly as open as we believed.  Turns out for true cross-site requests of JSON data you need to add a HTTP Reponse Header:

 Access-Control-Allow-Origin: "*"

The method one uses to do so vary widely by webserver and host.  In our case, for IIS7 the simplest method was to configure it in the web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <httpProtocol>
      <customHeaders>
        <add name="Access-Control-Allow-Origin" value="*" />
      </customHeaders>
    </httpProtocol>
  </system.webServer>
</configuration>

For more information on the why and how as well as directions for other webservers visit enable-cors.org. The folks behind hacks.mozilla.org also offer a solid overview of Cross-site XmlHttpRequest with CORS.  Use the form at http://enable-cors.org/#check to see if your site is CORS enabled.

At this time only IFWIS Core is CORS-Enabled on IDFG's website.

Using the Roadkill API to add a Google Map to your webpage

UPDATE: This demonstration is for Google Maps Javascript API Version 2. Directions are now available for using Google Maps Javascript API Version 3 with the Roadkills Controller in the IFWIS Core API.

Are you concerned about roadkill?  Would you like to display current roadkill information on your website or blog?  Now you can using the Roadkills Controller in the Core API.  Here's how in three easy steps.

 

STEP 1. Configure the URL to request

Visit http://fishandgame.idaho.gov/ifwis/core/view/roadkills and design your query using the editor.  For example, you may just be interested in one Highway section such as the first 22 miles of Highway 21.

Stripped of the empty parameters your url should now resemble: http://fishandgame.idaho.gov/ifwis/core/view/roadkills?highway=94817&mpTo=22

Now, we can add some special parameters to grab the most recent observations.  Add to your url the following &start=-730&end=now to limit your results to the last two years of observations.  The -730 is the number of days before the current date and time to include.  You may tailor this to your needs.  You can of course also use full dates, but this allows your query to be dynamic and useful in the future.

Possible parameters for date fields Observed Date (start, end) and Reported or iNsert Date (nstart, nend) include:

  • Valid dates in the format 1/10/2008
  • Now - current system datetime in Mountain Standard Time
  • Today - current day in Mountain Standard Time
  • Yesterday - previous day in Mountain Standard Time
  • Integer - positive or negative offset in days

Finally, add the kml extension, by copying the path from the kml icon or copying the following:

http://fishandgame.idaho.gov/ifwis/core/view/roadkills/list.kml?highway=94817&mpTo=22&start=-730&end=now

 

STEP 2: Add the Code

<html>
<head>
<script type="text/javascript" src="http://www.google.com/jsapi?key={YOUR GOOGLE MAPS API KEY}">
   <script src="https://www.google.com/jsapi" type="text/javascript"></script>
   <script type="text/javascript">

       google.load("jquery", "1.4.2");
       google.load("maps", "2", {
           other_params: "sensor=false"
       });

       google.setOnLoadCallback(function () {
           initializemaps();
       });

       var map;
       var geoXml;

       function initializemaps() {
           if (GBrowserIsCompatible()) {
               geoXml = new GGeoXml("http://fishandgame.idaho.gov/ifwis/core/view/roadkills/list.kml?&start=-720&end=now&highway=94817&mpFrom=0&mpTo=22&cachebuster=" + parseInt(Math.random() * 99999999, 10));
               map = new GMap2(document.getElementById("map_canvas"));
               map.setMapType(G_PHYSICAL_MAP);
               map.addMapType(G_PHYSICAL_MAP);
               map.setCenter(new GLatLng(43.58, -116.06), 12);
               map.setUIToDefault();
               map.addOverlay(geoXml);
           }
       }

   </script>
</head>
<body>
    <div id="map_canvas" style="width: 550px; height: 600px; float:left; border: 1px solid black;">Loading...</div>
</body>
</html>

Couple small configuration notes:

  • If you are putting this online you'll need to replace {YOUR GOOGLE MAPS API KEY} with your own where indicated above.  If you don't already have one, visit http://code.google.com/apis/loader/signup.html (don't worry they're free!).
  • The URL you built in Step 1 may be different, edit the following with your url.  Keep the final cachebuster part as it'll keep your data current.
    geoXml = new GGeoXml("http://fishandgame.idaho.gov/ifwis/core/view/roadkills/list.kml?&start=-720&end=now&highway=94817&mpFrom=0&mpTo=22&cachebuster=" + parseInt(Math.random() * 99999999, 10));
  • Change the zoom center and zoom level by modifying this line appropriately:
    map.setCenter(new GLatLng(43.58, -116.06), 12);
  • You may not have full access to HTML behind your pages (for example in a blog).  Simply add the <div> section and then past the <script> sections afterwards.  If you already have jquery or google maps loaded you may skip these sections.

 

Result:  View a Live Demo
Below is a static image because GMaps Ver. 2 does not support HTTPS. Click here to see and download a live demo. An HTTPS GMaps Ver. 3 demo is also available.

Example Output


STEP 3: Enjoy

That's it!  This page you have created will update itself as new observations are added to the Roadkill page.

Displaying Recent Roadkill on your Webpage

You can use the Roadkills API to display the most recently reported roadkill on your webpage.

Passionate about Mule Deer perchance?  In a couple quick steps you can add a real-time list of the Recent Mule Deer Roadkills using the magic of JQuery and the Roadkills API.  First, a demo, then the code.

Demonstration

Recent Mule Deer Roadkill

    Loading Roadkill...

The Code

<ul id="roadkillfeed">Loading Roadkill...</ul><script type="text/javascript" src="http://www.google.com/jsapi?key={YOUR GOOGLE API KEY}">
    <script type="text/javascript" src="https://www.google.com/jsapi"></script><script type="text/javascript">
        google.load("feeds", "1");

        google.setOnLoadCallback(function () {
            initializefeeds()
        });

        function initializefeeds() {
            var feed = new google.feeds.Feed("http://fishandgame.idaho.gov/ifwis/core/view/roadkills/list.rss?species=16300&start=-365&end=now&pageSize=25&cachebuster=" + parseInt(Math.random() * 99999999, 10));
            feed.setNumEntries(25);
            feed.load(function (result) {
                if (!result.error) {

                    var content = document.getElementById('roadkillfeed');
                    var html = '';

                    for (var i = 0; i < result.feed.entries.length; i++) {
                        var entry = result.feed.entries[i];

                        html += '<li><a href="' + entry.link + '">' + entry.title + '</a></li>';

                    }
                    content.innerHTML = html;
                }
            });
        }
    </script>

Substitute your Google API Key and your customized URL and you're live!  Well, not the roadkill, but the page is displaying live data as it arrives!

Background on OpenID and oAuth

OpenID

OpenID explained - a federated passport for the web
http://openidexplained.com

Making openid pretty
http://stackoverflow.com/users/login

Built using jquery openid plugin
http://jvance.com/pages/JQueryOpenIDPlugin.xhtml

Another implementation w/ extend properties
http://www.zoho.com

OAuth

OAuth a Valet Key for the Web
http://hueniverse.com/oauth/guide/intro

Beginner's Guide to OAuth - Workflow
http://hueniverse.com/2007/10/beginners-guide-to-oauth-part-ii-protocol-workflow

Demo of OAuth
http://pikchur.com or http://yfrog.com

Twitter has a good explanation of OAuth 1.0a with workflow
http://dev.twitter.com/pages/auth

OpenID vs OAuth (federated vs delegated login)
http://hueniverse.com/2009/04/introducing-sign-in-with-twitter-oauth-style-connect

Library we will be using for implementation
http://www.dotnetopenauth.net/

Database Documentation Made Easy

Data Dictionary Creator is a simple application which helps you document SQL Server databases. It stores all the information in Extended Properties, so it's easier to keep the documentation in sync with the database as it changes.  The tool is open source and available as an executable and source code on codeplex.  The first code release was November 2006 with over 40 releases and patches up until today.  Authored in C#.Net.

Database Dictionary Creator

I could go through a step-by-step, but there is already a great walkthrough online.

The html grouped option was great for me - it even creates the anchor tags to jump from the table list to the table details. 

The only step remaining in my mind was to link the database diagram to the table details by exporting a diagram from sql server and adding an image map.  Since those steps are custom, I'll document them here:

Exporting a SQL Server Relationship Diagram

  1. Right-click in the diagram pane
  2. Choose "Copy Diagram to Clipboard"
  3. Paste in an image management destination program and save as image

Creating an Imagemap

  1. Open an online imagemap creator such as http://www.maschek.hu/imagemap/imgmap
  2. Upload an image or provide a url to an image and click "accept"
  3. Draw a box around each table in the diagram.  Add hypertext references (href) and alternative text (alt) attributes for each hyperlink.  Href's should link to the anchors in the format "#dbo.{tablename}", alt tags are displayed on hover, "View {tablename}" is probably appropriate.
  4. When all tables have been outlined and linked, click code and copy the text

Putting it all together

  1. Open the html produced by the Database Documention Creator in export grouped mode
  2. Just inside the body tag (after <body>), add a reference to the image you created (hint: it must be accessible to the html you are viewing - it is easiest to place it in the same directory).  An html image is referenced like the following <img src="imagename.format" alt="Alternative Text to Display" />
  3. After your image paste the code you copied.  This is the imagemap it must be using the same copy of the image that your used to create the imagemap.  If the image has been resized or modified the coordinates will no longer match.
  4. Link the imagemap to the image by copying the map id from the map code to the image tag like the following: <img usemap="#map id value" src="imagename.format" alt="Alternative Text to Display" />.  Notice I have added a pound symbol before the id attribute.
  5. Save your html and view it in a browser.  The product should resemble http://fishandgame.idaho.gov/ifwis/core/home/model.

How this could be better

The source code for both applications I have used are available online.  The Database Dictionary Creator is available for free and the Imagemap Creation Tool for a modest donation.  The whole process might be slightly smoother if we write some code to wrap together the imagemap creation and publishing to the web.  I'm thinking we use the existing Database Dictionary Creator to export the grouped html, then have an upload page which accepts the created html and an image.  The user then adds an imagemap and the script cleans up the html, puts it all together into one page and publishes the product.