ebmgh.com

80% of American voters Support Action on Clean Energy, Climate Protection

From the National Wildlife Federation on Dec 23:

The overwhelming majority of Americans – more than 80 percent – support action to limit carbon pollution and move the U.S. toward a clean energy future, according to a new poll released last week by the National Wildlife Federation.

American voters demonstrate a strong desire for the U.S. to transition toward a low-carbon economy, with strong support among Independents.

82 percent of voters and 80 percent of Independents, support the U.S. government increasing investment in clean energy sources.

67 percent of voters and 67 percent of Independents, support the U.S. government limiting carbon pollution and other gases that may cause global warming.

“The American people can’t be more clear when it comes to solving global warming: they want the U.S. to be Rudolph out in front of the sleigh, leading the world toward a clean energy future,” said Jeremy Symons, senior vice president of NWF.

The poll was conducted by the Benenson Strategy Group. 1,000 interviews were conducted with registered voters nationwide from December 12–15, 2009.

Interesting that more people support “clean energy” than believe in climate change (82% to 67%). I suppose those people want clean air, even if they don’t believe in global warming. Which says to me that so-called “co-benefits” are an important selling point in reducing carbon emissions.

The NWF polls seems to contradict the results of the Pew Research poll published in October, which showed a declining number of Americans believe in global warming, and that even fewer think it is because of human activity. I think the difference is that NWF polled registered voters, while Pew polled anyone who answered the phone.

December 29, 2009 at 4:06 pm Comments (0)

Computing Directions with pgRouting

Really interested in setting up and trying out pgRouting for the bike mapper. It looks like it will handle a lot of the difficult stuff automatically (at least in theory). This post is my start at checking it out.

The software is an extenion to PostGIS, and was created by Sylvain Pasche from CamptoCamp and maintained by a Japanese company called Orkney, which looks like a GIS and web company that is involved in open source projects like OSGeo.

I suspect that the developers would rather spend time writing code than writing documentation, but there is a wiki, and a few examples. It is thin in places, but it has much more content than it did when I looked at it a year ago.

http://pgrouting.postlbs.org/wiki/

Example of pgRouting query and output, from the wiki

Example of pgRouting query and output, from the wiki

One cause for concern: why are there so few live examples? Nearly all the examples on the demo pages have been crossed out with a strikethrough, and the few live links don’t seem to work. The notable exception is ridethecity.com, which is up and running (but does not appear to be open source).

Here is a nice, simple overview (in pictures) with few words, of what pgRouting does: Shortest Path Search for Real Road Networks and Dynamic Costs with Pgrouting (slideshow).

This presentation will show the inside and current state of pgRouting development. It will explain the shortest path search in real road networks and how the data structure is important for getting better routing results. We will show how you can improve the quality of the search with dynamic costs and make the result look closer to the reality. We will demonstrate the way of using pgRouting together with other Open Source tools. Also you will learn about difficulties and limitations of implementing routing functionality in GIS applications, the difference between algorithms and their performance.

pgRouting can perform:

  • shortest path search (with 3 different algorithms)
  • Traveling Salesperson Problem solution (TSP)
  • driving distance geometry calculation

Here is the best technical guide that I have found on the internet (via BostonGIS):

David Techer provides a well diagrammed and thought out tutorial on installing and using PgRouting to calculate itineraries. Unfortunately its in French, but nevertheless still useful since its so well diagrammed even if you are not a French speaker. Check out David Techer’s routing tutorial at PgRouting tutorial:

http://www.davidgis.fr/documentation/win32/html/apa.html

Forunatelly (for me), I know French and find that his site has an incredible amount of detail. Techer’s blog also has a few posts in English, including this one, specifically about how to use the Shooting Star route-finding function in pgRouting:

http://www.davidgis.fr/blog/index.php?2008/07/24/349-shooting-star-…3

Here is another (much shorter) tutorial in English, from an unknown source at the University of Texas in Dallas:

http://www.utdallas.edu/~ama054000/rt_tutorial.html

