OGR VRT Schema Support

3 messages Options
Embed this post
Permalink
Frank Warmerdam

OGR VRT Schema Support

Reply Threaded More More options
Print post
Permalink
Folks,

I have done a bit of work around OGR recently to make it easier to manage
schemas for layers as VRT files.  For a project I wanted to be able to
have a VRT file which would define a set of layers with geometry types,
coordinate systems, fields and related information that I could use
with ogr2ogr or similar utilities to create all the layers.

To that end I have:

  o Extended the VRT driver to support <Field> definitions giving all
    the details of an attribute field on a layer (type, width, name, precision
    and the source field it comes from in the source layer).

  o Written an ogr2vrt.py script that will create a VRT corresponding to a
    source datasource.  This is the ogr equivelent to what we could do with
    gdal_translate -of VRT in.tif out.vrt but for feature datasources.  The
    script currently lives in gdal/swig/python/samples but I may promote it
    to the scripts directory implying it is supported if it is deemed to be
    useful.

  o Modified the VRT driver so that if the datasource name is @dummy@ it will
    not go looking for an external file - it just creates a dummy memory
    datasource and layer.  This effectively turns the .vrt into a schema
    definition since there will be no effort to go looking for features on
    the layers.  The -schema switch to ogr2vrt.py will create a VRT setup
    this way.

Let me know if there are any questions or interest in this capability.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Alexandre Gacon-3

Re: OGR VRT Schema Support

Reply Threaded More More options
Print post
Permalink
Hi Franck,

Does the field definitions will replace the need to define a csvt file for defining the types of a CSV file read with the VRT format to get geographical coordinates ?

Best regards,

Alexandre Gacon

On Fri, Oct 30, 2009 at 9:18 AM, Frank Warmerdam <[hidden email]> wrote:
Folks,

I have done a bit of work around OGR recently to make it easier to manage
schemas for layers as VRT files.  For a project I wanted to be able to
have a VRT file which would define a set of layers with geometry types,
coordinate systems, fields and related information that I could use
with ogr2ogr or similar utilities to create all the layers.

To that end I have:

 o Extended the VRT driver to support <Field> definitions giving all
  the details of an attribute field on a layer (type, width, name, precision
  and the source field it comes from in the source layer).

 o Written an ogr2vrt.py script that will create a VRT corresponding to a
  source datasource.  This is the ogr equivelent to what we could do with
  gdal_translate -of VRT in.tif out.vrt but for feature datasources.  The
  script currently lives in gdal/swig/python/samples but I may promote it
  to the scripts directory implying it is supported if it is deemed to be
  useful.

 o Modified the VRT driver so that if the datasource name is @dummy@ it will
  not go looking for an external file - it just creates a dummy memory
  datasource and layer.  This effectively turns the .vrt into a schema
  definition since there will be no effort to go looking for features on
  the layers.  The -schema switch to ogr2vrt.py will create a VRT setup
  this way.

Let me know if there are any questions or interest in this capability.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev



--
Alexandre Gacon

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Frank Warmerdam

Re: OGR VRT Schema Support

Reply Threaded More More options
Print post
Permalink
Alexandre Gacon wrote:
> Hi Franck,
>
> Does the field definitions will replace the need to define a csvt file
> for defining the types of a CSV file read with the VRT format to get
> geographical coordinates ?

Alexandre,

If you are using a VRT front end to a csv, then yes, the VRT could be
used to provide detailed field type, and width information instead of
using a .csvt.

Best regards,
--
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, [hidden email]
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev