Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I found some batch code using ogr2ogr in order to convert and reproject vector layers. The difficulty for me is to know what to install and which gdal commandline should I use, and how to configure it...

The fact is I'm quite lost with all the packages that gdal offers and I don't know :

  1. which package am I supposed to install : OSGeo4W, FWTools, MS4W,...?? What is the difference between them ? Can I use any of them ?

  2. What is the procedure to set PATH and environment variables ? I work with windows 7.

  3. I have already QGIS and GRASS installed on my computer. Is an installation of gdal could damage anything ?

share|improve this question
add comment

2 Answers 2

If you have QGIS already installed, then you should also have GDAL and FWTools installed. I hesitate to give you the path because I expect it depends on how you installed QGIS (though the osgeo4w installer is the most common route, which would create an OSGeo4W directory on your C drive).

Although, in theory, installing a separate version of GDAL shouldn't break QGIS - in practice in some circumstances it can. I like to have a standalone version but a little care is needed because you can break QGIS if your standalone version of GDAL is based on a different version of Python to QGIS. QGIS uses Python 2.7 and I need 3.2 or above. It caused me some problems and necessitates me hacking QGIS a little to force it to look in the right place. So, if you want to go down the standalone route, I recommend you install a 32 bit version of GDAL for Python 2.7. You can get up to date binaries for all sorts of combinations of Python, Windows, GDAL and MSVC versions from the excellent GISInternals website.

Since FWTools merely provides a convenience wrapper for GDAL/OGR, if you already have QGIS I wouldn't bother installing a standalone version of it because QGIS gives you even more convenience than using a commandline. Likewise, unless you want to write and run your own geoprocessing scripts, there is not much point in installing GDAL separately. Given your question, I assume this is what you want to do.

To run any of the GDAL Utilities and OGR Utilities you don't need a special command line interface. Just use the Windows commandline (cmd.exe) and navigate or reference the path to where your utilities are as they won't be registered (in my case with an OSGeo4W installation the location is C:\OSGeo4W\bin). Again - you don't need any additional installation to what OSGeo4W can do.

Have a look at this thread for more information on actual installation proceedure if you want to go ahead with a separate install. Following the tutorials mentioned there should tell you how to set the environment variables. However, I don't think you need to do anything apart from locate your ogr2ogr utility.

share|improve this answer
    
Thanks a lot MappaGnosis for that very precise answer. I'm know sure that I will only use the windows commandline and locate the appropriate utility ;). –  Samy-DT May 27 '13 at 5:01
add comment

I prefer the zipped GDAL version of gisinternals. This can be extracted anywhere on your file system. Starting the SDKshell.bat sets the necessary path variables, and after exiting (or outside the command window) everything is back to normal.

FWTools have a standalone installer, but that is not in sync with the current GDAL anymore.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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