1

I'm trying to create a vrt file with several shapes which I had created previously with gdal_contour (all of them only have 1 feature):

gdalbuildvrt -input_file_list tiles.txt vrtFile.vrt

But I got the next error:

ERROR 1: Unable to find field `location' in DBF file `D:\shapes\shape01.shp'.

After check the shapes in Qgis I discovered all the features only have the field 'ID' (with the value 0). So I tried with the option -tileindex with their IDs:

gdalbuildvrt -tileindex ID -input_file_list tiles.txt vrtFile.vrt

But then I obtained another error:

0...10...20...30...40...50ERROR 4: 0: No such file or directory 
Warning 1: Can't open 0. Skipping it
...60...70...80...90...100 - done.
ERROR 4: 0: No such file or directory
Warning 1: Can't open 0. Skipping it

1 Answer 1

1

Finally I've found an alternative for creating a vrt for these shapes files. Using ogrmerge.py it's feasible create not only a vrt but also a merged shape with all your files.

An example:

ogrmerge.py -f VRT -o merged.vrt *.shp

You can find all the documentation in the gdal wiki: https://gdal.org/programs/ogrmerge.html

Regards

Your Answer

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

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