示例#1
0
文件: gpx.py 项目: esplorio/gpxpy
	def to_xml( self ):
		content = mod_utils.to_xml( 'ele', content = self.elevation )
		if self.time:
			content += mod_utils.to_xml( 'time', content = self.time.strftime( DATE_FORMAT ) )
		content += mod_utils.to_xml( 'cmt', content = self.comment, cdata = True )
		content += mod_utils.to_xml( 'sym', content = self.symbol, cdata = True )
		return mod_utils.to_xml( 'trkpt', { 'lat': self.latitude, 'lon': self.longitude }, content = content )
示例#2
0
文件: gpx.py 项目: esplorio/gpxpy
	def to_xml( self ):
		content = mod_utils.to_xml( 'name', content = self.name, cdata = True )
		content += mod_utils.to_xml( 'desc', content = self.description, cdata = True )
		content += mod_utils.to_xml( 'number', content = self.number )
		for track_segment in self.segments:
			content += track_segment.to_xml()

		return mod_utils.to_xml( 'trk', content = content )
示例#3
0
文件: gpx.py 项目: esplorio/gpxpy
	def to_xml( self ):
		content = mod_utils.to_xml( 'name', content = self.name, cdata = True )
		content += mod_utils.to_xml( 'desc', content = self.description, cdata = True )
		content += mod_utils.to_xml( 'number', content = self.number )
		for route_point in self.points:
			content += route_point.to_xml()

		return mod_utils.to_xml( 'rte', content = content )
示例#4
0
文件: gpx.py 项目: esplorio/gpxpy
	def to_xml( self ):
		content = mod_utils.to_xml( 'ele', content = self.elevation )
		if self.time:
			content += mod_utils.to_xml( 'time', content = self.time.strftime( DATE_FORMAT ) )
		content += mod_utils.to_xml( 'name', content = self.name, cdata = True )
		content += mod_utils.to_xml( 'cmt', content = self.comment, cdata = True )
		content += mod_utils.to_xml( 'desc', content = self.description, cdata = True )
		content += mod_utils.to_xml( 'sym', content = self.symbol, cdata = True )
		content += mod_utils.to_xml( 'type', content = self.type, cdata = True )

		return mod_utils.to_xml( 'rtept', attributes = { 'lat': self.latitude, 'lon': self.longitude }, content = content )
示例#5
0
文件: gpx.py 项目: esplorio/gpxpy
	def to_xml( self ):
		content = mod_utils.to_xml( 'time', content = self.time )
		content += mod_utils.to_xml( 'name', content = self.name, cdata = True )
		content += mod_utils.to_xml( 'desc', content = self.description, cdata = True )
		content += mod_utils.to_xml( 'author', content = self.author, cdata = True )
		content += mod_utils.to_xml( 'email', content = self.email, cdata = True )
		content += mod_utils.to_xml( 'url', content = self.url, cdata = True )
		content += mod_utils.to_xml( 'urlname', content = self.urlname, cdata = True )
		if self.time:
			content += mod_utils.to_xml( 'time', content = self.time.strftime( DATE_FORMAT ) )
		content += mod_utils.to_xml( 'keywords', content = self.keywords, cdata = True )

		for waypoint in self.waypoints:
			content += waypoint.to_xml()

		for track in self.tracks:
			content += track.to_xml()

		for route in self.routes:
			content += route.to_xml()

		return mod_utils.to_xml( 'gpx', attributes = {}, content = content )
示例#6
0
文件: gpx.py 项目: esplorio/gpxpy
	def to_xml( self ):
		content = ''
		for track_point in self.points:
			content += track_point.to_xml()
		return mod_utils.to_xml( 'trkseg', content = content )