-4

How can I use ogrinfo?
where should I write it?
In the visual studio's command prompt or somewhere else?
Can you make some examples?


when I use ogrinfo in the windows or visual studio's command prompt, I get the result:

enter image description here
This is the same result that I get, when I use gdal_translate.

4

ogrinfo as nothing to do with Visual Studio. It is a command line tool (Windows, Linux, Mac OS X)

So you use it in the Windows console or in the Linux and Mac OS X shell in the same way.

ogrinfo yourshape.shp

with a lot of options: (ogrinfo)

And, there are many, many tutorials in Gis.StackExchange : search ogrinfo and on the Web....

  • ok thanks @gene but the reason that I asked the question is the problem I have explained now in my question. In fact, I have read some of those tutorials but each time, I get the same error. And as I have said in my question, afew days ago I couldn't use gdal_translate,too. If you're desired to help me please see my editing the question. thanks alot. – Sepideh Abadpour Sep 13 '13 at 14:13
  • I do not use Windows but I suspect that you have a problem with the GDAL/OGR installation and the paths of the tools – gene Sep 13 '13 at 14:43
2

On windows, you must specify the full path to the ogrinfo executable. On my windows 7 machine it is: C:\Python33\Lib\site-packages\osgeo\ogrinfo

0

You need to set up your environmental variables for it to be recognised as a command by the command prompt.

See: http://gisforthought.com/setting-up-your-gdal-and-ogr-environmental-variables/

Alternatively supply the full path to your GDAL/ogr install. Like:

C:\OSGeo4W64\bin\ogrinfo.exe myshapefile.shp

Or run the command from the same folder as your ogr/GDAL install.

cd "C:\OSGeo4W64\bin\"
ogrinfo "C:\mydata\myshapefile.shp"

I would recommend reading up a bit on the windows command prompt in general. These are not really GIS issues.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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