There was a tutorial session at the FOSS4G 2007 conference called Web-based Routing: An Introduction to pgRouting with OpenLayers.

All the materials and notes are online. It’s Linux-centric, and uses OpenLayers and MapServer, which don’t really interest me, as I think it is too much overhead for just displaying a route on Google Maps, but it looks like there’s some really good information in there.

Links:

  • http://pgrouting.postlbs.org
  • http://www.postgresql.org
  • http://www.orkney.co.jp
December 19, 2009 at 7:27 am Comments (0)

MySQL vs PostgreSQL

Interesting head to head comparison…

http://www.wikivs.com/wiki/MySQL_vs_PostgreSQL

Lots of terminology I don’t quite understand, and probably don’t need to, but some good nuggets of information.

, ,
December 19, 2009 at 6:35 am Comments (0)

Copenhagen: Sham Deal Requires Nothing, Accomplishes Nothing

There will be a lot of spin from the White House and others about how the unsurprising but disappointing failure in Copenhagen is a “meaningful agreement, a “step forward,” or a “continuation of the dialogue.”  Thank goodness for Friends of the Earth, who are not afraid to tell the truth:

Friends of the Earth U.S. Reaction: Sham Deal Requires Nothing, Accomplishes Nothing

Climate negotiations in Copenhagen have yielded a sham agreement with no real requirements for any countries. This is not a strong deal or a just one — it isn’t even a real one. It’s just repackaging old positions and pretending they’re new. The actions it suggests for the rich countries that caused the climate crisis are extraordinarily inadequate. This is a disastrous outcome for people around the world who face increasingly dire impacts from a destabilizing climate.

[...]

The devastation will extend to those of us who live in wealthy countries. If we cannot find a way to cooperate with others to produce a real agreement to solve this problem, climate change impacts will devastate the U.S. economy, undermine our security, and inflict irreparable harm on future generations.

The failure to produce anything meaningful in Copenhagen must serve as a wake up call to all who care about the future. It is a call to action. Corporate polluters and other special interests have such overwhelming influence that rich country governments are willing to agree only to fig leaf solutions. This is unacceptable, and it must change.

, ,
December 18, 2009 at 7:02 pm Comments (0)

Connecting to PostGIS with ArcGIS

PostGIS is a new alternative way to store datalayers, and fills a similar role to a directory containing shapefiles and/or coverages, an MS Access-based personal geodatabase, a file geodatabase, ArcSDE, Oracle Spatial, etc. In this case, the data resides in a PostgreSQL database. PostgreSQL is a database that is commonly used for web applications, similar to MySQL. Storing the information in a database rather than a bunch of files has a lot of advantages. The databases like PostgreSQL, MySQL, Oracle, etc. are referred to as RDBMS’s: Relational Database Management Software. This article (from ESRI’s ArcGIS help file) explains a bit about why it makes a lot of sense to store your GIS data in a database: A Short History Lesson on Simple Features in GIS.

A few of the advantages to using a database on a server:

  • easier to share
  • single version of data makes it easier to maintain, backup
  • multiple people can access/edit (even at the same time)
  • can connect with the data source in other ways (SQL queries, web pages, programs)

Disadvantages:

  • slower load times
  • what happens when you don’t have internet?
  • extra overhead; time to set up and configure
  • expertise in managing databases required

The main reason I am interested is to be able to use the free, open-source program for calculating routes, pgRouting, which is designed to work with PostGIS.

Unfortunately, it doesn’t look like this is possible to do for low cost. ESRI recently added support for PostGIS to ArcGIS version 9.3. It looks like you need the ArcGIS Server Enterprise software, which I do not have, and don’t have any intention of getting. According to the information on this manual page Using the PostGIS Geometry Type, it looks like ArcGIS is also quite picky about which specific version of PostgreSQL and PostGIS you can work with.

