/usr/lib/python2.7/dist-packages/shapely/wkt.py is in python-shapely 1.3.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | """Load/dump geometries using the well-known text (WKT) format
"""
from shapely import geos
# Pickle-like convenience functions
def loads(data):
"""Load a geometry from a WKT string."""
return geos.WKTReader(geos.lgeos).read(data)
def load(fp):
"""Load a geometry from an open file."""
data = fp.read()
return loads(data)
def dumps(ob, **kw):
"""Dump a WKT representation of a geometry to a string.
See available keyword output settings in ``shapely.geos.WKTWriter``.
"""
return geos.WKTWriter(geos.lgeos, **kw).write(ob)
def dump(ob, fp, **settings):
"""Dump a geometry to an open file."""
fp.write(dumps(ob, **settings))
|