8

I have a fresh install of Ubuntu 14.04. I installed gdal with sudo apt-get install gdal-bin python-gdal. After this I have: GDAL 1.10.1 released 2013/08/26.

I am trying to tile the weather radar images from NOAA. The following are my steps and the error message that is displayed.

$wget http://radar.weather.gov/ridge/Conus/RadarImg/latest_radaronly.gif
$wget http://radar.weather.gov/ridge/Conus/RadarImg/latest_radaronly.gfw
$gdal_translate -of vrt -expand rgba ./latest_radaronly.gif temp.vrt
$cp ./latest_radaronly.gfw ./temp.wld
$gdal2tiles.py -s EPSG:3857 -w none -r near -z 3-5 -n ./temp.vrt ./temp/

The errors shown are then:

ERROR 6: EPSG PCS/GCS code 900913 not found in EPSG support files.  Is this 
a valid EPSG coordinate system?
ERROR 6: No translation for an empty SRS to PROJ.4 format is known.
ERROR 6: No translation for an empty SRS to PROJ.4 format is known.
Generating Base Tiles:
ERROR 5: Illegal values for buffer size
ERROR 5: Illegal values for buffer size

From that error, it seems that there is a problem with the EPSG:900913 (google) format. That is why I specifically set -s EPSG:3857.

All of this should work. I did the steps above from scratch, because I have an older server (ubuntu 12.04) where I am currently doing this without error. Once I upgrade to 14.04 the error above shows up. I am trying find the reason for the error. A google search for the the error message results in some old email list traffic that were either not about ubuntu or had other issues.

As a side note, I also tried building from source and there was no change in the errors displayed.

3
  • 4
    It is python script and you can open the file and edit 900913 into 3857 in all places. In GDAL 2.0.1 this fix is included. Main reason is probably that newer Proj4 does not come with the fake 900913 code.
    – user30184
    Sep 14, 2015 at 5:02
  • 3
    @user30184 I think your comment is worth a full answer.
    – AndreJ
    Sep 14, 2015 at 5:21
  • Replacing the code in the gdal2tiles.py file does work.
    – hazzey
    Sep 14, 2015 at 11:16

1 Answer 1

15

Going from what @user30184 said in the comment.

This issue is that the gdal2tiles.py script tells gdal to output 'mercator' as EPSG:900913. This is fine as long as it knows how to convert to this.

The fix is to change the following line in gdal2tile.py (line 785):

if self.options.profile == 'mercator':
    self.out_srs.ImportFromEPSG(900913)

to:

if self.options.profile == 'mercator':
    self.out_srs.ImportFromEPSG(3857)

This one change allows gdal2tiles.py to run without error.

1
  • spot on. works for newer version of gdal (different line number) on Ubuntu 16.04.4 UPVOTED :)
    – tony gil
    Apr 23, 2018 at 21:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.