[GRASS-dev] Re: [GRASS GIS] #354: v.out.ogr: bad DB read for format=GPX

GRASS GIS trac at osgeo.org
Thu Nov 6 08:16:18 EST 2008


#354: v.out.ogr: bad DB read for format=GPX
---------------------+------------------------------------------------------
  Reporter:  hamish  |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect  |      Status:  new                      
  Priority:  major   |   Milestone:  6.4.0                    
 Component:  Vector  |     Version:  svn-develbranch6         
Resolution:          |    Keywords:  v.out.ogr GPX            
  Platform:  Linux   |         Cpu:  x86-32                   
---------------------+------------------------------------------------------
Comment (by hamish):

 ----
 rouault wrote:

 Hamish,

 I'm pretty sure that it's a GRASS issue and not a OGR one.

 Disclaimer, I've not read GRASS source code, but the only way to explain
 what happens is that GRASS proceeds that way :

    * first, it uses poLayer->CreateField(poField) where poField in your
 example is something like ("cat", String), then ("OBJECTID", String),
 etc... But for the GPX driver, when you add the first use field, namely
 "cat", it's not put at index 0 of the field definition array, but at field
 10 or so, after all the compulsory GPX fields for the <wpt> tag

    * then, GRASS uses poFeature->SetField(0,
 "the_value_of_the_cat_record_on_that_feature"), which is wrong because
 index 0 is in fact the <ele> field. Instead of using index 0, it should
 use poFeature->GetFieldIndex("cat") to retrieve the good index of the cat
 field when it is set in the GPX layer object.

 I hope I'm clear and that will make sense for the GRASS developers.

 ----

-- 
Ticket URL: <https://trac.osgeo.org/grass/ticket/354#comment:6>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list