Giter VIP home page Giter VIP logo

edomexmap's Introduction

#Zipcode Viewer ##Uses HTML5, javascript and css.

An HTML page to view zipcodes by municipalities in Mexico.

###Libraries used:

  • d3.js - For csv parsing and scales.
  • jQuery - For event handling.
  • topojson - Part of d3, for geographical projections.
  • ogr2ogr - Part of GDAL. For converting shapefiles into json. Usage explained below.

###Fonts used:

###Scripts:

  • Index.html - Main HTML page. Calls the js scripts.
  • altGto.js - Main js script. Parses the csv data and draws the map. Based on the Guanajuato Zip Code viewer.

###Sources:

  • mex_municipal.shp - Shapefile for the desired state with municipalities.
  • munzip.csv - Csv with CVEGEO, name and CP columns.

###Preparing the files

  1. Download the desired shapefile from your website of choice. I downloaded the agebsymas package from Diego Valle's Website.

  2. Identify the shapefile you need. I used gto_municipal.shp.

  3. Convert the shapefile to JSON using ogr2ogr. This was tricky to learn.

    • You have to navigate, using the commandline, to the folder where your .shp is stored. .dbf, .prj and .shx files must be in the same folder as the .shp file.

    • ogr2ogr -f GeoJSON gto.json gto_municipal.shp (where "gto.json" is the output file, and "gto_municipal.shp" is the input file.)

  4. Your file is ready to be used.

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.