Oh and if you think there is a smarter way to do this, like maybe not making a raster like I am trying to etc then please let me know. The idea is that the road geometry is way way smaller than the point cloud which is in Terabytes, so I am making a grid index in some way around the road buffers, to speed up the computation. <br>
<br><div class="gmail_quote">On Thu, Mar 22, 2012 at 10:01 PM, Ed Linde <span dir="ltr"><<a href="mailto:edolinde@gmail.com">edolinde@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Pierre,<div>The idea is that I want to build this uniform grid on the road geometry and like you mention it has dimensions 1020x24798. I want to assign each cell a unique cell ID based on some formula like you had earlier ... x*width + y to get a 1D cell ID from (x,y). Hopefully I can do this on just (lat.long) of srid 4326 directly. Then I need to </div>
<div>intersect it to the buffers around the roads which I think should be easy once I have a raster, so this is just a normal intersect. Now I should know each cell and what road buffer it belongs to! Then on my second data set which is a massive point cloud with srid = 4326 as well, I just want to pass through it ONCE and compute in which cell it falls and hence associate a point with a road buffer. Hope that made sense :)</div>
<div><br></div><div>Cheers,</div><div>Ed</div><div class="HOEnZb"><div class="h5"><div><br><div class="gmail_quote">On Thu, Mar 22, 2012 at 9:53 PM, Pierre Racine <span dir="ltr"><<a href="mailto:Pierre.Racine@sbf.ulaval.ca" target="_blank">Pierre.Racine@sbf.ulaval.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">1020x24798 so more than 25 000 000 polygons... or pixels...<br>
<br>
So if I understand well you want to assign some values to each of those cells based on a vector coverage (of how many polygons)?<br>
<div><br>
> -----Original Message-----<br>
> From: <a href="mailto:postgis-users-bounces@postgis.refractions.net" target="_blank">postgis-users-bounces@postgis.refractions.net</a> [mailto:<a href="mailto:postgis-users-" target="_blank">postgis-users-</a><br>
> <a href="mailto:bounces@postgis.refractions.net" target="_blank">bounces@postgis.refractions.net</a>] On Behalf Of Ed Linde<br>
</div><div>> Sent: Thursday, March 22, 2012 4:43 PM<br>
> To: PostGIS Users Discussion<br>
> Subject: Re: [postgis-users] ST_Buffer + grid problem<br>
><br>
</div><div><div>> So far no proper raster, because the following failed, but maybe the polygon<br>
> gives us an idea? This polygon is the extent of all the road geometries in<br>
> Denmark. Also I remember that when you did the raster at your end you said it<br>
> worked. Is 0.000036 degrees = 4m correct if I want to get a 4m by 4m cell sized<br>
> uniform raster grid?<br>
><br>
> select ST_AsRaster( ST_GeomFromText('POLYGON((8.07734039737749<br>
> 54.4984986588244,8.07734039737749 57.7505109647578,15.1919565742587<br>
> 57.7505109647578,15.1919565742587 54.4984986588244,8.07734039737749<br>
> 54.4984986588244))'), 0.000036, 0.000036);<br>
><br>
><br>
> On Thu, Mar 22, 2012 at 9:39 PM, Pierre Racine <<a href="mailto:Pierre.Racine@sbf.ulaval.ca" target="_blank">Pierre.Racine@sbf.ulaval.ca</a>><br>
> wrote:<br>
><br>
><br>
> > Thanks. The raster I need to visualise is a 4m by 4m grid on the entire<br>
> map of<br>
> > Denmark! :) So do you classify that as a large raster? If so is there a<br>
> way to see a<br>
> > portion of it or something?<br>
> > I just want to manually check for a few areas on the map that the<br>
> intersection<br>
> > indeed works as expected and things haven't gone awry thanks to<br>
> projection<br>
> > differences or that I had degrees instead of meters or some such<br>
> thing. Well, I<br>
> > still have to first test if this GDAL upgrade will fix things and if make<br>
> empty raster<br>
> > .. makes a difference.<br>
><br>
><br>
> That must be big but Danemark is a small country ;-) Only width and<br>
> height tell you if a raster is big.<br>
><br>
> In the database, your grid is a set of rectangular geometry (how many?)<br>
> or just a big raster now (width & height)?<br>
><br>
> _______________________________________________<br>
> postgis-users mailing list<br>
> <a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
> <a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
><br>
><br>
<br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@postgis.refractions.net" target="_blank">postgis-users@postgis.refractions.net</a><br>
<a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br>