1.0.1 • Published 3 years ago

paavo v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

paavo

npm version npm downloads

paavo is an npm package for working with the postinumeroalueittainen avoin tieto datasets. Paavo datasets contain by-postcode-area information on population structure, education, income, housing, jobs, the life stage of economies and the main activities of residents in Finland.

Paavo datasets are licensed under CC BY 4.0. For more information visit https://stat.fi/tup/paavo/index.html.

Installation

yarn add paavo

or

npm i paavo

Usage

List datasets

import { Paavo } from 'paavo';

const paavo = new Paavo();

const datasets = await paavo.listDatasets();

console.log(datasets);

/*
Example output:
	[
		'postialue:pno',
		'postialue:pno_meri',
		'postialue:pno_meri_2015',
		'postialue:pno_meri_2016',
		'postialue:pno_meri_2017',
		'postialue:pno_meri_2018',
		'postialue:pno_meri_2019',
		'postialue:pno_meri_2020',
		'postialue:pno_meri_2021',
		'postialue:pno_2015',
		'postialue:pno_2016',
		'postialue:pno_2017',
		'postialue:pno_2018',
		'postialue:pno_2019',
		'postialue:pno_2020',
		'postialue:pno_2021',
		'postialue:pno_tilasto',
		'postialue:pno_tilasto_2015',
		'postialue:pno_tilasto_2016',
		'postialue:pno_tilasto_2017',
		'postialue:pno_tilasto_2018',
		'postialue:pno_tilasto_2019',
		'postialue:pno_tilasto_2020',
		'postialue:pno_tilasto_2021'
	]
*/

Get dataset contents

import { Paavo } from 'paavo';

const paavo = new Paavo();

const pno_2015 = await paavo.getDataset('postialue:pno_2015');

console.log(pno_2015);

/*
Example output:
	[
		{
			type: 'Feature',
			id: 'pno_2015.1',
			geometry: { type: 'MultiPolygon', coordinates: [Array] },
			geometry_name: 'geom',
			properties: {
				posti_alue: '90440',
				nimi: 'Kempele Keskus',
				namn: 'Kempele centrum',
				kunta: '244',
				kuntanro: 244,
				vuosi: 2015,
				pinta_ala: 37279975.91,
				shape_star: 37279975.869,
				shape_stle: 29100.3757892,
				bbox: [Array]
			}
		},
		{
			type: 'Feature',
			id: 'pno_2015.2',
			geometry: { type: 'MultiPolygon', coordinates: [Array] },
			geometry_name: 'geom',
			properties: {
				posti_alue: '90450',
				nimi: 'Honkanen',
				namn: 'Honkanen',
				kunta: '244',
				kuntanro: 244,
				vuosi: 2015,
				pinta_ala: 49818170.52,
				shape_star: 49818170.6776,
				shape_stle: 35115.8537626,
				bbox: [Array]
			}
		},
		...
	]
*/