Giter Site home page Giter Site logo

gisdata's Introduction

GISData

Geographical data files for Pakistan. This repository contains shapefiles and Topo/Geo-JSON files for Pakistan.

Heirarchy

Each directory has files containing boundaries on 4 levels:

  • adm0 - National
  • adm1 - Provincial
  • adm2 - Division
  • adm3 - District

Each file is labeled accoring to it's level for e.g. PAK-GeoJSON/PAK_adm1.json contains provincial boundaries.

Topologies in TopoJSON files are stored under the object names: adm0, adm1 ...

JSON structure

The D3.js library natively uses GeoJSON to plot maps in browsers. However, Topo-JSON formats can be smaller. The topojson module can be used to convert between formats on the client side.

Geo-JSON

{
    type: FeatureCollection
    // an array of features corresponding to the administrative level
    // for e.g adm0 has a single feature in the array i.e the national boundary
    features: [
        {
            type: Feature,
            // a feature for admX has X+1 features of type NAME_0,...,NAME_X-1
            // corresponding to the geographic division names
            properties: {
                NAME_0: Pakistan,
                NAME_1: Baluchistan,
                NAME_2: Quetta,
                ...
            },
            geometry: {
                type: MultiPolygon,
                coordinates: [...]
            }
        },
        ...
    ]
}

Topo-JSON

{
    type: Topology
    objects: {
        // admX for one of adm0, adm1, adm2, adm3
        admX: {
            type: GeometryCollection,
            // coordinates of bounding box of features
            bbox: [xmin, ymin, xmax, ymax]
            // an array of features corresponding to the administrative level
            // for e.g adm0 has a single feature in the array i.e the national 
            // boundary
            geometries: [
                {
                    type: MultiPolygon,
                    // a feature for admX has X+1 features of type NAME_0,...,
                    // NAME_X-1 corresponding to the geographic division names
                    properties: {
                        NAME_0: Pakistan,
                        NAME_1: Baluchistan,
                        NAME_2: Quetta,
                        ...
                    },
                    arcs: [...]
                },
                ...
            ]
        }
        ...
    },
    // An array of coordinates defining arcs. Each geometry in objects simply
    // references these arcs by index. This ensures that shared boundaries are
    // not repeated twice.
    arcs: [...]
}

Updating

To update this data set, first install the update-data.js script. You will need to have Node.js installed.

> npm install .

After installation you can run the script

> node update-data.js [COUNTRY [TOLERANCE]]

Where COUNTRY is the country code. If no country code provided, assumed to be Pakistan (PAK). See wikipedia for a list of country codes.

Where TOLERANCE is how much to simplify the geometry in degrees. That is, the resolution of gepgraphical features to ignore.

Reducing File Size

GeoJSON files can be simplified by using simplify-geojson (a node package).

TopoJSON files can be simplified by using topojson-simplify (a node package).

More

More information on shape files can be found here.

More information on GeoJSON files can be found here and here.

More information on TopoJSON files can be found here.

These files can be visualized at mapshaper.

Acknowledgements

The data files were obtained from the Global Administrative Boundaries Database.

gisdata's People

Contributors

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