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

GRASS GIS trac at osgeo.org
Sun Nov 2 05:22:03 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         
 Keywords:  v.out.ogr GPX  |    Platform:  Linux                    
      Cpu:  x86-32         |  
---------------------------+------------------------------------------------
 Hi,

 this is moved from gdal bug # 2638
  http://trac.osgeo.org/gdal/ticket/2638


 GPX format is not reading the DB table correctly, then filling in the
 category number as the elevation.


 It works ok using ogr2ogr:

 {{{
 # Spearfish dataset:

 # export shapefile
 v.out.ogr in=archsites type=point dsn=archsites.shp

 # get PROJ.4 params of current location (Spearfish=UTM 13N)
 IN_PROJ=`g.proj -jf`


 ogr2ogr -f GPX -dsco GPX_USE_EXTENSIONS=YES \
   -a_srs "$IN_PROJ" -t_srs EPSG:4326 \
   output.gpx archsites.shp
 }}}

 result:
 {{{
 <?xml version="1.0"?>
 <gpx version="1.1" creator="GDAL 1.5.0" xmlns:xsi="http://www.w3.org/2001/
 XMLSchema-instan
 ce" xmlns:ogr="http://osgeo.org/gdal"
 xmlns="http://www.topografix.com/GPX/1/1" xsi:schema
 Location="http://www.topografix.com/GPX/1/1
 http://www.topografix.com/GPX/1/1/gpx.xsd">
 <wpt lat="44.381771718385657" lon="-103.826359511024279">
   <extensions>
     <ogr:cat>          1</ogr:cat>
     <ogr:str1>Signature Rock</ogr:str1>
   </extensions>
 </wpt>
 <wpt lat="44.456408157151380" lon="-103.844259647363543">
   <extensions>
     <ogr:cat>          2</ogr:cat>
     <ogr:str1>No Name</ogr:str1>
   </extensions>
 </wpt>
 <wpt lat="44.447669817618234" lon="-103.870697678751810">
   <extensions>
     <ogr:cat>          3</ogr:cat>
     <ogr:str1>Canyon Station</ogr:str1>
   </extensions>
 </wpt>
 ...
 }}}

 slight issue: cat number (column type integers) get padded?

 but using GRASS's 'v.out.ogr format=GPX' (via v.out.gpsbabel script) I
 get:
 {{{
 v.out.gpsbabel -w in=archsites out=archsites.gpx where="cat < 4" --verbose
 Extracting data ...
 Reprojecting data ...
 Exporting data ...
 WARNING: No attribute table found -> using only category numbers as
          attributes
 Cleaning up ...
 Fast exit.
 }}}

 (but there is an attribute table found, otherwise SQL where= query
 would fail in the v.extract step)

 and output:

 {{{
 <?xml version="1.0"?>
 <gpx version="1.1" creator="GDAL 1.5.0" xmlns:xsi="http://www.w3.org/2001/
 XMLSchema-instan
 ce" xmlns:ogr="http://osgeo.org/gdal"
 xmlns="http://www.topografix.com/GPX/1/1" xsi:schema
 Location="http://www.topografix.com/GPX/1/1
 http://www.topografix.com/GPX/1/1/gpx.xsd">
 <wpt lat="44.381755779999999" lon="-103.826838609999996">
   <ele>1</ele>
   <extensions>
   </extensions>
 </wpt>
 <wpt lat="44.456392070000000" lon="-103.844739759999996">
   <ele>2</ele>
   <extensions>
   </extensions>
 </wpt>
 <wpt lat="44.447653719999998" lon="-103.871178959999995">
   <ele>3</ele>
   <extensions>
   </extensions>
 </wpt>
 </gpx>
 }}}


 So it's a v.out.ogr bug I guess. I tried copying the vector into the
 current mapset from PERMANENT, but it didn't help.


 Hamish

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


More information about the grass-dev mailing list