Using OGR

One of the reasons I like GRASS GIS is that everything can be done at the command line. Of course there are other ways to do this, and one which I want to explore a bit more is the OGR library. GRASS GIS uses the OGR library under the hood, but using OGR directly offers additional flexibility. For example, using OGR allows you to work directly on shapefiles, without having to import them in the GRASS database first.

A nice example is given in a post by Darren Cope about using OGR for clipping GIS data files. Using the ogr2ogr function, it only takes one line to clip a (potentially very large) vector polygon file with another vector layer.

And what makes this even better, you don’t have to choose between the two tools. Just combine them in your script :-)

About these ads

About pvanb

I am a tropical forest ecologist with a focus on spatial and temporal patterns and processes at population and ecosystem level. I am furthermore very interested in issues related to conservation and sustainable use of biodiversity and natural resources under current and future climates. I have worked in the Middle East (Syria and Lebanon) and South America (Brazil) and in Eastern Africa (Kenya).
This entry was posted in GIS, GIS software and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s