Jump to content

 
Photo

Ascii to Raster

- - - - -

  • Please log in to reply
10 replies to this topic

#1
spesseh

spesseh

    Key Contributor

  • Validated Member
  • PipPipPip
  • 62 posts
  • Norway

Hi. I have a dataset of precipitation data which i try to convert into a GIS readable format.
The dataset are downloaded from GPCC ftp://ftp.dwd.de/pub/data/gpcc/full_data/...e_1951_1960.zip

What i have done is to take each of the files into my notepad++ and deleted everything above the first row of data. Then i added:
ncols 720
nrows 360
xllcenter 179.75
yllcenter 89.75
cellsize 0.5

This produces a very deformed raster, where it seems that data are put on top of each other.
For me it seems like the world is divided into four parts, and all stacked on top of each other.
Anyone have an idea of what i might be doing wrong?
The documentation on the format is here: ftp://ftp-anon.dwd.de/pub/data/gpcc/html/...formatdesc.html

Best, Andreas

Attached Files


Andreas

Visit my Blog: http://www.gisintersect.com

#2
Nick Springer

Nick Springer

    CartoTalk Founder Emeritus

  • Moderator
  • PipPipPipPipPipPip
  • 939 posts
  • Gender:Male
  • Location:Crosswicks, NJ
  • Interests:Cartographic Design, Print Maps, Graphic Design, Web Development, Ultimate Frisbee
  • United States

This is just a guess without looking at the data, but are the south and west coordinates properly signed (i.e negative)?

Nick Springer

Director of Design and Web Applications: ALK Technologies Inc.
Owner: Springer Cartographics LLC


#3
Crischan

Crischan

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 199 posts
  • Gender:Male
  • Location:Eberswalde, Germany
  • Interests:Spatial Information Design
  • Germany

You are trying to create a ESRI grid where for each cell there is one value. These datasets contain three values for each cell, so a simple header replacement won't do.
My colleague at work processed a lot of these DWD datasets into GIS-readable datasets, so I will ask her how she did it.

Cheers,
Crischan
Crischan Wygoda
http://wygoda.net

#4
ProMapper

ProMapper

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 216 posts
  • Gender:Female
  • Location:India
  • Interests:promapper@gmail.com
  • India

Hi Andreas

Well as a trial I worked on your data. I took the first file from the archive the gpcc_full_data_v004_05_degree_011951. Now this file gives the grid cell as half degree so one will get 720 columns in the Arc Grid file and 360 rows. The data given in the original file is one record per line and it contains three values whereas in any grid you can use only one value. So I picked up the first value which is the precipitation and created a file with 720 columns and 360 rows. To put it simply start from value number 1 to value number 720 in the original file and put it in the first row of a new file and then from 721 to 1440 in the next row and so on, one can not do it manually, so I wrote a small code in VB to do the job and got the file. Now just put in the header values to make it a Arc Grid file and that's about it.

I am attaching the converted ArcGrid ascii file and also the precipitation map jpg file for you to have a look.

I can convert all the files if you want to ArcGrid ascii format, but only the precipitation would be available as the height, similar to DEM format. Contact me at promapper at gmail dot com.

Anu
http://www.mapsandlocations.com

Attached Files



#5
ProMapper

ProMapper

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 216 posts
  • Gender:Female
  • Location:India
  • Interests:promapper@gmail.com
  • India

Well the zero values in the previous image have been shown in dark blue color which does not gel with the precipitaion patterns around. So here I have used sand color for zero values of precipitation to produce a little better picture.

Have a look.

Anu
http://www.mapsandlocations.com

Attached Files



#6
ProMapper

ProMapper

    Master Contributor

  • Validated Member
  • PipPipPipPip
  • 216 posts
  • Gender:Female
  • Location:India
  • Interests:promapper@gmail.com
  • India

For those who do not want to download the full archive of original data which is more than 50mb, here I attach one file from which the above data has been produced.

As far as the header for making it ArcGrid compatible file it was like this:-

ncols 720
nrows 360
xllcorner -180.0000000000
yllcorner -90.0000000000
cellsize 0.5
nodata_value -99999.99

