<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF xmlns="http://usefulinc.com/ns/doap#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Project><name>Shapely</name>
<shortdesc>Geospatial geometries, predicates, and operations</shortdesc>
<description>Shapely
=======

Shapely is a Python package for programming with 2D geospatial geometries. It
is based on GEOS (http://geos.refractions.net). Shapely 1.0 is ignorant about
coordinate and reference systems. Projection responsibility is left to specific
applications. For more information, see:

* Shapely wiki_
* Shapely manual_

Shapely requires Python 2.4+. (I've also begun to port it to Python 3.0:
http://zcologia.com/news/564/shapely-for-python-3-0/.)


Dependencies
------------

* libgeos_c (2.2.3 or 3.0.0+)
* Python ctypes_ (standard in Python 2.5+)

.. _ctypes: http://pypi.python.org/pypi/ctypes/


Installation
------------

Windows users should use the executable installer, which contains the required
GEOS DLL. Other users should acquire libgeos_c by any means, make sure that it
is on the system library path, and install from the Python package index::

  $ sudo easy_install Shapely

with the setup script::

  $ sudo python setup.py install

or by using the development buildout on Linux, which also provides libgeos_c::

  $ svn co http://svn.gispython.org/svn/gispy/buildout/shapely.buildout/trunk shapely.buildout
  $ cd shapely.buildout
  $ python bootstrap.py
  $ ./bin/buildout


Usage
-----

To buffer a point::

  &gt;&gt;&gt; from shapely.geometry import Point
  &gt;&gt;&gt; point = Point(-106.0, 40.0) # longitude, latitude
  &gt;&gt;&gt; point.buffer(10.0)
  &lt;shapely.geometry.polygon.Polygon object at ...&gt;

See the manual_ for comprehensive examples of usage. See also Operations.txt
and Predicates.txt under tests/ for more examples of the spatial operations and
predicates provided by Shapely. See also Point.txt, LineString.txt, etc for
examples of the geometry APIs.


Numpy integration
-----------------

All Shapely geometry instances provide the Numpy array interface::

  &gt;&gt;&gt; from numpy import asarray
  &gt;&gt;&gt; a = asarray(point)
  &gt;&gt;&gt; a.size
  3
  &gt;&gt;&gt; a.shape
  (2,)

Numpy arrays can also be adapted to Shapely points and linestrings::

  &gt;&gt;&gt; from shapely.geometry import asLineString
  &gt;&gt;&gt; a = array([[1.0, 2.0], [3.0, 4.0]])
  &gt;&gt;&gt; line = asLineString(a)
  &gt;&gt;&gt; line.wkt
  'LINESTRING (1.0000000000000000 2.0000000000000000, 3.0000000000000000 4.0000000000000000)'


Python Geo Interface
--------------------

Any object that provides the Python geo interface can be adapted to a Shapely
geometry with the asShape factory::

  &gt;&gt;&gt; d = {"type": "Point", "coordinates": (0.0, 0.0)}
  &gt;&gt;&gt; from shapely.geometry import asShape
  &gt;&gt;&gt; shape = asShape(d)
  &gt;&gt;&gt; shape.geom_type
  'Point'
  &gt;&gt;&gt; tuple(shape.coords)
  ((0.0, 0.0),)

  &gt;&gt;&gt; class GeoThing(object):
  ...     def __init__(self, d):
  ...         self.__geo_interface__ = d
  &gt;&gt;&gt; thing = GeoThing({"type": "Point", "coordinates": (0.0, 0.0)})
  &gt;&gt;&gt; shape = asShape(thing)
  &gt;&gt;&gt; shape.geom_type
  'Point'
  &gt;&gt;&gt; tuple(shape.coords)
  ((0.0, 0.0),)

See http://trac.gispython.org/projects/PCL/wiki/PythonGeoInterface for more
details on the interface.


Testing
-------

Several of the modules have docstring doctests::

  $ cd shapely
  $ python point.py

There are also two test runners under tests/. test_doctests.py requires
zope.testing. runalldoctests.py does not. Perhaps the easiest way to run the 
tests is::

  $ python setup.py test


Support
-------

For current information about this project, see the wiki_.

.. _wiki: http://trac.gispython.org/projects/PCL/wiki/Shapely
.. _manual: http://gispython.org/shapely/manual.html

If you have questions, please consider joining our community list:

http://trac.gispython.org/projects/PCL/wiki/CommunityList


Credits
-------

* Sean Gillies (Pleiades)
* Howard Butler (Hobu, Inc.)
* Kai Lautaportti (Hexagon IT)
* Fr |eaigue| d |eaigue| ric Junod (Camptocamp SA)
* Eric Lemoine (Camptocamp SA)
* Justin Bronn (GeoDjango) for ctypes inspiration
* Artem Pavlenko (Mapnik) for help with GEOS DLLs

.. |eaigue| unicode:: U+00E9
   :trim:

Major portions of this work were supported by a grant (to Pleiades) from the
U.S.  National Endowment for the Humanities (http://www.neh.gov).</description>
<homepage rdf:resource="http://trac.gispython.org/projects/PCL/wiki/Shapely" />
<maintainer><foaf:Person><foaf:name>Sean Gillies</foaf:name>
<foaf:mbox_sha1sum>6d4fc00ffb9c849f15b4c0b55833b29e33794116</foaf:mbox_sha1sum></foaf:Person></maintainer>
<release><Version><revision>1.0</revision></Version></release>
</Project></rdf:RDF>