Google GTFS简介

为了公共交通信息标准化和便于使用地图显示工具信息,谷歌推出了“谷歌通用数据标准“GTFS,具体规定有很多,简单来讲,使用CSV文本格式,并使用简单的字符。数据标准包括以下文件,见Google Transit(http://code.google.com/transit/s … ransitAgencyExample)

	agency.txt (机构)必须
	stops.txt (站点)必须
	routes.txt (路线)必须
	trips.txt (路趟)必须
	stop_times.txt (停车-时间)必须
	calendar.txt (日历)必须
	calendar_dates.txt (日历-日期)可选
	fare_rules.txt (票价-规定)可选
	fare_attributes.txt (票价-属性)可选
	shapes.txt (形状)可选
	frequencies.txt (频率)可选
	transfers.txt (转车)可选

以下是各个文件的实例:
agency.txt -

	agency_id, agency_name,agency_url,agency_timezone,agency_phone,agency_lang
	FunBus,The Fun Bus,http://www.thefunbus.org,America/Los_Angeles,(310) 555-0222,en

stops.txt -

	stop_id,stop_name,stop_desc,stop_lat,stop_lon,stop_url,location_type,parent_station
	S1,Mission St. & Silver Ave.,The stop is located at the southwest corner of the intersection.,37.728631,-122.431282,,
	S2,Mission St. & Cortland Ave.,The stop is located 20 feet south of Mission St.,37.74103,-122.422482,,
	S3,Mission St. & 24th St.,The stop is located at the southwest corner of the intersection.,37.75223,-122.418581,,
	S4,Mission St. & 21st St.,The stop is located at the northwest corner of the intersection.,37.75713,-122.418982,,
	S5,Mission St. & 18th St.,The stop is located 25 feet west of 18th St.,37.761829,-122.419382,,
	S6,Mission St. & 15th St.,The stop is located 10 feet north of Mission St.,37.766629,-122.419782,,
	S7,24th St. Mission Station,37.752240,-122.418450,,,S8
	S8,24th St. Mission Station,37.752240,-122.418450,http://www.bart.gov/stations/sta ... onoverview_24st.asp,1, routes.txt
	route_id,route_short_name,route_long_name,route_desc,route_type
	A,17,Mission,"The ""A"" route travels from lower Mission to Downtown. The ""A"" route is available for service on weekdays and weekends, but weekend service has limited stops.",3

trips.txt -

	route_id,service_id,trip_id,trip_headsign,block_id
	A,WE,AWE1,Downtown,1
	A,WE,AWE2,Downtown,2

stop_times.txt -

	trip_id,arrival_time,departure_time,stop_id,stop_sequence,pickup_type,dropoff_type
	AWE1,0:06:10,0:06:10,S1,1,0,0,0
	AWE1,,,S2,2,0,1,3
	AWE1,0:06:20,0:06:30,S3,3,0,0,0
	AWE1,,,S5,4,0,0,0
	AWE1,0:06:45,0:06:45,S6,5,0,0,0
	AWD1,0:06:10,0:06:10,S1,1,0,0,0
	AWD1,,,S2,2,0,0,0
	AWD1,0:06:20,0:06:20,S3,3,0,0,0
	AWD1,,,S4,4,0,0,0
	AWD1,,,S5,5,0,0,0
	AWD1,0:06:45,0:06:45,S6,6,0,0,0

calendar.txt -

	service_id,monday,tuesday,wednesday,thursday,friday,saturday,sunday,start_date,end_date
	WE,0,0,0,0,0,1,1,20060701,20060731
	WD,1,1,1,1,1,0,0,20060701,20060731

calendar_dates.txt -

This example shows service exceptions for the Independence Day holiday in 2006. On Monday July 3, 2006, regular weekday service (service_id=WD) is interrupted (exception_type=2). Instead, weekend service (service_id=WE) runs on that date (exception_type=1). The same change applies on Tuesday July 4, as well.

	service_id,date,exception_type
	WD,20060703,2
	WE,20060703,1
	WD,20060704,2
	WE,20060704,1

fare_attributes.txt -

	fare_id,price,currency_type,payment_method,transfers,transfer_duration
	1,0.00,USD,0,0,0
	2,0.50,USD,0,0,0
	3,1.50,USD,0,0,0
	4,2.00,USD,0,0,0
	5,2.50,USD,0,0,0

fare_rules.txt -

	fare_id,route_id,origin_id,destination_id,contains_id
	a,TSW,1,1,
	a,TSE,1,1,
	a,GRT,1,1,
	a,GRJ,1,1,
	a,SVJ,1,1,
	a,JSV,1,1,
	a,GRT,2,4,
	a,GRJ,4,2,
	b,GRT,3,3,
	c,GRT,,,6

shapes.txt -

	shape_id,shape_pt_lat,shape_pt_lon,shape_pt_sequence,shape_dist_traveled
	A_shp,37.61956,-122.48161,1,0
	A_shp,37.64430,-122.41070,2,6.8310
	A_shp,37.65863,-122.30839,3,15.8765

frequencies.txt -

	trip_id,start_time,end_time,headway_secs
	AWE1,05:30:00,06:30:00,300
	AWE1,06:30:00,20:30:00,180
	AWE1,20:30:00,28:00:00,420

transfers.txt -

	from_stop_id,to_stop_id,transfer_type,min_transfer_time
	S6,S7,2,300
	S7,S6,3
	S23,S7,1

按照这些规定整理数据,您的公交系统信息就会在谷歌公交地图工具中显示出来了。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
JSON和GeoJSON都是用于存储地理空间数据的格式。JSON是一种常用的数据交换格式,而GeoJSON则是JSON的一种扩展,专门用于表示地理要素和地理几何体。 JSON(JavaScript Object Notation)是一种轻量级的数据交换格式,易于阅读和编写,并且易于在不同编程语言之间进行解析和生成。它由键值对组成,可以包含对象、数组、字符串、数字等类型的数据。 GeoJSON是JSON的一个子集,用于表示地理要素和地理几何体,例如点、线、面等。GeoJSON规范定义了一组标准的属性和几何体类型,使得地理数据可以以统一的格式进行存储和交换。GeoJSON对象可以包含一个或多个地理要素,每个地理要素都包含属性和几何体。 为了将JSON转换为GeoJSON,可以使用特定的库或函数来实现。例如,可以使用j2gConvert函数将指定的JSON对象转换为具有指定属性的基本GeoJSON对象。这个函数可以用于向GeoJSON对象添加更多属性。 另外,还有一些工具可以将其他格式的地理数据(如GTFS、CSV、KML等)转换为SQLite3(Spatialite)数据库中的GeoJSON。例如,可以使用gtfs-sqlite工具将GTFS文件转换为SQLite3数据库中的GeoJSON格式。 总结起来,JSON是一种通用的数据交换格式,而GeoJSON是JSON的一种扩展,用于表示地理要素和地理几何体。可以使用特定的函数或工具将JSON转换为GeoJSON,也可以将其他地理数据格式转换为SQLite3数据库中的GeoJSON格式。<span class="em">1</span><span class="em">2</span> #### 引用[.reference_title] - *1* [json2geojson:将 JSON 转换为 GeoJSON 的快速函数](https://download.csdn.net/download/weixin_42116604/19323276)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *2* [gtfs-sqlite:GTFS到SQLite3(+ Spatialite)(+ CSV JSON GeoJSON KML)](https://download.csdn.net/download/weixin_42128270/18301190)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

熠熠仔

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值