Giter VIP home page Giter VIP logo

learning_shapefiles's Introduction

Copyright (C) 2019 Chris Havlin, https://chrishavlin.com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

DESCRIPTION

This is a collection of scripts for learning to work with shapefiles in python, assuming no previous knowledge (of either shapefiles or the python libraries used in manipulating them).

src/ includes a number of python scripts, tested with python

The documentation for pyshp is very useful: https://pypi.python.org/pypi/pyshp

REQUIREMENTS

  • python (2.xx or 3.xx should work)
  • general libraries: numpy, matplotlib, pandas
  • for reading/writing shapefiles: pyshp or fiona (depending on script)
  • for scripts with polygons: shapely, descartes

colorado_plateau.py uses a shapefile from Fenneman and Johnson (1946): see comments for where to download it.

CONTENTS

scripts in src/ include:

  • basic_read_plot.py: reads a shapefile, plots outlines of geometry
  • basic_readshp_plotpoly.py: reads a shapefile, plots geometry using polygons
  • simple_polygons.py: plots several simple polygons
  • read_shp_and_rcrd.py: reads a shapefile, plots geometry using polygons colored by record values. The record indexing is specific to the census.gov State Boundaries shapefile.
  • colorado_plateau.py: reads the shapefile from Fenneman and Johnson (1946), pulls out Colorado Plateau shapes and generates a single shape for the full physiographic boundary of the Colorado Plateau.
  • affine_expansion.py: reads a CSV of lat/lon coords for a polygon and scales the shape by specified amounts.
  • contourf_to_shp.py: converts contourf levels into polygons, saves to shape file

learning_shapefiles's People

Contributors

chrishavlin avatar

Watchers

James Cloos 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.