Skip to Content
Analytics for the Internet of Things (IoT)
book

Analytics for the Internet of Things (IoT)

by Andrew Minteer
July 2017
Beginner to intermediate
378 pages
10h 26m
English
Packt Publishing
Content preview from Analytics for the Internet of Things (IoT)

Dilation and erosion

With shapely, a positive buffer is a dilation and a negative amount is an erosion. A dilation works as previously described while an erosion shrinks a polygon by the buffer amount. Shapely also has some options for the shape of a cap (the buffer area at the ends of lines) and areas where the buffer joins to itself. The following shows the cap and join style options:

shapely.geometry.CAP_STYLE

Attribute Value
round 1
flat 2
square 3

 

shapely.geometry.JOIN_STYLE

Attribute

Value

round

1

mitre

2

bevel

3

The following code shows a simple example of how buffering works:

#import linestring class, cap and join stylesfrom shapely.geometry import LineString, CAP_STYLE, JOIN_STYLEunbufferedLine ...
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

Big Data Analytics for Internet of Things

Big Data Analytics for Internet of Things

Tausifa Jan Saleem, Mohammad Ahsan Chishti
Hands-On Industrial Internet of Things

Hands-On Industrial Internet of Things

Giacomo Veneri, Antonio Capasso
Internet of Things

Internet of Things

Mayur Ramgir

Publisher Resources

ISBN: 9781787120730Supplemental Content