1.0.2 • Published 7 years ago

fnaim-attractivite-data v1.0.2

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
7 years ago

First install all dependencies

$ npm install

Attractivite

We need to transform csv data in json first :

$ csvtojson --noheader=false --headers=['"type"','"insee"','"nom"','"c1"','"c2"','"c3"','"c4"','"c5"','"c6"','"c7"','"c8"','"c9"','"c10"','"c11"','"c12"','"c0"','"cost"'] --delimiter=\; ./data/attractivite.csv > data/attractivite.json

Geojson

Data comes from data.gouv.fr in a zip file with .shp, .dbf and others files It covers the whole French territories.

Geojson conversion

To convert .shp and .dbf files the better tool I've found is the web tool http://gipong.github.io/shp2geojson.js/

It exports to geojson with properties filled. I didn't find a way with mapshaper to export both .shp and .dbf in a single file. But I've certainly missed an option.

Filtering

I'm only interested in building a map with cities from a few departments so I need a way to filter the data.

$ npm run build

Will create both communes.geojson and departments.geojson.

Every department communes will be merged in a geojson file communes-<dept>.geojson.

1.0.2

7 years ago