Skip to main content
Solved

Create raster of counted polylines


katericondo
Contributor
Forum|alt.badge.img+4

Is there a way to create a raster of polylines, showing the counts rather than density per area magnitude? I have 17,000 lines and I'm trying to recreate the below graphic/visualization:

 

Best answer by daveatsafe

Thanks for the dataset - I was able to tweak the workspace a bit for a proper result:

  • Added a Counter to use with the Group By on the NumericRasterizer - this will properly create a single raster for each line
  • Added a Bufferer to buffer the lines into polygons for better raster rendering - width is pixel size * 5

If you just want the raw count, you can use the output of the RasterMosaicker and discard the downstream transformers

View original
Did this help you find an answer to your question?

5 replies

daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • March 27, 2023

Hi @katericondo​,

You could create a simple raster from each line, with the line value being 1 and background being 0, then sum them with a RasterMosaicker:

Screen Shot 2023-03-27 at 3.19.19 PMAfter summing the lines in a single raster, use the RasterExpressionEvaluator to calculate the daily average from the sum and the number of days. To apply a color ramp, use a RasterCellValueReplacer to assign an index to each range, then apply a color palette to the range values.

The attached workspace will do most of this for you, but you will need to adjust the calculation in the RasterExpressionEvaluator to match your date range.

The extents and resolution of the input rasterizer is published to User Parameters, allowing you to easily set the range and resolution of the final graphic. It can be just a small area of the flight lines if desired.


katericondo
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • March 28, 2023

Hi @daveatsafe​ 

 

I'm still running into errors. Essentially, I just want number of lines (count) by raster. I created a grid and was trying to use LineOnAreaOverlayer but that's not working either. Attached is the subset I'm testing with.


katericondo
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • March 28, 2023

Perhaps, using SpatialRelator, and creating a grid using the cell dimensions?


daveatsafe
Safer
Forum|alt.badge.img+19
  • Safer
  • Best Answer
  • March 28, 2023

Thanks for the dataset - I was able to tweak the workspace a bit for a proper result:

  • Added a Counter to use with the Group By on the NumericRasterizer - this will properly create a single raster for each line
  • Added a Bufferer to buffer the lines into polygons for better raster rendering - width is pixel size * 5

If you just want the raw count, you can use the output of the RasterMosaicker and discard the downstream transformers


katericondo
Contributor
Forum|alt.badge.img+4
  • Author
  • Contributor
  • March 28, 2023
daveatsafe wrote:

Thanks for the dataset - I was able to tweak the workspace a bit for a proper result:

  • Added a Counter to use with the Group By on the NumericRasterizer - this will properly create a single raster for each line
  • Added a Bufferer to buffer the lines into polygons for better raster rendering - width is pixel size * 5

If you just want the raw count, you can use the output of the RasterMosaicker and discard the downstream transformers

Thank you, Dave!

 

I just had to update Ground extents to use input for it to run with our larger dataset, and wrote to an Esri raster.

 

All the best!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings