No description
Find a file
Bertold Van den Bergh db647386d9 Update database URL
2019-11-10 01:31:16 +01:00
aws_lambda Precompiled library for AWS Lambda environment 2018-08-02 09:50:45 +02:00
database Update database URL 2019-11-10 01:31:16 +01:00
library Add simple string lookup function 2019-09-27 18:32:28 +02:00
node_js Add license 2018-07-25 18:41:20 +02:00
vs15 added support for MSVC toolchain (VS 15.x) 2019-04-04 11:40:36 +02:00
demo.c Add simple string lookup function 2019-09-27 18:32:28 +02:00
README.md Mistake fixed in README 2019-02-22 00:00:41 +01:00

ZoneDetect

This is a C library that allows you to find an area a point belongs to using a database file. A typical example would be looking up the country or timezone given a latitude and longitude. The timezone database also contains the country information.

The API should be self-explanatory from zonedetect.h. A small demo is included (demo.c)

The databases are obtained from here and converted to the format used by this library.

Online API

You can test the library using an online API: https://api.bertold.org/geozone It takes the following GET parameters:

  • lat: Latitude.
  • lon: Longitude.
  • c: Set to one (c=1) to produce compact JSON.

For example: https://api.bertold.org/geozone?lat=51&lon=5
You are free to use this API for any application, but I am not responsible for the quality of service. Please contact me if your application requires reliability.

Demo

An online demo is available here: https://api-public.bertold.org/demo/geozone.html. Simple click anywhere on the map and see the result of the query.