|
|
| GeoCommunity Mailing List |
| |
| Mailing List Archives |
| Subject: | RE: [gislist] Rounding in Spatial Analyst |
| Date: |
07/09/2004 07:35:01 AM |
| From: |
Marc Allred |
|
|
Thanks everyone. There were a few people who gave me the correct answer that were just like Gregs below. What faked me out was that the temporary calculation layer that is created from Spatial Analyst comes out in a classified symbology that has 5 decimal places. But, when I checked in the attribute table, the field was in whole numbers. Once I made the calculation layer into a permanent layer the decimal places went away.
Thanks again,
Marc Allred
-----Original Message----- From: gislist-bounces@lists.thinkburst.com [mailto:gislist-bounces@lists.thinkburst.com] On Behalf Of Gregory Yetman Sent: Thursday, July 08, 2004 3:49 PM To: Marc Allred Cc: gislist@lists.thinkburst.com: NCGIS Subject: Re: [gislist] Rounding in Spatial Analyst
Hi Marc,
The INT function truncates to whole numbers ('rounding towards zero'), to round values .5 or greater up use:
outgrid = int(ingrid + 0.5)
unless you have negative values that you need rounded, then use:
outgrid = int(con(ingrid lt 0, ingrid - 0.5, ingrid + 0.5))
Greg
---------------------------------------------------------------------- Gregory Yetman Center for International Earth Science Information Network (CIESIN) Columbia University URL: http://www.ciesin.columbia.edu/ e-mail: gyetman@ciesin.columbia.edu tel: (845) 365-8982 ----------------------------------------------------------------------
On Thu, 8 Jul 2004, Marc Allred wrote:
> I'm working in Spatial Analyst 8.3. What is the formula in raster > calculator that can make my grid values rounded to the decimal place? > Example, I have a grid value of 1,203.021302 and I would like for it > to show 1,203. > > Marc Allred > Northwest Piedmont COG > GIS Analyst > Phone: 336-761-2111 > Fax: 336-761-2112 > E-mail: mallred@nwpcog.org > > > _______________________________________________ > gislist mailing list > gislist@lists.geocomm.com > http://lists.geocomm.com/mailman/listinfo/gislist > > _________________________________ > This list is brought to you by > The GeoCommunity > http://www.geocomm.com/ > > Get Access to the latest GIS & Geospatial Industry RFPs and bids > http://www.geobids.com >
_______________________________________________ gislist mailing list gislist@lists.geocomm.com http://lists.geocomm.com/mailman/listinfo/gislist
_________________________________ This list is brought to you by The GeoCommunity http://www.geocomm.com/
Get Access to the latest GIS & Geospatial Industry RFPs and bids http://www.geobids.com
_______________________________________________ gislist mailing list gislist@lists.geocomm.com http://lists.geocomm.com/mailman/listinfo/gislist
_________________________________ This list is brought to you by The GeoCommunity http://www.geocomm.com/
Get Access to the latest GIS & Geospatial Industry RFPs and bids http://www.geobids.com
|
|

Sponsored by:

For information regarding advertising rates Click Here!
|