Python Geospatial Development - Second Edition


Python Geospatial Development - Second Edition
eBook: $29.00
Formats: PDF, PacktLib, ePub and Mobi formats
$24.65
save 15%!
Print + free eBook + free PacktLib access to the book: $78.99    Print cover: $49.99
$74.64
save 6%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Reviews
Support
Sample Chapters
  • Build your own complete and sophisticated mapping applications in Python.
  • Walks you through the process of building your own online system for viewing and editing geospatial data
  • Practical, hands-on tutorial that teaches you all about geospatial development in Python

Book Details

Language : English
Paperback : 508 pages [ 235mm x 191mm ]
Release Date : May 2013
ISBN : 178216152X
ISBN 13 : 9781782161523
Author(s) : Erik Westra
Topics and Technologies : All Books, Application Development, Open Source, Python

Table of Contents

Preface
Chapter 1: Geospatial Development Using Python
Chapter 2: GIS
Chapter 3: Python Libraries for Geospatial Development
Chapter 4: Sources of Geospatial Data
Chapter 5: Working with Geospatial Data in Python
Chapter 6: GIS in the Database
Chapter 7: Working with Spatial Data
Chapter 8: Using Python and Mapnik to Generate Maps
Chapter 9: Putting It All Together – a Complete Mapping System
Chapter 10: ShapeEditor – Implementing List View, Import, and Export
Chapter 11: ShapeEditor – Selecting and Editing Features
Index
    • Chapter 2: GIS
      • Core GIS concepts
        • Location
        • Distance
        • Units
        • Projections
          • Cylindrical projections
          • Conic projections
          • Azimuthal projections
          • The nature of map projections
        • Coordinate systems
        • Datums
        • Shapes
      • GIS data formats
      • Working with GIS data manually
      • Summary
      • Chapter 3: Python Libraries for Geospatial Development
        • Reading and writing geospatial data
          • GDAL/OGR
            • GDAL design
            • GDAL example code
            • OGR design
            • OGR example code
          • Documentation
          • Availability
        • Dealing with projections
          • pyproj
          • Design
            • Proj
            • Geod
          • Example code
          • Documentation
          • Availability
        • Analyzing and manipulating geospatial data
          • Shapely
          • Design
          • Example code
          • Documentation
          • Availability
        • Visualizing geospatial data
          • Mapnik
          • Design
          • Example code
          • Documentation
          • Availability
        • Summary
        • Chapter 4: Sources of Geospatial Data
          • Sources of geospatial data in vector format
            • OpenStreetMap
              • Data format
              • Obtaining and using OpenStreetMap data
            • TIGER
              • Data format
              • Obtaining and using TIGER data
            • Natural Earth
              • Data format
              • Obtaining and using Natural Earth vector data
            • Global, self-consistent, hierarchical, high-resolution shoreline database (GSHHS)
              • Data format
              • Obtaining the GSHHS database
            • World Borders Dataset
              • Data format
              • Obtaining World Borders Dataset
          • Sources of geospatial data in raster format
            • Landsat
              • Data format
              • Obtaining Landsat imagery
            • Natural Earth
              • Data format
              • Obtaining and using Natural Earth raster data
            • Global Land One-kilometer Base Elevation (GLOBE)
              • Data format
              • Obtaining and using GLOBE data
            • National Elevation Dataset (NED)
              • Data format
              • Obtaining and using NED data
          • Sources of other types of geospatial data
            • GEOnet Names Server
              • Data format
              • Obtaining and using GEOnet Names Server data
            • Geographic Names Information System (GNIS)
              • Data format
              • Obtaining and using GNIS Data
          • Choosing your geospatial data source
          • Summary
          • Chapter 5: Working with Geospatial Data in Python
            • Pre-requisites
            • Reading and writing geospatial data
              • Task – calculate the bounding box for each country in the world
              • Task – save the country bounding boxes into a shapefile
              • Task – analyze height data using a digital elevation map
            • Changing datums and projections
              • Task – change projections to combine shapefiles using geographic and UTM coordinates
              • Task – change datums to allow older and newer TIGER data to be combined
            • Representing and storing geospatial data
              • Task – define the border between Thailand and Myanmar
              • Task – save geometries into a text file
            • Performing geospatial calculations
              • Task – identify parks in or near urban areas
            • Converting and standardizing units of geometry and distance
              • Task – calculate the length of the Thai-Myanmar border
              • Task – find a point 132.7 kilometers west of Soshone, California
            • Exercises
            • Summary
            • Chapter 6: GIS in the Database
              • Spatially-enabled databases
              • Spatial indexes
              • Open source spatially-enabled databases
                • MySQL
                • PostGIS
                  • Installing and configuring PostGIS
                  • Using PostGIS
                  • Documentation
                  • Advanced PostGIS Features
                • SpatiaLite
                  • Installing SpatiaLite
                  • Installing pysqlite
                  • Accessing SpatiaLite from Python
                  • Documentation
                  • Using SpatiaLite
                  • SpatiaLite capabilities
              • Commercial Spatially-enabled database
                • Oracle
                • MS SQL Server
              • Recommended best practices
                • Using the database to keep track of spatial references
                • Using the appropriate spatial reference for your data
                  • Option 1 – using a database that supports geographies
                  • Option 2 – transform features as required
                  • Option 3 – transform features from the outset
                  • When to use unprojected coordinates
                • Avoiding on-the-fly transformations within a query
                • Don't create geometries within a query
                  • Using spatial indexes appropriately
                • Knowing the limits of your database's query optimizer
                  • MySQL
                  • PostGIS
                  • SpatiaLite
              • Working with geospatial databases using Python
                • Prerequisites
                • Working with MySQL
                • Working with PostGIS
                • Working with SpatiaLite
                • Comparing the databases
              • Summary
              • Chapter 7: Working with Spatial Data
                • About DISTAL
                • Designing and building the database
                • Downloading the data
                  • World Borders Dataset
                  • GSHHS
                  • GNIS
                  • GEOnet Names Server
                • Importing the data
                  • World Borders Dataset
                  • GSHHS
                  • US place name data
                  • Worldwide places' name data
                • Implementing the DISTAL application
                  • The shared "database" module
                  • The "select country" script
                  • The "select area" script
                    • Calculating the bounding box
                    • Calculating the map's dimensions
                    • Setting up the data source
                    • Rendering the map image
                  • The "show results" script
                    • Identifying the clicked-on point
                    • Identifying features by distance
                    • Displaying the results
                • Application review and improvements
                  • Usability
                  • Quality
                    • Place name issues
                    • Lat/Long coordinate problems
                  • Performance
                    • Finding the problem
                    • Improving performance
                    • Calculating the tiled shorelines
                    • Using tiled shorelines
                    • Analyzing performance improvement
                • Summary
                • Chapter 8: Using Python and Mapnik to Generate Maps
                  • Introducing Mapnik
                  • Creating an example map
                  • Mapnik in depth
                    • Data sources
                      • Shapefile
                      • PostGIS
                      • Gdal
                      • Ogr
                      • SQLite
                      • OSM
                      • MemoryDatasource
                    • Rules, filters, and styles
                      • Filters
                      • Scale denominators
                      • "Else" rules
                      • "Also" rules
                    • Symbolizers
                      • Drawing lines
                      • Drawing polygons
                      • Drawing labels
                      • Drawing points
                      • Drawing raster images
                      • Using colors
                    • Maps and layers
                      • Map attributes and methods
                      • Layer attributes and methods
                    • Map rendering
                  • MapGenerator revisited
                    • The MapGenerator interface
                    • Creating the main map layer
                    • Displaying points on the map
                    • Rendering the map
                    • What the map generator teaches us
                  • Map definition files
                  • Summary
                  • Chapter 9: Putting It All Together – a Complete Mapping System
                    • About ShapeEditor
                    • Designing ShapeEditor
                      • Importing a shapefile
                      • Selecting a feature
                      • Editing a feature
                      • Exporting a shapefile
                    • Prerequisites
                    • The structure of a Django application
                      • Models
                      • Views
                      • URL dispatching
                      • Templates
                    • Setting up the database
                    • Setting up the ShapeEditor project
                    • Defining ShapeEditor's applications
                    • Creating a shared application
                    • Defining data models
                      • Shapefile
                      • Attribute
                      • Feature
                      • AttributeValue
                      • The models.py file
                    • Playing with the admin system
                    • Summary
                    • Chapter 10: ShapeEditor – Implementing List View, Import, and Export
                      • Implementing the "list shapefiles" view
                      • Importing shapefiles
                        • The "import shapefile" view function
                        • Extracting the uploaded shapefile
                        • Importing the shapefile's contents
                          • Open the shapefile
                          • Add the Shapefile object to the database
                          • Define the shapefile's attributes
                          • Store the shapefile's features
                          • Store the shapefile's attributes
                        • Cleaning up
                      • Exporting shapefiles
                        • Defining the OGR shapefile
                        • Saving the features into the shapefile
                        • Saving the attributes into the shapefile
                        • Compressing the shapefile
                        • Deleting temporary files
                        • Returning the ZIP archive to the user
                      • Summary
                      • Chapter 11: ShapeEditor – Selecting and Editing Features
                        • Selecting a feature to edit
                          • Implementing Tile Map Server
                            • Setting up the base map
                            • Tile rendering
                          • Using OpenLayers to display the map
                          • Intercepting mouse clicks
                          • Implementing the find feature view
                        • Editing features
                        • Adding features
                        • Deleting features
                        • Deleting shapefiles
                        • Using ShapeEditor
                        • Further improvements and enhancements
                        • Summary

                        Erik Westra

                        Erik Westra has been a professional software developer for over 25 years, and has worked almost exclusively in Python for the past decade. Erik's early interest in graphical user-interface design led to the development of one of the most advanced urgent courier dispatch systems used by messenger and courier companies worldwide. In recent years, Erik has been involved in the design and implementation of systems matching seekers and providers of goods and services across a range of geographical areas. This work has included the creation of real-time geocoders and map-based views of constantly changing data. Erik is based in New Zealand, and works for companies worldwide

                        Code Downloads

                        Download the code and support files for this book.


                        Submit Errata

                        Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


                        Errata

                        - 1 submitted: last submission 19 May 2014

                        Errata type: Code | Page number: 375

                        The command line instruction in the section named "Creating the shared application" should read:

                        python manage.py startapp shared

                        rather than:

                        python manage.py startapp shapeEditor

                        Sample chapters

                        You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

                        Frequently bought together

                        Python Geospatial Development - Second Edition +    Haskell Data Analysis Cookbook =
                        50% Off
                        the second eBook
                        Price for both: $42.55

                        Buy both these recommended eBooks together and get 50% off the cheapest eBook.

                        What you will learn from this book

                        • Access, manipulate and display geospatial data from within your Python programs
                        • Master the core geospatial concepts of location, distance, units, projections and datums
                        • Read and write geospatial data in both vector and raster format
                        • Perform complex, real-world geospatial calculations using Python
                        • Store and access geospatial information in a database
                        • Use points, lines and polygons within your Python programs
                        • Use Python-based tools for converting geospatial data into good looking maps
                        • Build complete web-based mapping applications using Python

                        In Detail

                        Geospatial development links your data to places on the Earth’s surface. Writing geospatial programs involves tasks such as grouping data by location, storing and analyzing large amounts of spatial information, performing complex geospatial calculations, and drawing colorful interactive maps. In order to do this well, you’ll need appropriate tools and techniques, as well as a thorough understanding of geospatial concepts such as map projections, datums and coordinate systems.

                        Python Geospatial Development - Second Edition teaches you everything you need to know about writing geospatial applications using Python. No prior knowledge of geospatial concepts, tools or techniques is required. The book guides you through the process of installing and using various toolkits, obtaining geospatial data for use in your programs, and building complete and sophisticated geospatial applications in Python.

                        Python Geospatial Development teaches you everything you need to know about writing geospatial applications using Python. No prior knowledge of geospatial concepts, tools or techniques is required. The book guides you through the process of installing and using various toolkits, obtaining geospatial data for use in your programs, and building complete and sophisticated geospatial applications in Python.

                        This book provides an overview of the major geospatial concepts, data sources and toolkits. It teaches you how to store and access spatial data using Python, how to perform a range of spatial calculations, and how to store spatial data in a database. Because maps are such an important aspect of geospatial programming, the book teaches you how to build your own “slippy map” interface within a web application, and finishes with the detailed construction of a geospatial data editor using Geodjango.

                        Whether you want to write quick utilities to solve spatial problems, or develop sophisticated web applications based around maps and geospatial data, this book includes everything you need to know.

                        Approach

                        This is a tutorial style book that will teach usage of Python tools for GIS using simple practical examples and then show you how to build a complete mapping application from scratch. The book assumes basic knowledge of Python. No knowledge of Open Source GIS is required.

                        Who this book is for

                        Experienced Python developers who want to learn about geospatial concepts, work with geospatial data, solve spatial problems, and build map-based applications.

                        This book will be useful those who want to get up to speed with Open Source GIS in order to build GIS applications or integrate Geo-Spatial features into their existing applications.

                        Code Download and Errata
                        Packt Anytime, Anywhere
                        Register Books
                        Print Upgrades
                        eBook Downloads
                        Video Support
                        Contact Us
                        Awards Voting Nominations Previous Winners
                        Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
                        Resources
                        Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software