Coder Social home page Coder Social logo

ubigeos-peru's Introduction

Relación de Ubigeos del Perú

Datos JSON y SQL sobre departamentos, provincias y distritos del Perú.

Directorio

.
├── js
│   └── ubigeo.js
├── json
│   ├── departamentos.json
│   ├── distritos.json
│   └── provincias.json
├── php
│   └── ubigeos.json.php
├── README.md
└── sql
    └── ubigeo.sql

Estructura JSON

Estructura de un registro ubigeo

{
  "id_ubigeo": "3789",
  "nombre_ubigeo": "Trujillo",
  "codigo_ubigeo": "01",
  "etiqueta_ubigeo": "Trujillo, La Libertad",
  "buscador_ubigeo": "trujillo la libertad",
  "numero_hijos_ubigeo": "11",
  "nivel_ubigeo": "2",
  "id_padre_ubigeo": "3788"
}

Uso en Javascript

Se debe realizar las busquedas considerando la propiedad id_ubigeo o id_padre_ubigeo respectivamente.

Archivo: js/ubigeo.js

var ubigeo = window.ubigeo

var departamentos = ubigeo.departamentos
var distritos     = ubigeo.distritos
var provincias    = ubigeo.provincias

// Obteniendo una provincia específica por `id_ubigeo`
var trujillo = provincias[3789]

// {
//  "id_ubigeo": "3789",
//  "nombre_ubigeo": "Trujillo",
//  "codigo_ubigeo": "01",
//  "etiqueta_ubigeo": "Trujillo, La Libertad",
//  "buscador_ubigeo": "trujillo la libertad",
//  "numero_hijos_ubigeo": "11",
//  "nivel_ubigeo": "2",
//  "id_padre_ubigeo": "3788"
//}

Licencia

MIT license

© 2015 José Luis Quintana

ubigeos-peru's People

Contributors

joseluisq 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.