It is the lower left corner values in lat long.

Anu
http://www.mapsandlocations.com

Attached Files



#7
spesseh

spesseh

    Key Contributor

  • Validated Member
  • PipPipPip
  • 62 posts
  • Norway

Great. Thank you for your helping ideas. I will contact you on mail!
Andreas

Visit my Blog: http://www.gisintersect.com

#8
Nicholas_C

Nicholas_C

    Contributor

  • Validated Member
  • PipPip
  • 43 posts
  • Location:Seattle
  • United States

Hello. I thought I would resurrect this old thread instead of starting anew-

I'm trying to work with some of the SEDAC datasets , in particular the Cyclone Hazard Freq. and Distr. , and a few others.

I can add it directly to ArcMap (it comes with a .prj file) and get to to display more or less as needed, but I would like to be able to convert it to and ESRI raster grid for additional analyses.

When I use the ASCII to Raster tool in ArcToolbox, I get an error code 000856. I've tried using different file locations, both FLOAT and INTEGER options (should be INTEGER though). I also tried converting all the nodata values in the .asc file (currently -9999) to 0 and to NODATA, but no luck. The syntax in the .asc file seems legit.

Available relevant software are ArcGIS 9.3.0 (the budget version ArcView - no Spatial Analyst), notepad, MS Xcell. I have ArcGIS 10 available but haven't gotten around to the install. If it ain't broke - don't fix it, but maybe it is now?

Anyone have any tips/trick/suggestions for me? Not sure what I (or my machine) is doing wrong here. Thanks.

Cheers - N

#9
Melita Kennedy

Melita Kennedy

    Key Contributor

  • Validated Member
  • PipPipPip
  • 68 posts
  • Gender:Not Telling
  • Location:Redlands, CA
  • United States

Hello. I thought I would resurrect this old thread instead of starting anew-

I'm trying to work with some of the SEDAC datasets , in particular the Cyclone Hazard Freq. and Distr. , and a few others.

I can add it directly to ArcMap (it comes with a .prj file) and get to to display more or less as needed, but I would like to be able to convert it to and ESRI raster grid for additional analyses.

When I use the ASCII to Raster tool in ArcToolbox, I get an error code 000856. I've tried using different file locations, both FLOAT and INTEGER options (should be INTEGER though). I also tried converting all the nodata values in the .asc file (currently -9999) to 0 and to NODATA, but no luck. The syntax in the .asc file seems legit.

Available relevant software are ArcGIS 9.3.0 (the budget version ArcView - no Spatial Analyst), notepad, MS Xcell. I have ArcGIS 10 available but haven't gotten around to the install. If it ain't broke - don't fix it, but maybe it is now?

Anyone have any tips/trick/suggestions for me? Not sure what I (or my machine) is doing wrong here. Thanks.

Cheers - N


Hi Nicholas,

If you can display it in ArcMap, right click the layer in the table of contents and select data, export data.

Melita

#10
CentralAmericaExpe

CentralAmericaExpe

    Contributor

  • Validated Member
  • PipPip
  • 16 posts
  • Gender:Male
  • Interests:"I do recognize risk, and having recognized risk, I spend a lot of time minimizing it." Tim Severin
  • Canada

nodata_value -99999.99


...it seems like you are using ArcGIS toolbox to do the ascii/gris conversion? To make those nodata values null, you could use raster calculator:

con([inputgrid] > -99999.99, [outgrid])

...don't forget to save your outgrid as permanent!

I also tried converting all the nodata values in the .asc file (currently -9999) to 0 and to NODATA, but no luck


Try this:

con([inputgrid] < -9999, 0, [outgrid])

....and after the above, use the same concept previous to above (but this is the long way to do what you want!)...


Cheers,
Derek-
"I do recognize risk, and having recognized risk, I spend a lot of time minimizing it." Tim Severin

#11
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,299 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

Nicholas - I think you might need Spatial Analyst for these things, including the stuff Derek mentions. You can run all processes directly on the ascii grid, just as on any format, you don't need to convert it first.
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->