Skip to content

WikiPois is a server to provide Wikipedia POIs on the map.

Notifications You must be signed in to change notification settings

FreemapSlovakia/WikiPois

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WikiPois

WikiPois is a server to provide Wikipedia POIs on the map.

API

HTTP Request:

GET /?bbox=<minX>,<minY>,<maxX>,<maxY>&scale=<scale>

Parameter scale is roughly computed as area of bounding box divided by number of pixels (const scale = turf.area(turf.bboxPolygon(bbox)) / (window.innerHeight * window.innerWidth);).

HTTP Response:

[
  [wikipedia, wikidata, lng, lat, id, name],
  ...
]

Database preparation

Create database:

sudo su - postgres
createuser wiki
createdb -E UTF8 -O wiki wiki
psql -d wiki -c "CREATE EXTENSION postgis;"
exit

Import OSM data (you can also use eg. extracts from Geofabrik):

PGPASSWORD=wiki osm2pgsql -d wiki -U wiki -H localhost -c -s --flat-nodes flat_nodes --cache 0 -O flex -S wiki.lua planet.osm.pbf

Preparation for updates:

PGPASSWORD=wiki osm2pgsql-replication init -d wiki -U wiki -H localhost --osm-file planet.osm.pbf

Running server:

deno run --allow-net --allow-env server.ts

Updating database

Run daily for Geofabrik extracts.

1 4 * * * /path/to/update.sh

About

WikiPois is a server to provide Wikipedia POIs on the map.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published