GeoSearch CLI for Deno
Simple Deno CLI library to find places all around the world
Datasource: Mapy.cz Suggest API
Install
Not needed. It’s Deno :)
Usage
Help
deno run https://raw.githubusercontent.com/bartholomej/geosearch-deno/master/mod.ts
Parameters:
--help
City, town, village
Let’s find all Springfields in the World
deno run --allow-net https://raw.githubusercontent.com/bartholomej/geosearch-deno/master/mod.ts --phrase Springfield --scope muni
Parameters:
--phrase Springfield --scope muni
Places start with
Let’s find cities or villages start with Ber in Germany
deno run --allow-net https://raw.githubusercontent.com/bartholomej/geosearch-deno/master/mod.ts --phrase Ber --scope muni --country de
Parameters:
--phrase Ber --scope muni --country de
Public transport
Let’s find position of public transport station in the Czech Republic
deno run --allow-net https://raw.githubusercontent.com/bartholomej/geosearch-deno/master/mod.ts --phrase kokořín --scope pubt --country cz
Parameters:
--phrase kokořín --scope pubt --country cz
More!
Let’s try to find rivers, lakes, mountains, streets, national parks, areas, tourist attractions, …, everything what awesome Mapy.cz Suggest API can do.
Results (example)
[
{
category: 'municipality_cz',
highlight: [],
sentence: '',
userData: {
bbox: [Array],
country: 'Česko',
district: 'Hlavní město Praha',
elasticWeight: 0,
evidenceNumber: '',
hasAddress: true,
highlight: [Array],
highlightSecond: [Array],
houseNumber: '',
iconType: 'geo',
id: 3468,
img: '',
importance: 0.763394835100681,
latitude: 50.0835493857,
longitude: 14.4341412988,
mmid: '',
mmsource: '',
mmtype: '',
muniId: '3468',
municipality: 'Praha',
nuts: 'CZ0100',
poiType: '',
poiTypeId: 0,
popularity: 1,
premiseIds: [],
quarter: '',
region: 'Hlavní město Praha',
source: 'muni',
street: '',
streetNumber: '',
suggestFirstRow: 'Praha',
suggestSecondRow: 'okres Hlavní město Praha, kraj Hlavní město Praha, Česko',
suggestThirdRow: 'Hlavní město',
ward: '',
wikiId: 'Q1085',
zipCode: '',
},
},
];
Options
Option | Type | Default | Description |
---|---|---|---|
scope | 'muni' | 'area' | 'pubt' | 'street' |
null | Preferred category of results |
country | 'cz' | 'sk' | 'us' | 'de' |
null | Preferred country (same as bounds but with some presets) |
License
Data source
Awesome Mapy.cz Suggest API from Seznam.cz
Please read this license before use.
This library
Code of this library is licensed under the [MIT license].
Copyright © 2020 Lukas Bartak
Proudly powered by nature 🗻, wind 💨, tea 🍵 and beer 🍺 ;)
Donation
If this project have helped you save time please consider making a donation for some 🍺 or 🍵 ;)