From charlesreid1

Revision as of 20:19, 16 April 2017 by Admin (talk | contribs) (Created page with "Shapely is a library for drawing shapes in Python. Link: https://pypi.python.org/pypi/Shapely =Installing= ==Mac OS X== First install geos, to enable linking shapely with...")
(diff) ← Older revision | Latest revision (diff) | Newer revision β†’ (diff)

Shapely is a library for drawing shapes in Python.

Link: https://pypi.python.org/pypi/Shapely

Installing

Mac OS X

First install geos, to enable linking shapely with geographic libraries/coordinate systems:

$ brew install geos

==> Downloading https://homebrew.bintray.com/bottles/geos-3.6.1.sierra.bottle.tar.gz
######################################################################## 100.0%
==> Pouring geos-3.6.1.sierra.bottle.tar.gz
==> Caveats
Python modules have been installed and Homebrew's site-packages is not
in your Python sys.path, so you will not be able to import the modules
this formula installed. If you plan to develop with these modules,
please run:
  mkdir -p /Users/charles/Library/Python/2.7/lib/python/site-packages
  echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/charles/Library/Python/2.7/lib/python/site-packages/homebrew.pth
==> Summary
🍺  /usr/local/Cellar/geos/3.6.1: 401 files, 7.2MB

Next, install shapely with Numpy add-ons to make it faster:

$ pip install shapely[vectorized]==1.6b2

Collecting shapely[vectorized]==1.6b2
  Downloading Shapely-1.6b2-cp27-cp27m-macosx_10_6_intel.whl (2.2MB)
    100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2.2MB 263kB/s
Requirement already satisfied: numpy; extra == "vectorized" in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages (from shapely[vectorized]==1.6b2)
Installing collected packages: shapely
Successfully installed shapely-1.6b2