Category Archives: Tip
GDAL and GDAL2Tiles
GDAL (Geospatial Data Abstraction Layer) includes GDAL2Tiles that can generate map tiles for OpenLayers, Google Maps, Google Earth, and similar web maps. GDAL can be installed from OSGeo4W for Windows. We can find OSGeo4W at http://trac.osgeo.org/osgeo4w/. Unfortunately this only works for 32bit Windows as of now I am writing this article.
OSGeo4W is a package from Open Source Geospatial Foundation for Win32 environments. According to the OSGeo website,
OSGeo4W is a binary distribution of a broad set of open source geospatial software for Win32 environments (Windows XP, Vista, etc). OSGeo4W includes GDAL/OGR, GRASS, MapServer, OpenEV, uDig, QGIS as well as many other packages (about 150 as of fall 2009).
OSGeo4W Setup for 32bit Windows
Caution: Do not follow the instructions at http://trac.osgeo.org/osgeo4w/ or http://help.maptiler.org/betatest/ for GDAL2Tiles. Especially there is a specific instruction at http://help.maptiler.org/betatest/ that you should not follow. That instruction only worked for GDAL 1.6 beta. Here is a new instruction for installation of GDAL for using GDAL2Tiles.
- Download the OSGeo4W installer from here.
- Run the installer.
- Select Advanced install.
- Select Libs and select gdal and gdal-python in the Select packages. Caution: do not select any other packages. Some dependent packages will be selected automatically upon your two selections: gdal and gdal-python.
- Finish the installation
- You can see OSGeo4W icon ion your desktop. That is a batch file invoking the command line prompt.
- That’s it.
This only works on Windows 32bit machines. For 64bit Windows machines, we need to follow quite different instructions.
GDAL and GDAL2Tiles Setup for 64bit Windows
OSGeo4W cannot be used for 64bit Windows machines. We have to install GDAL and Python manually.
- Install Python from x86-64 Installer at http://www.python.org/getit/.
- Run python.exe. We have to find out the compiler version that built the python. In my case, the Python version is 2.7.3 and it was compiled and built with MSC v.1500.Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32
- GDAL binary packages for 64bit machines can be found at http://vbkto.dyndns.org/sdk/. Select a corresponding version in the table. In my case, release-1500-x64-gdal-1-9-mapserver-6-0 is the right version in the”MSVC2008 (Win64) -stable” row because the Python was built by 1500.
- Install the GDAL core components. There is no option to choose the destination folder for GDAL core. It will be installed into the “C:Program FilesGDAL” folder.
- Install the GDAL python bindings.
- After the binding, you may move GDAL folder in C:Program Files into wherever you want to.
- Add two batch files; gdal.bat and gdal2tiles.bat into GDAL folder. You can find these two bat files below.
@echo off rem --- @echo Setting environment for using the GDAL Utilities. set GDAL_PATH=<full path of your GDAL installation> @echo GDAL path is %GDAL_PATH%. set PATH=%GDAL_PATH%;%PATH% set GDAL_DATA=%GDAL_PATH%gdal-data set GDAL_DRIVER_PATH=%GDAL_PATH%gdalplugins set PROJ_LIB=%GDAL_PATH%projlib rem --- @echo Setting environment for using the Python. set PYTHON_PATH=<full path of your Python installation> @echo Python path is %PYTHON_PATH%. set PATH=%PYTHON_PATH%;%PATH% @echo on @if [%1]== (cmd.exe /k) else (cmd /c "%*")
python %GDAL_PATH%gdal2tiles.py %*
Now, you are ready to use GDAL2Tiles.
- Just double click gdal.bat.
- Type gdal2tiles with proper options.
You may combine these two into a single command.
- Open a command prompt window.
- Type gdal gdal2tiles with proper options.
Good luck and have fun.
I have been using AT&T U-verse since last year. It has been better than AT&T DSL service which I used prior to U-verse. But sometimes the internet connection was not successful from only my Apple devices. Actually the fact that the problem is only from Apple devices was known to me quite lately. My son is using a Windows laptop. I found out that he never complained about his connection. I am not sure that my wired connection was also problematic since I didn’t check it because most of my networked devices are wireless.
I asked AT&T technical support to help me. They were very kind and eager to solve my problem. After listening to my problem, the technical support changed my modem settings. I believed it helped since I didn’t have the disconnection problem anymore. But another problem, maybe more serious one arose. Network speed got seriously slow down. I called again AT&T technical support. All they said was that my modem and wire were OK. The technical support asked me to cold-reset my modem. So I did. The speed came back to normal. I believed that it helped and solved the problem. But it was not. The network speed got slow down again after a while.
I had decided to solve this problem by myself and checked out some relevant articles from the Internet. Many complaints existed here and there. But there were not many clear answers for the problem. So, my second approach was to check out my son’s Windows laptop which was getting network connection even though all my Apple devices weren’t. I found out the laptop’s wireless setting was using WPA-Personal as the wireless security. So I changed the security setting of my MacBook Pro’s AirPort. It didn’t solve the problem. I googled one more time. And I found an interesting answer for this disconnection problem. The guy said that the modem’s wireless setting should be changed.
I figured out that Apple’s AirPort Security settings have missing compared to Windows wireless settings. Among authentication types of WPA and WPA2, we can choose either TKIP or AES in the Windows settings but not in the AirPort settings. I suspected that Apple devices do not support one of types. The default setting of the U-verse modem is “WPA-PSK (TKIP) and WPA2-PSK (AES).” I selected
“WPA2-PSK (AES)” “WPA-PSK(TKIP)” instead of the default setting and clicked the ‘save’ button. This solved my wireless connection problem of my Apple devices without sacrificing network speed.
Here is a short version of what I did to solve my problem.
- Start a web browser. Go http://192.168.1.254
- Click the “Wireless” icon on the “Home” screen or select the “Settings” tab –> LAN –> Wireless. Either can bring you to the same setting page.
- Scroll down to the Security section.
“WPA2-PSK (AES)”“WPA-PSK(TKIP)” in the Authentication Type.