Skip to content

Detect official divisional administrative regions of Portugal, providing coordinates

Notifications You must be signed in to change notification settings

Exoid/geo-pt-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

geo-pt-api

Detect official divisional administrative regions of Portugal ("Carta Administrativa Oficial de Portugal - CAOP 2020", from here), providing GPS coordinates as input. You can use the public API here.

It creates a HTTP server, whose GET request /?lat=40.153687&lon=-8.514602 returns a JSON

{
  "freguesia": "Anobra",
  "concelho": "Condeixa-A-Nova",
  "distrito":"Coimbra"
}

How to install the API on your machine

  1. Install nodeJS, npm and git
  2. Clone the project:
    git clone https://github.com/jfoclpf/geo-pt-api.git
  3. Enter the newly created directory and install dependencies
    cd geo-pt-api && npm install
  4. Start the server
    npm start --port=8080

Continuous operation

For permanent and continuous operation use for example pm2 or forever, using directly the node script located at the root directory

node server.js --port=8080.

With pm2

npm install pm2@latest -g
pm2 start server.js -- --port 8080

Debug

DEBUG=http npm start --port=8080

About

Detect official divisional administrative regions of Portugal, providing coordinates

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published