[postgis-users] Simple Line Density

Stephen Woodbridge woodbri at swoodbridge.com
Sat Dec 22 15:02:28 PST 2012


On 12/22/2012 3:07 PM, Jeff Adams - NOAA Affiliate wrote:
> Hi,
>
> I was wondering if anybody knew of a way to create a very simple line
> density raster. I am not interested in interpolation or clustering,
> simply how many line features pass through each pixel in the raster. I
> know how to do this with points, but am having difficulty figuring out
> how to do it with lines. Any help would be greatly appreciated...

Separate from the SQL, you probably need to have a strategy for doing 
this. so with a point I assume you just increment the point in the 
raster for each point. So with a line we want to increment the all the 
raster points along the line. Some options:

1. render the line into an empty raster then add that raster to your 
master raster. Where add will increment by one every set  raster point 
in the rendered line.

2. segmentize the line into segments that are the size of a pixel in 
your master raster and then add the midpoints of those segments to your 
master raster.

Would one of these work for you?

-Steve



More information about the postgis-users mailing list