There is also a third-party extension called ZigGIS that lets you work with PostGIS data right from ArcMap. It was free for a while, but now it costs $279. It looks like nice software, but is not really useful for a project with a budget of $0. It looks like the developer makes the source code available for personal and educational use. The project is in Visual C# .NET, and I don’t really have the software or the skillset to compile these and make the program work.

My conclusion is that the OSGEO combination of qGIS/GRASS is probably the way to go, instead of wasting time or money trying to get ArcGIS to connect to PostGIS.

December 17, 2009 at 6:07 pm Comments (0)

Python – What makes a good dictionary key?

Python dictionaries are incredibly useful. In other programming languages, they’re called collections, hash tables, or associative arrays. If you’re an Excel user, think of what you normally do using a function like VLOOKUP or HLOOKUP. If your program needs to look up information that is indexed by some unique “key value, well, this what dictionaries are good for.

Integers work well as dictionary keys, but you should use caution in using floating point numbers (i.e. decimals). From Section 6.8 in the manual: Numeric types used for keys obey the normal rules for numeric comparison: if two numbers compare equal (such as 1 and 1.0) then they can be used interchangeably to index the same dictionary entry. (Note however, that since computers store floating-point numbers as approximations it is usually unwise to use them as dictionary keys.)”

Python dictionary with tuples as keys

Every item in a dictionary is a key:value pair. The key is what you’ll be using to do the lookup. Here’s an interesting and important concept: Keys must be immutable. In other words, they have to be a data type that can not be changed. Strings and numbers work. When you do some kind of string manipulation in Python, it creates a new copy in memory. Tuples work because they can’t be changed. For example,

T = (3, 4)

The tuple T does not have a method that you can call like T.append(5) or T.remove(4). If it’s a list like:

L = [3, 4]

you can use functions like .append(), .remove(), .insert() or .pop(). That means that it’s mutable, or changeable. And something that is mutable is not create a hash, or a unique identifier, for a list. Try it: hash(T) returns an integer, and hash(L) returns “TypeError: list objects are unhashable”.

Since dictionaries themselves are mutable (you can add and remove key-value pairs easily), you cannot use them as keys in other dictionaries.

More advanced stuff: If you want your own objects that you create to be dictionary keys, you have to define the method __hash__( self). See the manual section: Objects, values and types > Basic Customization.

,
December 17, 2009 at 5:50 pm Comments (0)

EWG Study of Tap Water Quality for 47,667 Water Utilities

The Environmental Working Group, a nonprofit based in Washington, DC released a report on the National Drinking Water Database (warning: annoying popups). EWG pulled together data for 47,667 utilities from 2004 to 2009, by requesting water quality data from 50 states and the District of Columbia. After compiling information from most states into one large database, they ranked water systems, looked at trends, and drew a number of conclusions, including this figure on the source of contaminants.

EWG ranked the quality of water provided by the largest 100 water utilities, which serve at least 250,000 people. Providence, Rhode Island ranks #2, just behind Arlington, Texas. This shows the benefits of an undeveloped watershed – Providence gets its water from the Scituate Reservoir, whose watershed is almost completely forested.

The New York Times printed an article, using the report to continue bashing the EPA for its lack of effective enforcement of the Safe Drinking Water Act. See, for example, December 8 piece, Millions in U.S. Drink Dirty Water, Records Show.

Meanwhile, the Riverside Press has coverage of agency staff going on the offensive after receiving low marks:

The Environmental Working Group says state records show some tests of the city’s treated water from 2004 to 2009 contained high levels of nitrate, arsenic, uranium and other pollutants.

David Wright, general manager of Riverside Public Utilities called the group’s analysis erroneous and untrue, saying the figures released by the organization were for untreated groundwater, not what comes out of the tap. If city water violated maximum contaminant levels set by federal regulators, customers would have to be notified; Riverside had no violations of state or federal drinking water standards in the five-year reporting period, Wright said.

Of course, it is easier to “question the group’s integrity” and “say it lacks scientific credibility” than it is to explain to customers why there are traces of toxic chemicals in their water supply.

