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

GRASS GIS trac at osgeo.org
Tue Nov 4 02:05:48 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):

 back to original issue,


 this is a followup to #2638,
  https://trac.osgeo.org/gdal/ticket/2638#comment:1
 cross-filed as GDAL bug # 2653
  https://trac.osgeo.org/gdal/ticket/2653


 data intended for <extensions> is filling standard GPX fields
 instead.


 Exporting a points feature map as GPX:
 (GRASS's North Carolina sample dataset)
 {{{
 # export GRASS points map as GPX format
 GRASS64> v.out.ogr in=hospitals dsn=hsp.gpx format=GPX type=point \
    dsco="GPX_USE_EXTENSIONS=YES"


 GRASS64> v.info -c hospitals
 Displaying column types/names for database connection of layer 1:
 INTEGER|cat
 INTEGER|OBJECTID
 DOUBLE PRECISION|AREA
 DOUBLE PRECISION|PERIMETER
 INTEGER|HLS_
 INTEGER|HLS_ID
 CHARACTER|NAME
 CHARACTER|ADDRESS
 CHARACTER|CITY
 CHARACTER|ZIP
 CHARACTER|COUNTY
 CHARACTER|PHONE
 CHARACTER|CANCER
 INTEGER|POLYGONID
 DOUBLE PRECISION|SCALE
 DOUBLE PRECISION|ANGLE

 # SQL: select * FROM hospitals ...
 GRASS64> v.db.select hospitals | head -n 4
 cat|OBJECTID|AREA|PERIMETER|HLS_|HLS_ID|NAME|ADDRESS|CITY|ZIP|COUNTY|PHONE|CANCER|POLYGONID|SCALE|ANGLE
 1|1|0|0|1|1|Cherry Hospital|400 Stevens Mill
 Rd|Goldsboro|27533|Wayne|(919) 731-3200|yes|0|1|1
 2|2|0|0|2|2|Wayne Memorial Hospital|2700 Wayne Memorial
 Dr|Goldsboro|27534|Wayne|(919) 736-1110|yes|0|1|1
 3|3|0|0|3|3|Watauga Medical Center|336 Deerfield
 Rd|Boone|28607|Watauga|(828) 262-4100|yes|0|1|1


 $ cat hsp.gpx
 <?xml version="1.0"?>
 <gpx version="1.1" creator="GDAL 1.5.0" xmlns:xsi="http://www.w3.org/2001/
 XMLSchema-instance" xmlns:ogr="http://osgeo.org/gdal" xmlns="http:
 //www.topografix.com/GPX/1/1"
 xsi:schemaLocation="http://www.topografix.com/GPX/1/1
 http://www.topografix.com/GPX/1/1/gpx.xsd">
 <wpt lat="182012.655400562332943" lon="697237.563861500239000">
   <ele>1</ele>
   <magvar>0</magvar>
   <geoidheight>0</geoidheight>
   <name>1</name>
   <cmt>1</cmt>
   <desc>Cherry Hospital</desc>
   <src>400 Stevens Mill Rd</src>
   <link href="Goldsboro"><text>27533</text><type>Wayne</type></link>
   <link href="(919) 731-3200"><text>yes</text><type>0</type></link>
   <sym>1</sym>
   <type>1</type>
   <extensions>
   </extensions>
 </wpt>
 <wpt lat="183568.906400562496856" lon="704563.187861500075087">
   <ele>2</ele>
   <magvar>0</magvar>
   <geoidheight>0</geoidheight>
   <name>2</name>
   <cmt>2</cmt>
   <desc>Wayne Memorial Hospital</desc>
   <src>2700 Wayne Memorial Dr</src>
   <link href="Goldsboro"><text>27534</text><type>Wayne</type></link>
   <link href="(919) 736-1110"><text>yes</text><type>0</type></link>
   <sym>1</sym>
   <type>1</type>
   <extensions>
   </extensions>
 </wpt>
 <wpt lat="274897.219400562578812" lon="371094.156861500116065">
   <ele>3</ele>
   <magvar>0</magvar>
   <geoidheight>0</geoidheight>
   <name>3</name>
   <cmt>3</cmt>
   <desc>Watauga Medical Center</desc>
   <src>336 Deerfield Rd</src>
   <link href="Boone"><text>28607</text><type>Watauga</type></link>
   <link href="(828) 262-4100"><text>yes</text><type>0</type></link>
   <sym>1</sym>
   <type>1</type>
   <extensions>
   </extensions>
 </wpt>
 ...
 }}}


 the "cat" field will always be present regardless of if the map has an
 attached attribute DB or not. (i.e. a key INTEGER db field will always be
 present, and by default this is named "cat")

 AFAICT if there is no attribute DB attached to the map the key field (eg
 "cat") should be used for <name> in the GPX file.


 Hamish

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


More information about the grass-dev mailing list