5

I've got a folder full of dxf files with elevation values included as part of a long text attribute. I've written a regex expression to extract the elevation value, and would like to add it as a new attribute to an output Mapinfo file.

I'd prefer to complete this using command line and ogr if possible, as it's already doing most of the work to convert the files. Python alternatively. QGIS as a last resort.

Could this be completed using a SQL query in the ogr2ogr command?

Antonio Falciano
14.5k2 gold badges39 silver badges68 bronze badges
asked Nov 19, 2013 at 3:54

1 Answer 1

4

AFAIK OGR SQL doesn't support regular expressions natively, but...

By default, the REGEXP operator has no implementation in SQLite. With OGR>= 1.10 built against the PCRE library, the REGEXP operator is available in SQL statements run by OGR.

Source: http://www.gdal.org/ogr/drv_sqlite.html

However, see also:

Alternatively, you can use the LIKE operator and the SUBSTR function in your OGR SQL statements.

answered Nov 19, 2013 at 9:03

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.