Tiny API wrapper for educational layer of Warsaw Map Service (https://mapa.um.warszawa.pl)
yarn add @warsawlo/edu-establishments
or
npm i -S @warsawlo/edu-establishments
import Establishments from '@warsawlo/edu-establishments'
const establishments = new Establishments()
establishments.findAll().then(res => {})
establishments.findByDistrict(district).then(res => {})
establishments.findByName(name).then(res => {})
establishments.findByNameAndType(name, type).then(res => {})
establishments.findByStreetAndNumber(street, number).then(res => {})
establishments.responseType = 'stream' // default: json
establishments.useTransformer(transformer)
// transformer is a function invoked under the hood by axios` transformResponse
Before using API resources of The City of Warsaw check this reuse terms (PL only) You can find all (not only educational) API spec here (PL only)
All functions (except setTranformer
) provide data in GeoJSON format
Param | Type | Default value | Description |
---|---|---|---|
reference | string |
pl2000 |
Sets coordinate system. It can be pl2000 or wgs84 . |
Returns Establishments instance.
Get all educational establishments in Warsaw.
Returns promise from the axios call
Find educational establishments by establishment's name.
Param | Type | Description |
---|---|---|
name | String |
Establishment name |
Returns promise from the axios call
Find educational establishments by establishment's name and type.
Param | Type | Description |
---|---|---|
name | String |
Establishment's name |
type | String |
Establishment's type See list of types |
Returns promise from the axios call
Find educational establishments by establishment's name and type.
Param | Type | Description |
---|---|---|
district | String |
District which given establishments is located in (List of districts of Warsaw) |
Returns promise from the axios call
Find educational establishments by establishment's address.
Param | Type | Description |
---|---|---|
street | String |
Street where establishment is located |
number | String |
House number where the school is located |
Returns promise from the axios call
Set axios' transformResponse function
Param | Type | Description |
---|---|---|
transformer | Function |
Street where establishment is located |
const removeTranformer = instance.useTransformer(data => {
return `Data object keys: ${Object.keys(data).join(', ')}`
})
removeTransformer()
Returns a function that removes current transformer
Set response type (arraybuffer
, document
, json
, text
, stream
).
Default: json
Type |
---|
przedszkole |
szkoła podstawowa |
gimnazjum |
liceum |
liceum ogólnokształcące |
liceum dla dorosłych |
technikum |
szkoła branżowa I stopnia |
szkoła policealna |
bursa internat |
młodzieżowy dom kultury |
poradnia psychologiczno-pedagogiczna |
specjalistyczna poradnia psychologiczno-pedagogiczna |