Extracting contours

One of my contour datasets has areas that are covered by a 10m contour interval whereas the majority is only covered by a 20m contour interval.

Contours - 10m versus 20m

So if I want to make a consistent 20m DEM I need to remove these pesky 10m contour intervals.

QGIS 1.9 > Select features using an expression

Select using expression

The expression used requires some regex (^[-+]?[0-9]*\\\.?[0-9]+$) to find any contours that have an altitude value that becomes a floating point number when divided by 100 and then halved.

The contours can then be deleted or the expression changed to regexp_match(((“ALTITUDE”/10)/2), ‘^[-+]?[0-9]*\\\.?[0-9]+$’) = 1 to select the desired contours and saved out as a new file.

Sources: http://www.regular-expressions.info/floatingpoint.html, http://gskinner.com/RegExr/

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