[Gdal-dev] Help on writing a new OGR driver

Frank Warmerdam fwarmerdam at gmail.com
Mon May 9 10:59:38 EDT 2005


On 5/9/05, Frédéric Trastour <support at geoimage.fr> wrote:
> I think to choose "List" as the file representing the OGRDataSource, each Layer will appears as an OGRLayer
> ( automatically untiled if necessary ).

Frédéric,

This seems sensible.  I think the untiling is going to be the messiest
part of this.  It is important that the feature id for all features in a
given layer be unique and ideally persistant from invocation to
invocation (though that can be related for specific drivers).  

Are you wanting to take advantage of spatial queries to only 
open required tiles, or is your use not very performance sensitive?

> Is there any tutorial on writing new driver for OGR ?

Unfortunately, there is no tutorial at this time on writing OGR 
drivers. 

> What is the best existing driver to select as a template for this case ?

Good question.   The GML driver is a nice example of a driver 
supporting simple output creation.   The GML driver is also a fairly
straight forward spatial format reader if you only look at the 
"ogrgml*.cpp" files.  The low level GML code is a bit of a nightmare. 

The S57 and NTF drivers are both examples where many files are
treated as seamless layers.   But they are both also complicated for
other reasons and so looking through them may be somewhat 
complicated. 

> Thanks for any hints or comments and excuse me for my poor english...

My suggestion is that you first make a pass implementing the
driver in such a way that each tile is a separate layer.  Once 
you have that working smoothly then rework the driver to handle
the tiling issue.  At least then you can tackle the basic OGR learning
and then return to address the substantial complexities of the tiling.

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



More information about the Gdal-dev mailing list