Code Monkey home page Code Monkey logo

postcode_si's Introduction

postcode_si

This project provides high performance JavaScript geo-coding library and server for Slovenian postcodes.

using postcode_si from browser

<script type="text/javascript" src="./postcode_si.js"></script>

...
var some_point = [46.11132565729796, 14.508132934570312]

var points_near_location = postcode_si.near(some_point)

console.log(points_near_location[0].town)
// Ljubljana - Šmartno

using postcode_si from Node.js

var postcodes = require("./postcode_si").postcodes

var some_point = [46.11132565729796, 14.508132934570312] 

var points_near_location = postcodes.near(some_point)

console.log(points_near_location[0].town)
// Ljubljana - Šmartno

using REST API

Sample server is running on Heroku. You can try it out using simple curl command...

curl -D - "http://postcode-si.herokuapp.com/near?lat=46.34491313908172&lon=15.057792663574219"

[
  {
    "town": "Šmartno ob Paki",
    "lat": 46.32903719999999,
    "lng": 15.0333937,
    "org": "",
    "postcode": 3327,
    "distance_from_origin": 2573.901643731017
  },
  {
    "town": "Velenje",
    "lat": 46.3443933,
    "lng": 15.0083019,
    "org": "Gorenje",
    "postcode": 3503,
    "distance_from_origin": 3799.3479104102053
  },
  ...

running server

To run the server you have to install all dependent packages (npm install). Since the server is written in CoffeeScript you have to run coffee server.coffee. For developement you can user supervisor and run it with supervisor server.coffee.

Authors

postcode_si's People

Contributors

otobrglez avatar

Stargazers

Angus H. avatar Bostjan avatar Marko Mrdjenovic avatar roks0n avatar primoz klemensek avatar Jan Hočevar avatar Bojan Mihelac avatar Lenart Rudel avatar Marko McLion avatar Miha Rekar avatar  avatar Matej Velikonja avatar Peter A. Pirc avatar

Watchers

Denis Čahuk avatar  avatar Matic Jurglič avatar Blaž Šolar avatar Rok Andrée avatar Peter Pohar avatar Martin Artnik avatar James Cloos avatar  avatar Peter A. Pirc avatar Tilen Travnik avatar Jan Hočevar avatar Rok Pergarec avatar Dal Rupnik avatar  avatar Sano Fužir avatar Jure Suvak avatar Anže Bajde avatar Aljaz Povse avatar Slaven Stančič avatar Matej Ferenc avatar Kristjan Hoareau avatar Nejc Bizjak avatar Matej Skrlep avatar Simon Žlender avatar Miha Lukšič avatar Matej Korbar avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.