<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using Geocoders with GeoDjango</title>
	<atom:link href="http://blog.thescoop.org/archives/2010/01/24/using-geocoders-with-geodjango/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.thescoop.org/archives/2010/01/24/using-geocoders-with-geodjango/</link>
	<description>Derek Willis' weblog on investigative and computer-assisted reporting.</description>
	<lastBuildDate>Tue, 07 Feb 2012 03:32:53 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Chris Amico</title>
		<link>http://blog.thescoop.org/archives/2010/01/24/using-geocoders-with-geodjango/comment-page-1/#comment-146181</link>
		<dc:creator>Chris Amico</dc:creator>
		<pubDate>Mon, 25 Jan 2010 15:49:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.thescoop.org/?p=5288#comment-146181</guid>
		<description>Here&#039;s how I&#039;ve mostly done it (using &lt;a href=&quot;http://code.google.com/p/geopy/&quot; rel=&quot;nofollow&quot;&gt;Geopy&lt;/a&gt;, which has the same issue):

def geocode(q):
    place, (lat, lng) = g.geocode(&#039;somewhere&#039;)
    return Point(lng, lat)

I do like Simon&#039;s fix, though.</description>
		<content:encoded><![CDATA[<p>Here&#8217;s how I&#8217;ve mostly done it (using <a href="http://code.google.com/p/geopy/" rel="nofollow">Geopy</a>, which has the same issue):</p>
<p>def geocode(q):<br />
    place, (lat, lng) = g.geocode(&#8216;somewhere&#8217;)<br />
    return Point(lng, lat)</p>
<p>I do like Simon&#8217;s fix, though.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derek</title>
		<link>http://blog.thescoop.org/archives/2010/01/24/using-geocoders-with-geodjango/comment-page-1/#comment-146178</link>
		<dc:creator>Derek</dc:creator>
		<pubDate>Mon, 25 Jan 2010 15:02:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.thescoop.org/?p=5288#comment-146178</guid>
		<description>Thanks, Simon! I think yours is the most flexible solution for everybody. And I&#039;m not a real geo-nerd either; just someone who gets to look good thanks to GeoDjango.

Aaron - yeah, you could, sure. I guess it just looked cleaner to me the other way.</description>
		<content:encoded><![CDATA[<p>Thanks, Simon! I think yours is the most flexible solution for everybody. And I&#8217;m not a real geo-nerd either; just someone who gets to look good thanks to GeoDjango.</p>
<p>Aaron &#8211; yeah, you could, sure. I guess it just looked cleaner to me the other way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron</title>
		<link>http://blog.thescoop.org/archives/2010/01/24/using-geocoders-with-geodjango/comment-page-1/#comment-146176</link>
		<dc:creator>Aaron</dc:creator>
		<pubDate>Mon, 25 Jan 2010 12:47:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.thescoop.org/?p=5288#comment-146176</guid>
		<description>As you say, it&#039;s not a huge deal -- and I&#039;m not opposed to forking for minor changes -- but would it be easier to just do:

pnt = Point(results[1][::-1])</description>
		<content:encoded><![CDATA[<p>As you say, it&#8217;s not a huge deal &#8212; and I&#8217;m not opposed to forking for minor changes &#8212; but would it be easier to just do:</p>
<p>pnt = Point(results[1][::-1])</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Willison</title>
		<link>http://blog.thescoop.org/archives/2010/01/24/using-geocoders-with-geodjango/comment-page-1/#comment-146175</link>
		<dc:creator>Simon Willison</dc:creator>
		<pubDate>Mon, 25 Jan 2010 12:36:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.thescoop.org/?p=5288#comment-146175</guid>
		<description>I&#039;m clearly not a real geo-nerd, because I&#039;ve always found longitude/latitude ordering unintuitive. You&#039;re right though, it&#039;s silly not to support the format used by GeoDjango. I&#039;ve just committed a fix for this, which changes the API to look like this:

&gt;&gt;&gt; from geocoders.google import geocoder
&gt;&gt;&gt; geocode = geocoder(&#039;GOOGLE-API-KEY&#039;, lonlat=True)
&gt;&gt;&gt; results = geocode(&#039;new york&#039;)
(u&#039;New York, NY, USA&#039;, (-73.986951000000005, 40.756053999999999))
&gt;&gt;&gt; pnt = Point(results[1])

As you can see, the default order remains the same (partly to ensure backwards compatibility for existing library users, but mainly because I prefer it) but you can now specify the order you want when you instantiate the geocoder - which you hopefully only do in one place in your code.

Here&#039;s the commit: http://github.com/simonw/geocoders/commit/46fc00bda4cff0fe222d38fe498aa9ba861e8dc1</description>
		<content:encoded><![CDATA[<p>I&#8217;m clearly not a real geo-nerd, because I&#8217;ve always found longitude/latitude ordering unintuitive. You&#8217;re right though, it&#8217;s silly not to support the format used by GeoDjango. I&#8217;ve just committed a fix for this, which changes the API to look like this:</p>
<p>&gt;&gt;&gt; from geocoders.google import geocoder<br />
&gt;&gt;&gt; geocode = geocoder(&#8216;GOOGLE-API-KEY&#8217;, lonlat=True)<br />
&gt;&gt;&gt; results = geocode(&#8216;new york&#8217;)<br />
(u&#8217;New York, NY, USA&#8217;, (-73.986951000000005, 40.756053999999999))<br />
&gt;&gt;&gt; pnt = Point(results[1])</p>
<p>As you can see, the default order remains the same (partly to ensure backwards compatibility for existing library users, but mainly because I prefer it) but you can now specify the order you want when you instantiate the geocoder &#8211; which you hopefully only do in one place in your code.</p>
<p>Here&#8217;s the commit: <a href="http://github.com/simonw/geocoders/commit/46fc00bda4cff0fe222d38fe498aa9ba861e8dc1" rel="nofollow">http://github.com/simonw/geocoders/commit/46fc00bda4cff0fe222d38fe498aa9ba861e8dc1</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

