Skip to Content
Mastering Geospatial Analysis with Python
book

Mastering Geospatial Analysis with Python

by Silas Toms, Paul Crickard, Eric van Rees
April 2018
Beginner to intermediate content levelBeginner to intermediate
440 pages
11h 36m
English
Packt Publishing
Content preview from Mastering Geospatial Analysis with Python

Multipolygons 

For the three other shapefiles with multipolygon geometry types, we'll pass the argument—multi to manage.py and ogrinspect. Using this option generates a MultiPolygon geometry column in the data model.

This command generates a data model from the US States shapefile:

C:\Projects\chapter12>python manage.py ogrinspect arenas\data\US_States.shp US_States \     --srid=4326 --mapping --multi

The output will look like this:

# This is an auto-generated Django model module created by ogrinspect.from django.contrib.gis.db import modelsclass US_States(models.Model):    stfips = models.CharField(max_length=2)    state = models.CharField(max_length=66)    stpostal = models.CharField(max_length=2)    version = models.CharField(max_length=2) dotregion = ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learning Geospatial Analysis with Python

Learning Geospatial Analysis with Python

Joel Lawhead

Publisher Resources

ISBN: 9781788293334Supplemental Content