tsevdos / elUtils

A library of convenient, easy-to-use, and lightweight utility functions that solve common problems encountered while building Greek (and not only) applications.
https://www.npmjs.com/package/@tsevdos/el-utils
MIT License
51 stars 15 forks source link

Add greek cities geo data #45

Closed tsevdos closed 1 week ago

tsevdos commented 7 months ago

We can get data from this site: https://geodata.gov.gr

arisGio commented 7 months ago

Visiting https://geodata.gov.gr/dataset/poleis & choosing GeoJson && WSG format is the most suitable resource for this open issue.

tsevdos commented 1 month ago

Let's add the below helper fns for the cities:

getCities({ locale = "el" }: options) => City[]
searchCityByName({searchTerm: "Αθήνα", locale? = "el"}: options) => City[]
getCityById({ id, locale = "el" }: options) => City
getCityAdministrativeDivision({ id, locale = "el", type: "region" | "unit" | "municipality" | "prefecture" }: options) => Region | Unit | Municipality | Prefecture | null
tsevdos commented 1 week ago

fixed with https://github.com/tsevdos/elUtils/pull/83