Thanks Robert. That worked and I am going to use the concise format of MakeBox2D.<br>-Babu<br><br><div><span class="gmail_quote">On 9/15/07, <b class="gmail_sendername">Robert Coup</b> <<a href="mailto:robert.coup@onetrackmind.co.nz">
robert.coup@onetrackmind.co.nz</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 15/09/2007, Babu Naidu <<a href="mailto:pbnaidu@gmail.com">
pbnaidu@gmail.com</a>> wrote:<br>> I am trying to convert Google Maps GMap.getBounds() (which returns LatLng<br>> for south west and LatLng for north east)<br>> to POLYGON( ) ewkt format. This is to query for points within that POLYGON.
<br>><br>> I think I figured out the format and I would like to verify it with experts<br>> here. I have southwest Lat Lng and northeast LatLng<br>> considering Y=Lng and X=Lat<br>><br>> POLYGON(maxY  maxX,
<br>> maxY  minX,<br>> minY  minX,<br>> minY  maxX,<br>> maxY  maxX)<br>><br>> Is this the right way to create a POLYGON? could you please point me to docs<br>> if available that explain this format?<br>
<br>X should be Longitude, and Y Latitude. Always.<br><br>in WKT you need double-brackets for a polygon, and the common<br>convention is to do boxes in the following sequence:<br>POLYGON((minx miny, maxx miny, maxx maxy, minx maxy, minx miny))
<br><br>If you don't need to make WKT you could do the following instead,<br>which creates a geometry you can use in queries, etc:<br>MakeBox2D(MakePoint(minx, miny), MakePoint(maxx, maxy))<br><br>hth,<br><br>Rob :)<br>
_______________________________________________<br>postgis-users mailing list<br><a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users">
http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br></blockquote></div><br>