<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; ">Vamsee, this is more a PostGIS question than GEOS question so follow-up on postgis-users.<DIV><BR class="khtml-block-placeholder"></DIV><DIV>The query looks correct to me, what makes you think it is wrong? </DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>The 9999 issue is certainly a symptom of something else, you might want to post the results of EXPLAIN ANALYZE on that query.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>P<DIV><BR><DIV><DIV>On 30-Oct-06, at 11:33 AM, vamsee movva wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite">Hello all,<BR> I am working with spatial tables in postgresql with postgis support. i have two spatial data tables, one represents the whole state and another table represents the damaged locations in the state. My aim is to find number of damaged locations in every county or parish.<BR> Here i am giving the query i used to do this, could you please tell me whether i am doing right thing or not.<SPAN style="font-weight: bold;"><SPAN style="font-weight: bold;"><SPAN style="font-weight: bold;"><BR> </SPAN></SPAN></SPAN><SPAN style="font-weight: bold;"><BR> "select count(*) from locations l1,county l2 where l1.the_geom && l2.the_geom and intersects(l2.the_geom,l1.the_geom) and l2.countyid= some particular ID"<BR> <SPAN style="font-weight: bold;"><BR> </SPAN></SPAN>It gave some results, but i am not sure whether the query is correct or not,<BR> I have one more problem with this query, this query taking lot of time when <SPAN style="font-weight: bold;">some particular ID </SPAN>ends with 9999(ex:220750501002999 <DIV id="mb_0">,xxxxxxx9999), do u have any idea about this strange situation. <BR> <BR> excuse my english and method of requesting for help if there are any errors.<BR> Thanks in advance.<BR> have a nice day<BR> cheers<BR><SPAN class="sg"> vamsee </SPAN></DIV> <BR><BR><DIV><SPAN class="gmail_quote">On 10/30/06, <B class="gmail_sendername"><A href="mailto:strk@refractions.net">strk@refractions.net</A></B> <<A href="mailto:strk@refractions.net">strk@refractions.net</A>> wrote: </SPAN><BLOCKQUOTE class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Mon, Oct 30, 2006 at 11:50:04AM -0600, vamsee movva wrote:<BR>> Hello all,<BR>> I am using postgresql database with postgis support, i<BR>> understand postgis uses geos for geometrical calculations like contains(),<BR>> within() etc..<BR>> I am faced some problems when i used these functions, <BR>> can i ask for a help about them here?<BR><BR>Don't ask to ask, just ask :)<BR>--strk;<BR>_______________________________________________<BR>geos-devel mailing list<BR><A href="mailto:geos-devel@geos.refractions.net"> geos-devel@geos.refractions.net</A><BR><A href="http://geos.refractions.net/mailman/listinfo/geos-devel">http://geos.refractions.net/mailman/listinfo/geos-devel</A><BR></BLOCKQUOTE></DIV><BR><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">geos-devel mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:geos-devel@geos.refractions.net">geos-devel@geos.refractions.net</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://geos.refractions.net/mailman/listinfo/geos-devel">http://geos.refractions.net/mailman/listinfo/geos-devel</A></DIV> </BLOCKQUOTE></DIV><BR></DIV></DIV></BODY></HTML>