Polygon to Raster - Extend either continuous or discrete?

2371
4
Jump to solution
03-27-2012 05:22 AM
bodoMalowerschnig
New Contributor
Hi

Using the "Polygon to Raster" tool it will either create a discrete (1,2,3,4) or continuous (1.5, 1.7 , 1.8) rasterfile.
Fine.

But why is the EXTEND of this raster also either discrete or continuous? Thats a bug IMO. The extend has nothing to do with the values in my raster file and should
not have an influence on the coordinate system and zero-point.

Try it for yourself, create a raster out of square polygons where the extend of the layers source is not a discrete number. The results is that "Polygon to Raster"
will cut everything after the decimal point...48600,8324 meters will become 48600 meters.
0 Kudos
1 Solution

Accepted Solutions
PatrickTaurman
Occasional Contributor III
Hi bodomalo,

I think the issue you are running into is the cellsize you are using in the Polygon to Raster tool.  Lets say your polygon shapefile has an extent of 48600,8324 meters on the left and 48700,9324 meters on the right, and you specify a cellsize of 2 meters in the Polygon to Raster tool.  There is 100.1 meters between the left and right extent, and since you specified 2 meters as the cellsize you end up with 50.05 pixels, however you can't have .05 pixels.  This isn't possible, so you lose .05 of the extent. 

To illustrate this, I created a polygon that is 2 meters x 2 meters.  I then used the Polygon to Raster tool, and specified 1 as the output cellsize.  You can see from my screenshots, the extent is exactly the same as the polygon.  Next I ran the tool again, but used .7 as my cellsize.  You can see that the extent is different from the polygon, because you can't have part of a pixel.

[ATTACH=CONFIG]13025[/ATTACH][ATTACH=CONFIG]13026[/ATTACH][ATTACH=CONFIG]13027[/ATTACH][ATTACH=CONFIG]13028[/ATTACH][ATTACH=CONFIG]13029[/ATTACH]

Patrick

View solution in original post

0 Kudos
4 Replies
PatrickTaurman
Occasional Contributor III
Hi bodomalo,

I think the issue you are running into is the cellsize you are using in the Polygon to Raster tool.  Lets say your polygon shapefile has an extent of 48600,8324 meters on the left and 48700,9324 meters on the right, and you specify a cellsize of 2 meters in the Polygon to Raster tool.  There is 100.1 meters between the left and right extent, and since you specified 2 meters as the cellsize you end up with 50.05 pixels, however you can't have .05 pixels.  This isn't possible, so you lose .05 of the extent. 

To illustrate this, I created a polygon that is 2 meters x 2 meters.  I then used the Polygon to Raster tool, and specified 1 as the output cellsize.  You can see from my screenshots, the extent is exactly the same as the polygon.  Next I ran the tool again, but used .7 as my cellsize.  You can see that the extent is different from the polygon, because you can't have part of a pixel.

[ATTACH=CONFIG]13025[/ATTACH][ATTACH=CONFIG]13026[/ATTACH][ATTACH=CONFIG]13027[/ATTACH][ATTACH=CONFIG]13028[/ATTACH][ATTACH=CONFIG]13029[/ATTACH]

Patrick
0 Kudos
bodoMalowerschnig
New Contributor
Hi Patrick

No, I do not think that this is the problem. My extend size has no irregular floating point numbers.
I can create that error also with a very simple Polygon Grid (all my polygons are squares and exactly 100x100 Meters)

I tried some more "Polygon to Raster" conversions today and learned the following:

I always set the ENVIROMENT - Processing EXTEND - to an existing Raster files extend (I want my new pixels exactly at the same position):
Extend of original raster file is:
TOP 428499,809500
BOTTOM 305499,809500
LEFT 153499,885400
RIGHT 372499,885400

You see the y resolution is
428499,809500 MINUS 305499,809500 =  123000.00 Meters

But when I create a RASTER and save it in some normal FOLDER the EXTEND will be set to:
TOP 428499
BOTTOM 305499
LEFT 153499
RIGHT 372499

I loose 0,8... Meters and the new Grid does not match the old one.

BUT - here comes the surprise (!) - When I create the RASTER file in my FileGeodatabase it creates not a GRID, it creates a FGDBR (FileGEoDatabaseRaster) and to my surprise
it sets the extend to the exact input values.


It is either a bug or a feature I do not understand.
But Polygon to Raster only works perfect when you save the output in the same gdb file.
0 Kudos
JeffreySwain
Esri Regular Contributor
Per your description, I see that you are using the ',' as a decimal place.  Can you indicate what regional setting you are using for your testing?  Or conversely, can you see the behavior if you switch to an English regional setting with the decimal as a '.' is used.

I will echo what Patrick said, in that when the new raster is created and the cell size is specified, the output will be fit as best to the new extent with the cell size. What are you setting as the 'snap raster' value in the environment variable?  If you are maintaining the same extent, cell size and snap raster, the output should match. 

When tested here, I created a new raster from a polygon with decimal value extents and the created raster with a cell size of 100 maintained the decimal output extents.  [ATTACH=CONFIG]13178[/ATTACH]

Based on this, I would consider altering the regional settings to one that uses decimals rather than commas if you do not want to create the Support Incident.  There are a few bug reports that may be reporting the behavior you are experiencing, but without more information, I would not feel comfortable providing that information.
0 Kudos
SteveLynch
Esri Regular Contributor
NIM063257 - PolygonToRaster - output cellsize and extent values do not have decimal values in comma locale when input cell size has decimals (only with grid output)

, in ArcGIS10 SP2, fixed this problem.

If you install SP2 or later, does it fix your problem?

Steve
0 Kudos