<?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: Point in Polygon in Python</title>
	<atom:link href="http://www.heikkitoivonen.net/blog/2009/01/26/point-in-polygon-in-python/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.heikkitoivonen.net/blog/2009/01/26/point-in-polygon-in-python/</link>
	<description>A Finn in Silicon Valley - Adventures in Technology</description>
	<lastBuildDate>Wed, 17 Aug 2011 08:58:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
	<item>
		<title>By: Neil</title>
		<link>http://www.heikkitoivonen.net/blog/2009/01/26/point-in-polygon-in-python/comment-page-1/#comment-15190</link>
		<dc:creator>Neil</dc:creator>
		<pubDate>Tue, 25 Aug 2009 15:36:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikkitoivonen.net/blog/?p=650#comment-15190</guid>
		<description>For other google searchers, there is a fast version of this code in the python plotting library, matplotlib: 

&gt;&gt;&gt; from matplotlib.nxutils import points_inside_poly
&gt;&gt;&gt; help(points_inside_poly)
points_inside_poly(...)
    mask = points_inside_poly(xypoints, xyverts)
    
    Return a boolean ndarray, True for points inside the polygon.
    
    *xypoints*
        a sequence of N x,y pairs.
    *xyverts*
        sequence of x,y vertices of the polygon.
    *mask*    an ndarray of length N.
    
    A point on the boundary may be treated as inside or outside.
    See `pnpoly `_</description>
		<content:encoded><![CDATA[<p>For other google searchers, there is a fast version of this code in the python plotting library, matplotlib: </p>
<p>&gt;&gt;&gt; from matplotlib.nxutils import points_inside_poly<br />
&gt;&gt;&gt; help(points_inside_poly)<br />
points_inside_poly(&#8230;)<br />
    mask = points_inside_poly(xypoints, xyverts)</p>
<p>    Return a boolean ndarray, True for points inside the polygon.</p>
<p>    *xypoints*<br />
        a sequence of N x,y pairs.<br />
    *xyverts*<br />
        sequence of x,y vertices of the polygon.<br />
    *mask*    an ndarray of length N.</p>
<p>    A point on the boundary may be treated as inside or outside.<br />
    See `pnpoly `_</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Justin Bronn</title>
		<link>http://www.heikkitoivonen.net/blog/2009/01/26/point-in-polygon-in-python/comment-page-1/#comment-7005</link>
		<dc:creator>Justin Bronn</dc:creator>
		<pubDate>Sun, 01 Feb 2009 19:34:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikkitoivonen.net/blog/?p=650#comment-7005</guid>
		<description>You could&#039;ve just stopped at GeoDjango :).  It includes the original ctypes interface to GEOS, and has Point and Polygon objects that expose all of the geometric operations that GEOS provides.  Good suggestion about having &quot;point in polygon&quot; phrase in the docs, and I&#039;ll try to incorporate it into GeoDjango&#039;s GEOS docs: http://geodjango.org/docs/geos.html.  Here&#039;s an example:

&gt;&gt;&gt; from django.contrib.gis.geos import Point, Polygon
&gt;&gt;&gt; pnt = Point(1, 1)
&gt;&gt;&gt; poly = Polygon( ((0, 0), (0, 2), (2, 2), (2, 0), (0, 0)) )
&gt;&gt;&gt; poly.contains(pnt)
True
&gt;&gt;&gt; pnt.within(poly)
True</description>
		<content:encoded><![CDATA[<p>You could&#8217;ve just stopped at GeoDjango <img src='http://www.heikkitoivonen.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .  It includes the original ctypes interface to GEOS, and has Point and Polygon objects that expose all of the geometric operations that GEOS provides.  Good suggestion about having &#8220;point in polygon&#8221; phrase in the docs, and I&#8217;ll try to incorporate it into GeoDjango&#8217;s GEOS docs: <a href="http://geodjango.org/docs/geos.html" rel="nofollow">http://geodjango.org/docs/geos.html</a>.  Here&#8217;s an example:</p>
<p>&gt;&gt;&gt; from django.contrib.gis.geos import Point, Polygon<br />
&gt;&gt;&gt; pnt = Point(1, 1)<br />
&gt;&gt;&gt; poly = Polygon( ((0, 0), (0, 2), (2, 2), (2, 0), (0, 0)) )<br />
&gt;&gt;&gt; poly.contains(pnt)<br />
True<br />
&gt;&gt;&gt; pnt.within(poly)<br />
True</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.heikkitoivonen.net/blog/2009/01/26/point-in-polygon-in-python/comment-page-1/#comment-6882</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Wed, 28 Jan 2009 16:35:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikkitoivonen.net/blog/?p=650#comment-6882</guid>
		<description>I was looking for the exact same thing two days ago. I found this snippet on the Python list from somebody calling themselves Guido ;-)

  http://mail.python.org/pipermail/python-list/1999-September/012609.html

Do a search for Paul Burke&#039;s original page (the link in the mail is dead), as it explains the algorithms a lot more clearly.</description>
		<content:encoded><![CDATA[<p>I was looking for the exact same thing two days ago. I found this snippet on the Python list from somebody calling themselves Guido <img src='http://www.heikkitoivonen.net/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>  <a href="http://mail.python.org/pipermail/python-list/1999-September/012609.html" rel="nofollow">http://mail.python.org/pipermail/python-list/1999-September/012609.html</a></p>
<p>Do a search for Paul Burke&#8217;s original page (the link in the mail is dead), as it explains the algorithms a lot more clearly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Paddy3118</title>
		<link>http://www.heikkitoivonen.net/blog/2009/01/26/point-in-polygon-in-python/comment-page-1/#comment-6870</link>
		<dc:creator>Paddy3118</dc:creator>
		<pubDate>Tue, 27 Jan 2009 20:03:06 +0000</pubDate>
		<guid isPermaLink="false">http://www.heikkitoivonen.net/blog/?p=650#comment-6870</guid>
		<description>Snap!

&lt;a HREF=&quot;http://paddy3118.blogspot.com/2007/10/whats-in-name.html&quot; rel=&quot;nofollow&quot;&gt;What&#039;s in a name?&lt;/A&gt;

- Paddy.</description>
		<content:encoded><![CDATA[<p>Snap!</p>
<p><a HREF="http://paddy3118.blogspot.com/2007/10/whats-in-name.html" rel="nofollow">What&#8217;s in a name?</a></p>
<p>- Paddy.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

