I have many CSV file in the form of lon, lat, Z that in would like to import into gdal for further processing. I need to do this on the fly in a python script so any step involving gdal_grid or anything else from the command line is not an option.
It seemed that creating a vrt xml would solve the problem but I am unable to get gdal to load the data.
Loading data this way seems to be such a common task I can't believe there is not a way to do this.
Best Answer
Step 1: Create CSV file "xyztest.csv"
Step 2: Write a VRT file "xyz.vrt" that maps the previous file
Step 3: Test with ogrinfo
All done. It may still be necessary to explicitly define that the input vrt is 3D. For example ogr2ogr conversion into shapefile creates a "POINT" type shapefile unless "-SHPT POINTZ" is used as a parameter.