December 17, 2009 at 12:30 pm Comments (0)

Carbon Offsets and Travel

Recently, we created a Green Committee at work. Even though we are an environmental organization, we realized that we could be doing a better job at a few things. For example, why doesn’t the office have a green bin, even though the county has a composting program for green waste?

A few people in the office asked us to specifically look at carbon offsets, and whether we recommended purchasing them for air travel. The New York Times published an article on the subject last month, titled Paying More for Flights Eases Guilt, Not Emissions. Their conclusion:

Yahoo and the House of Representatives decided to stop buying offsets, deciding their money was better spent investing in energy efficiency improvements.

Here is a quick list of some of the available information and guidance on carbon offsets from a friend at Friends of the Earth:

  • Clean Air Cool Planet was one of the first to come out with a Consumer’s Guide to Offsets. People still use it a lot, although it is getting dated.
  • The Suzuki Foundation has a newer 2009 Carbon Offset Guide for the Canadian market, but which should be helpful for US groups too.
  • My grad alma mater Tufts published research on carbon offsets in an April 2007 paper. It is a couple of years old now, but still informative. Mostly oriented towards air travel, the authors rate both carbon footprint calculators and offset programs.
  • GreenAmerica has some helpful tips: don’t buy tree-planting offsets (too difficult to ensure permanent sequestration); or from exchanges like the Chicago Climate Exchange (puts your money into carbon commodities, rather than directly funding projects; DriveNeutral, in SF is one of those)
  • For something really different, instead of donating money so that your carbon footprint can be “neutralized” tit-for-tat, you may consider donating money to grassroots groups working against fossil fuels. San Francisco-based Rainforest Action Network has one of these non-offsets programs.
, ,
December 17, 2009 at 11:13 am Comments (0)

IE8 does not really delete cookies until restart

As I’ve made a foray into developing small applications for the web, I’ve had to learn all about cookies, beyond a vague awareness that they’re important for certain sites to work, but that they’re sometimes bad. It’s interesting to look at how many cookies your browser stores just from routine web browsing.

I came across this somewhat unexpected and disquieting behavior in Internet Explorer 8 as I was testing a site. After you remove cookies by using Tools > Delete Browsing History, your cookies are still stored in the browser’s memory cache, and will be transmitted with any page requests. They are not really deleted until you close and restart the application.

Try this: log on to your favorite webmail (gmail, yahoo, and all the major ones use cookies to keep track of your session and your user authentication).

Delete cookies by choosing Tools > Delete Browsing History. Check cookies and click OK. Your stored cookies are gone right?

Reload the page. Without your browser sending a cookie to the web server, your email provider should have no way of knowing who you are or whether you are logged in. If the email application loads, then you have sent a cookie to the server.

Of course, this is usually what you want to happen, but NOT just after you’ve supposedly deleted the cookies. This behavior is a subtle but significant security risk for some users. When you delete cookies in other major browsers (Firefox, Chrome, Safari), they’re gone, without having to restart the browser.

If you want to get into more details, download the free software IEHTTPHeaders, “that displays the HTTP Headers sent and received by Internet Explorer as you surf the web.” This does the same work as the Firefox Add-on, Live HTTP Headers. Using these, you can see what kind of information your browser is sending to the web server when it requests a new page.

,
December 17, 2009 at 10:44 am Comments (0)

White House proposes new guidelines for water projects

On December 3, 2009, the White House Council on Environmental Quality
released a proposal to the National Academy of Sciences (NAS) for their
review that would significantly change the principles and guidelines that
govern America’s water resource planning. The proposal would require that
such projects help to improve the economic well-being of the Nation for
present and future generations, better protect communities from the effects
of floods and storms, help communities and individuals make better choices
about where to build based on an understanding of the risk, and protect and
restore the environment. Full story here:

http://www.whitehouse.gov/administration/eop/ceq/initiatives/PandG

,
December 17, 2009 at 10:35 am Comments (0)

« Older Posts