<div>Hi,</div><div>I am new to PostGIS, have only been using it for the last couple of weeks.  I have been using the workshops.opengeo website to learn how to use PostGIS and am working with the sample NYC database that it came with.  I am trying to test how the ST_Intersect function works so that I can use it on a real database, but am not getting any rows returned.</div>
<div>Here's what I did:</div><div>1.  I created a polygon in Google Earth that covers the entire NY state and then, saved it as a KML.</div><div>2.  I opened the KML in a text editor used the coordinates to get a geometry using the ST_GeomFromKML function in PostGIS.  The query looks like this:</div>
<div><div>SELECT ST_GeomFromKML(' <Polygon></div><div><span class="Apple-tab-span" style="white-space:pre">                 </span><outerBoundaryIs></div><div><span class="Apple-tab-span" style="white-space:pre">                              </span><LinearRing></div>
<div><span class="Apple-tab-span" style="white-space:pre">                                      </span><coordinates></div><div><span class="Apple-tab-span" style="white-space:pre">                                                                                  </span>-75.7218231334201,40.86468238402224,0 -74.91763291540505,39.90090726204763,0 -71.50935163152492,39.85541359103798,0 -71.6577861052406,41.55717566179406,0 -74.71588104333701,41.6603205817405,0 -75.7218231334201,40.86468238402224,0 </div>
<div><span class="Apple-tab-span" style="white-space:pre">                                      </span></div><div><span class="Apple-tab-span" style="white-space:pre">                                     </span></coordinates></div><div><span class="Apple-tab-span" style="white-space:pre">                         </span></LinearRing></div>
<div><span class="Apple-tab-span" style="white-space:pre">                      </span></outerBoundaryIs></div><div><span class="Apple-tab-span" style="white-space:pre">             </span></Polygon>')</div><div><span class="Apple-tab-span" style="white-space:pre">               </span>;</div>
<div><br></div></div><div>3.  When I ran it the resulting geometry was:  </div><div>"01030000A0E6100000010000000600000047E2A75932EE52C0C36690E9AD6E444000000000000000007659687FBABA52C09B9CDDED50F34340000000000000000015E4953799E051C0F1074B317EED434000000000000000006271E42A19EA51C02EC4368851C7444000000000000000005D3DB9FED0AD52C0BFB9836285D44440000000000000000047E2A75932EE52C0C36690E9AD6E44400000000000000000"</div>
<div><br></div><div>4. I copied this into another sql and used the ST_Intersects function, the query is:</div><div><div>SELECT gid, id, "name", oneway, "type", the_geom</div><div>  FROM nyc_streets</div>
<div>  where st_intersects (the_geom, '01030000A0E6100000010000000600000047E2A75932EE52C0C36690E9AD6E444000000000000000007659687FBABA52C09B9CDDED50F34340000000000000000015E4953799E051C0F1074B317EED434000000000000000006271E42A19EA51C02EC4368851C7444000000000000000005D3DB9FED0AD52C0BFB9836285D44440000000000000000047E2A75932EE52C0C36690E9AD6E44400000000000000000');</div>
</div><div><br></div><div><br></div><div>5.  I expect to get every single street in the result, however I don't get any rows returned.</div><div><br></div><div>What am I doing wrong?</div><div><br></div><div>Please help!</div>
<div><br></div><div>Thanks</div><div><br></div><div>Meherzad</div>