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 🙂

Advertisements

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 )

Google+ photo

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

Connecting to %s