Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Python Geospatial Analysis Cookbook
  • Table Of Contents Toc
  • Feedback & Rating feedback
Python Geospatial Analysis Cookbook

Python Geospatial Analysis Cookbook

By : Diener
4.4 (5)
close
close
Python Geospatial Analysis Cookbook

Python Geospatial Analysis Cookbook

4.4 (5)
By: Diener

Overview of this book

Geospatial development links your data to places on the Earth’s surface. Its analysis is used in almost every industry to answer location type questions. Combined with the power of the Python programming language, which is becoming the de facto spatial scripting choice for developers and analysts worldwide, this technology will help you to solve real-world spatial problems. This book begins by tackling the installation of the necessary software dependencies and libraries needed to perform spatial analysis with Python. From there, the next logical step is to prepare our data for analysis; we will do this by building up our tool box to deal with data preparation, transformations, and projections. Now that our data is ready for analysis, we will tackle the most common analysis methods for vector and raster data. To check or validate our results, we will explore how to use topology checks to ensure top-quality results. This is followed with network routing analysis focused on constructing indoor routes within buildings, over different levels. Finally, we put several recipes together in a GeoDjango web application that demonstrates a working indoor routing spatial analysis application. The round trip will provide you all the pieces you need to accomplish your own spatial analysis application to suit your requirements.
Table of Contents (15 chapters)
close
close
12
A. Other Geospatial Python Libraries
13
B. Mapping Icon Libraries
14
Index

A point must be on the starting and ending nodes of a line only


A routing network of connected edges may contain some routing logic associated with the intersections of roads that are represented as points. These points must, of course, be exactly located at the start or end of a line in order to identify these junctions. Once the junctions are found, various rules can be applied in the attributes to control your routing, for example.

A typical example would be turn restrictions that could be modeled as points:

How to do it...

Our handy utils.py module located in the trunk folder helps us out with the mundane tasks of importing a Shapefile and converting it to a Shapely geometry object for us to work with.

  1. Now let's create our point check code like this:

    #!/usr/bin/env python
    # -*- coding: utf-8 -*-
    
    from utils import shp2_geojson_obj
    from utils import create_shply_multigeom
    from utils import out_geoj
    from shapely.geometry import Point, MultiPoint
    
    in_shp_line = "../geodata/topo_line.shp"
    in_shp_point...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY