<p>Hi,</p>
<p> </p>
<p>If you'd choosed to subdivise in equal parts you might have 3 lines and 4 columns (or 4 l * 3 c). So when a point A (ax,ay) is in a "primary" boxe, the related position in sub-boxes is:</p>
<p>i E {0,3) \ pcxi=<ax-pcx=<pcx(i+1) AND pcyi=<ay-pcy=<pcy(i+1)</p>
<p> </p>
<p>i = 0 pcx0=0</p>
<p>i=1 pcx1=rect.width/4</p>
<p>i=2 pcx2=rect.width/2</p>
<p>...</p>
<p> </p>
<p>pc as a corner point of the primary boxe (upper left or dow left).</p>
<p> </p>
<p> </p>
<p> </p>
<p><br /> <br /> <br /> <br /><br /></p>
<blockquote style="padding-left: 5px; margin-left: 5px; border-left: #ff0000 2px solid;">> Message du 15/08/13 00:17<br />> De : "René Fournier" <br />> A : "postgis-users@lists.osgeo.org" <br />> Copie à : <br />> Objet : [postgis-users] Subdividing a polygon (rectangle) into equal segments (smaller rectangles)<br />> <br />><span style="font-family: monospace;">Hi everyone,</span><br style="font-family: monospace;" /><br style="font-family: monospace;" /><span style="font-family: monospace;">Just wondering how to go about something:</span><br style="font-family: monospace;" /><br style="font-family: monospace;" /><span style="font-family: monospace;">Currently, I have a table with thousands of polygons (rectangles). I can query the table to see which of them contains a given point (lat/lng). With the resulting rectangle, I further need to determine *where* in the rectangle the given point (lat/lng) lies.</span><br style="font-family: monospace;" /><br style="font-family: monospace;" /><span style="font-family: monospace;">The reason is that each of the rectangles are actually subdivided into 12 smaller, equal rectangles, numbered/lettered A-L. How would you go about doing this? It doesn't seem like something I can compute in the initial query to retrieve the containing rectangle… Any ideas?</span><br style="font-family: monospace;" /><br style="font-family: monospace;" /><span style="font-family: monospace;">…Rene</span><!-- PART SEPARATOR --><br /><br /><br />_______________________________________________<br />postgis-users mailing list<br />postgis-users@lists.osgeo.org<br />http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users<br /><br /></blockquote>