Git Product home page Git Product logo

ubigeo-peru's Introduction

title author date
ubigeo-peru
Jesus M. Castagnetto
20132014

ubigeo-peru: REST service for UBIGEO code search

REST services to query for Peru's UBIGEO (Peru's geographical location code)

Built using PHP closures with the Slim Framework.

Officially, the UBIGEO codes are assigned by INEI, but in practice the codes given by RENIEC are used (the codes do not match). I have matched the codes and normalize the names, so this web app gives both codes whenever possible.

Demo deployed at Pagodabox at the base URL:

http://ubigeo-peru.gopagoda.io/

If you go to the base URL, you will see the documentation of the services.

All the output is in JSON with utf-8 character encoding

Services

  • code:

    • /ubigeo/code/NNNNNN{/source} (N=0..9; source=reniec|inei|any)
    • Searches for the place with ubigeo code NNNNNN, from the source requested. Valid sources: reniec (default), inei, any
  • place:

    • /ubigeo/place/DEPARTMENT{/PROVINCE{/DISTRICT}}
    • Searches for the ubigeo codes (reniec, inei) for the place given as /DEPARTMENT{/PROVINCE{/DISTRICT}} (the last 2 parameters are optional)
  • like:

    • /ubigeo/like/PARTIALNAME
    • Searches for ubigeo codes (reniec, inei) for places that match PARTIALNAME
  • departments:

    • /ubigeo/departments
    • Lists the ubigeo codes for all departments
  • provinces:

    • /ubigeo/provinces/DEPARTMENT
    • Lists the ubigeo codes for all provinces in DEPARTMENT
  • districts:

    • /ubigeo/districts/DEPARTMENT/PROVINCE
    • Lists the ubigeo codes for all districts for a PROVINCE in a DEPARTMENT

Examples of use:

ubigeo-peru: Servicios REST para la búsqueda de UBIGEO

Servicios REST para buscar los códigos de UBIGEO Peruanos.

Construido empleando closures en PHP con Slim Framework.

Oficialmente, los códigos de UBIGEO son asignados por INEI, pero en la práctica todos usan los asignados por RENIEC (las codificaciones son distintas). He emparejado los códigos de ambas fuentes y normalizados los nombres, de manera que este aplicativo web produce ambos códigos cuando esto es posible.

El aplicativo se encuentra funcionando en Pagodabox en la URL de base:

http://ubigeo-peru.gopagoda.io/

Si navegas a la URL base, podrás ver la documentación de los servicios

Todas las salidas estan en JSON con codificación de caracteres utf-8

Servicios

  • código:

    • /ubigeo/codigo/NNNNNN{/fuente} (N=0..9; fuente=reniec|inei|cualquiera)
    • Busca el lugar con código de ubigeo NNNNNN, en la fuente indicada. Fuentes posibles: reniec (usada por defecto), inei, cualquiera
  • lugar:

    • /ubigeo/lugar/DEPARTAMENTO{/PROVINCIA{/DISTRITO}}
    • Busca los códigos de ubigeo (reniec, inei) para el lugar indicado por el /DEPARTAMENTO/PROVINCIA/DISTRITO (los últimos dos parámetros son opcionales)
  • parecido:

    • /ubigeo/parecido/NOMBREPARCIAL
    • Busca los códigos de ubigeo (reniec, inei) para el lugar con un nombre similar a NOMBREPARCIAL
  • departamentos:

    • /ubigeo/departamentos
    • Lista los códigos de ubigeo de todos los departamentos
  • provincias:

    • /ubigeo/provincias/DEPARTAMENTO
    • Lista los códigos de ubigeo de las provincias en DEPARTAMENTO
  • distritos:

    • /ubigeo/distritos/DEPARTAMENTO/PROVINCIA
    • Lista los códigos de ubigeo de los distritos en la PROVINCIA del DEPARTAMENTO

Ejemplos de uso:

License and Copyright

BSD 2-clause license

Copyright (c) 2013, Jesus M. Castagnetto All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

ubigeo-peru's People

Contributors

jmcastagnetto avatar ywarnier avatar

Watchers

James Cloos avatar Jean Lau 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.