Polygon to Raster misses data

5403
7
Jump to solution
11-20-2012 09:22 AM
AustinMilt
New Contributor III
I am writing a script that converts features to a binary raster based on presence/absence in a cell.

In practice, when converting polylines to raster using "Polyline to Raster (conversion)", any cell through which a line passes is counted as data in the output raster. However, (and here is my problem), when converting polygons to raster using "Polygon to Raster (conversion)", only cells whose center is overlapped by the polygon are counted as data in the output.

My problem is that I want the polyline to raster functionality when executing polygon to raster, i.e. I want any cell for which the polygon overlaps at all to be turned into data in the output. Is there a way to do this?

To illustrate the problem: [ATTACH=CONFIG]19440[/ATTACH]

Notice that the sliver that sticks down in the original polygon is missing in the polygon to raster, but is present in the polyline to raster (bottom row). What I would like is to have the output in the bottom-right, but for the values inside the raster border to have the same value as the border.

Edit: I know that you can change the polygon to raster behavior to use "maximum area", but this still registers NoData if the cell area covered is <50%. My example illustrates how polygon to raster still fails.
0 Kudos
1 Solution

Accepted Solutions
SteveLynch
Esri Regular Contributor
have a look in the doc, http://resources.arcgis.com/en/help/main/10.1/#/How_Polygon_To_Raster_works/001200000037000000/

Viz.,
If priority is specified, and:
  The feature in question overlaps the cell by less than 50%, and:
  - The priority is greater than zero, then it is considered.
  - The priority is equal to zero, then the feature is not considered.

Add a field to your polygon feature class and populate it with 1's and use this as the priority field.

BTW, from ArcGIS 10 onwards, FeatureToRaster internally calls Point, Polyline or Polygon to Raster.


Regards
Steve

View solution in original post

0 Kudos
7 Replies
DanPatterson_Retired
MVP Emeritus
have you tried to specify a specific cell size or are you relying on the defaults?   I would specify an output cell size to optimize the conversion.
0 Kudos
AustinMilt
New Contributor III
Just thought of a pretty inefficient solution, which could be generalized to non-binary outputs:


  1. convert the polygon to a polyline

  2. run Polygon to Raster on the polygon

  3. run Polyline to Raster on the polyline

  4. use Con( ~ IsNull (raster), 1, 0 ) on each raster

  5. output = [polyline_raster] | [polygon_raster]


0 Kudos
AustinMilt
New Contributor III
have you tried to specify a specific cell size or are you relying on the defaults?   I would specify an output cell size to optimize the conversion.


There is a specific cell size I have to use. In general, cell sizes will not be small.
0 Kudos
RobinCheskin
New Contributor III
Have you tried the Feature to Raster tool instead?
0 Kudos
SteveLynch
Esri Regular Contributor
have a look in the doc, http://resources.arcgis.com/en/help/main/10.1/#/How_Polygon_To_Raster_works/001200000037000000/

Viz.,
If priority is specified, and:
  The feature in question overlaps the cell by less than 50%, and:
  - The priority is greater than zero, then it is considered.
  - The priority is equal to zero, then the feature is not considered.

Add a field to your polygon feature class and populate it with 1's and use this as the priority field.

BTW, from ArcGIS 10 onwards, FeatureToRaster internally calls Point, Polyline or Polygon to Raster.


Regards
Steve
0 Kudos
AustinMilt
New Contributor III
Ah, I did not pay close enough attention when reading that the first several times. I'll give the priority field a try and see how it fairs. Thanks for the help.
0 Kudos
AustinMilt
New Contributor III
stevelynch's method works great. Thanks!
0 Kudos