1.0.5 • Published 4 years ago

swedish-history v1.0.5

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

Swedish history data

install

npm install swedish-history

usage

import {
  battles,
  conflicts,
  geometries,
  persons,
  places,
} from 'swedish-history'

persons.regents

An array of JSON objects

interface PersonRegent {
  name: string
  wikipedia: Wikipedia
  reignStart: DateObject
  reignEnd: DateObject
  dateOfBirth?: DateObject
  dateOfDeath?: DateObject
  kin?: WikipediaWithText
  spouses: WikipediaWithText[]
  children: WikipediaWithText[]
  father?: WikipediaWithText
  mother?: WikipediaWithText
}

source wikipedia

places.balticCities

A GeoJSON FeatureCollection

interface PlacesBalticCitiesProperties {
  name: string
  alternativeNames?: {
    fromYear: number
    toYear: number | null
    value: string
  }[]
  partOf: {
    fromYear: number
    toYear: number | null
    de: string
    en: string
    sv: string
  }[]
}

type PlacesBalticCitiesFeature = Feature<PlacesBalticCitiesProperties, PointGeometry>

source baltictowns.com

places.goldCoast

A GeoJSON FeatureCollection

interface PlacesGoldCoastProperties {
  name: string
  swe_from_year: number
  swe_to_year: number
}

type PlacesGoldCoastFeature = Feature<PlacesGoldCoastProperties, PointGeometry>

source wikipedia

places.newSweden

A GeoJSON FeatureCollection

interface PlacesNewSwedenProperties {
  name: string
  swe_from_year: number
  swe_to_year: number
}

type PlacesNewSwedenFeature = Feature<PlacesNewSwedenProperties, PointGeometry>

source wikipedia

places.gardaRike

A GeoJSON FeatureCollection

interface PlacesGardarikeProperties {
  name: string
  wikipedia: Wikipedia
}

type PlacesGardarikeFeature = Feature<PlacesGardarikeProperties, PointGeometry>

source wikipedia

battles

An array of JSON objects

interface Battle {
  text: string
  wikipedia?: Wikipedia
  partOf: Wikipedia
  place: WikipediaWithText
  date: DateObject
  side1: {
    forces?: string
    losses?: string
    parts: WikipediaWithText[]
  }
  side2: {
    forces?: string
    losses?: string
    parts: WikipediaWithText[]
  }
  result: 0 | 1 | 2
  coordinates: [number, number]
}

source wikipedia

conflicts

An array of JSON objects

interface Conflict {
  text: string
  wikipedia: Wikipedia
  start: DateObject
  end: DateObject
  treaties?: ConflictTreaty[]
  parts: WikipediaWithText[][]
  casusBelli?: string
}

source wikipedia

geometries.regions

A GeoJSON FeatureCollection

interface GeometryRegionProperties {
  name: string
  swe_from_year?: number
  swe_from_wikipedia?: Wikipedia
  swe_to_year?: number
  swe_to_wikipedia?: Wikipedia
}

type GeometryRegionFeature = Feature<GeometryRegionProperties, PolygonGeometry|MultiPolygonGeometry>

Regions are provided without coastline (some sea around coastal regions is included), use whatever coastline fits your project such as OSM coastlines and Natural earth land.

sources wikipedia and OSM

geometries.regionsTopology

Same as the above as a topojson topology.

Objects are:

[
  'lost_1660', 'lost_1719', 'lost_1720',
  'lost_1721', 'lost_1803', 'lost_1809',
  'lost_1815', 'new_1561',  'new_1617',
  'new_1629',  'new_1644',  'new_1645',
  'new_1648',  'new_1654',  'new_1658',
  'swe_1560',  'swe_1561',  'swe_1617',
  'swe_1629',  'swe_1644',  'swe_1645',
  'swe_1648',  'swe_1654',  'swe_1658',
  'swe_1660',  'swe_1719',  'swe_1720',
  'swe_1721',  'swe_1803',  'swe_1809',
  'swe_1815',  'swe_1816'
]

getometries.getRegionsInYear

A function that takes a year and returns a FeatureCollection of regions. Years before 1560 return null.