data.gouv.fr中选举数据的多维数据集
cubicweb-elections的Python项目详细描述
摘要
data.gouv.fr中选举数据的多维数据集
安装
创建实例:
cubicweb create elections my_instance_elections
创建数据库:
cubicweb db-create my_instance_elections
不要启动db init
插入Postgis:
psql my_instance_elections -f /usr/share/postgresql/9.1/contrib/postgis-1.5/postgis.sql psql my_instance_elections -f /usr/share/postgresql/9.1/contrib/postgis-1.5/spatial_ref_sys.sql
完成数据库初始化:
cubicweb db-init my_instance_elections
推送OSM数据(有关详细信息,请参阅OSMFrance多维数据集自述):
形状文件取自http://osm13.openstreetmap.fr/~cquest/openfla/export/ (也在https://www.data.gouv.fr/fr/organization/openstreetmap上共享)
启动命令:
cubicweb-ctl osmfrance_import_shp my_instance_elections --regions=/path/to/osm/dataosm/regions-20140306-100m-shp.zip --departements=/path/to/osm/dataosm/departements-20140306-100m-shp.zip --arrondissements=/path/to/osm/dataosm/arrondissements-20131220-100m-shp.zip --epci=/path/to/osm/dataosm/epci-20140306-100m-shp.zip --communes=/path/to/osm/dataosm/communes-20140306-100m-shp.zip
推送选举数据:
cubicweb-ctl elections-import my_instance_elections
重建fti索引:
cubicweb-ctl db-rebuild-fti my_instance_elections