[gdal-dev] OGR XYZ -> GDAL VRT?

Tyler Mitchell tyler.mitchell at actian.com
Wed Dec 19 23:50:28 PST 2012


On 2012-12-19, at 10:54 PM, Even Rouault wrote:
> Le jeudi 20 décembre 2012 02:08:01, vous avez écrit :
>> Hi all, does anyone know a way to put up a GDAL VRT fed by an OGR
>> datasource that has data in XYZ format (regular gridded) .
>> 
>> It doesn't have to ultimately be a VRT, just some similar on-the-fly raster
>> format method, so I can share raster data directly from the OGR
>> datasource.  I've been digging around and saw wkt raster/postgis raster
>> but it's really a little different than this approach as it doesn't use
>> arrays.
>> 
>> I can share more but thought I'd keep it simple first ;-)
> 
> Tyler,
> 
> There's a GDAL XYZ driver, but it has very strict requirements : 
> http://gdal.org/frmt_xyz.html
> 
> Otherwise you can use the OGR CSV driver (make sure the file extension is 
> .csv), wrap it in a OGR VRT, and then ingest that in gdal_grid to produce a 
> raster. But that's not really on-the-fly.

Hi Even,
Thanks for the tips

I'm so close .. thanks to the XYZ driver which I've been using a lot lately, since 
I can input/output CSV and both GDAL and OGR can read it, but yeah, GDAL can't
read it directly from the db source.

My challenge is now to make it pull the CSV from the db in real-time via a VRT.

(Actually I'm sure I can do it with a SQL statement in a VRT, my db is just not 
cooperating at the moment, since it's a non-spatial version of the Ingres db 
and the OGR driver is looking for geometry_columns table and bails out.)

But, yeah it's still not on-the-fly from a GDAL raster perspective.  I assume some
of the other drivers (DODS?) do have a similar mechanism to deal with grids in
databases?

Isn't there some fancy bash scripting that can be done to masquerade an OGR
VRT/script as a virtual file - e.g. it looks like a data file but it's really a realtime script
inside it.  Which leads me to wonder if there are ways to pipe CSV data into gdalinfo/translate?

Hm... thanks again, I'll keep pick away on it when I have time.  A generic gdal-ogr 
CSV bridge driver would be cool!

Some for rambling, it's getting late ;)

Tyler



More information about the gdal-dev mailing list