[gdal-dev] GDALContourGenerate() and kml

Frank Warmerdam warmerdam at pobox.com
Wed Jan 30 12:09:48 EST 2008


winkey wrote:
> It seems there is an issue with contouring directly to kml
> 
> If you set ID and ELEV OGR fields, they end up with field id's of 2 and
> 3, name and description have 0 and 1. gdal_contour as well as my code
> assumes id's of 0 and 1.
> 
> If you contour to another OGR format then translate to kml, ID and ELEV
> are set, name and description are missing.
> 
> if your use id's of 2 and 3 when contouring to kml, ID and ELEV are set,
> but if you contour to a different OGR format then translate to kml then
> no fields are set.

Brian,

I haven't reviewed this really carefully, but I think the problem is that the
gdal_contour program assumes that newly created layers have no fields, and
that the fields it creates will be added with field index 0, 1, 2, etc.  This
is true of most formats, but some formats have predefined attribute fields
when a fresh layer is created.

I would suggest you file a detailed ticket on the problem and gdal_contour
can be made more flexible, and also made to recognise and issue an error
when new fields can't be created.

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    | President OSGeo, http://osgeo.org



More information about the gdal-dev mailing list