/usr/share/doc/python-pyproj/README.html is in python-pyproj 1.8.9-1.1+b2.
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: package pyproj</title>
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>pyproj</strong></big></big> (version 1.8.7)</font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/lib/python2.5/site-packages/pyproj/__init__.py">/usr/local/lib/python2.5/site-packages/pyproj/__init__.py</a></font></td></tr></table>
<p><tt>Pyrex wrapper to provide python interfaces to<br>
PROJ.4 (<a href="http://proj.maptools.org">http://proj.maptools.org</a>) functions.<br>
<br>
Performs cartographic transformations and geodetic computations.<br>
<br>
The <a href="#Proj">Proj</a> class can convert from geographic (longitude,latitude)<br>
to native map projection (x,y) coordinates and vice versa, or<br>
from one map projection coordinate system directly to another.<br>
<br>
The <a href="#Geod">Geod</a> class can perform forward and inverse geodetic, or<br>
Great Circle, computations. The forward computation involves<br>
determining latitude, longitude and back azimuth of a terminus<br>
point given the latitude and longitude of an initial point, plus<br>
azimuth and distance. The inverse computation involves<br>
determining the forward and back azimuths and distance given the<br>
latitudes and longitudes of an initial and terminus point.<br>
<br>
Input coordinates can be given as python arrays, lists/tuples,<br>
scalars or numpy/Numeric/numarray arrays. Optimized for objects<br>
that support the Python buffer protocol (regular python and<br>
numpy array objects).<br>
<br>
Download: <a href="http://code.google.com/p/pyproj/downloads/list">http://code.google.com/p/pyproj/downloads/list</a><br>
<br>
Requirements: python 2.4 or higher.<br>
<br>
Example scripts are in 'test' subdirectory of source distribution.<br>
The '<a href="#-test">test</a>()' function will run the examples in the docstrings.<br>
<br>
Contact: Jeffrey Whitaker <jeffrey.s.whitaker@noaa.gov<br>
<br>
copyright (c) 2006 by Jeffrey Whitaker.<br>
<br>
Permission to use, copy, modify, and distribute this software<br>
and its documentation for any purpose and without fee is hereby<br>
granted, provided that the above copyright notice appear in all<br>
copies and that both the copyright notice and this permission<br>
notice appear in supporting documentation. THE AUTHOR DISCLAIMS<br>
ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL<br>
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT<br>
SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, INDIRECT OR<br>
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM<br>
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,<br>
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN<br>
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Package Contents</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="pyproj._geod.html">_geod</a><br>
</td><td width="25%" valign=top><a href="pyproj._proj.html">_proj</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial">_geod.Geod(<a href="__builtin__.html#object">__builtin__.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="pyproj.html#Geod">Geod</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial">_proj.Proj(<a href="__builtin__.html#object">__builtin__.object</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="pyproj.html#Proj">Proj</a>
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Geod">class <strong>Geod</strong></a>(_geod.Geod)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>performs forward and inverse geodetic, or Great Circle,<br>
computations. The forward computation (using the 'fwd' method)<br>
involves determining latitude, longitude and back azimuth of a<br>
terminus point given the latitude and longitude of an initial<br>
point, plus azimuth and distance. The inverse computation (using<br>
the 'inv' method) involves determining the forward and back<br>
azimuths and distance given the latitudes and longitudes of an<br>
initial and terminus point.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="pyproj.html#Geod">Geod</a></dd>
<dd>_geod.Geod</dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="Geod-fwd"><strong>fwd</strong></a>(self, lons, lats, az, dist, radians<font color="#909090">=False</font>)</dt><dd><tt>forward transformation - Returns longitudes, latitudes and back<br>
azimuths of terminus points given longitudes (lons) and<br>
latitudes (lats) of initial points, plus forward azimuths (az)<br>
and distances (dist).<br>
<br>
Works with numpy and regular python array objects, python<br>
sequences and scalars.<br>
<br>
if radians=True, lons/lats and azimuths are radians instead of<br>
degrees. Distances are in meters.</tt></dd></dl>
<dl><dt><a name="Geod-inv"><strong>inv</strong></a>(self, lons1, lats1, lons2, lats2, radians<font color="#909090">=False</font>)</dt><dd><tt>inverse transformation - Returns forward and back azimuths, plus<br>
distances between initial points (specified by lons1, lats1) and<br>
terminus points (specified by lons2, lats2).<br>
<br>
Works with numpy and regular python array objects, python<br>
sequences and scalars.<br>
<br>
if radians=True, lons/lats and azimuths are radians instead of<br>
degrees. Distances are in meters.</tt></dd></dl>
<dl><dt><a name="Geod-npts"><strong>npts</strong></a>(self, lon1, lat1, lon2, lat2, npts, radians<font color="#909090">=False</font>)</dt><dd><tt>Given a single initial point and terminus point (specified by<br>
python floats lon1,lat1 and lon2,lat2), returns a list of<br>
longitude/latitude pairs describing npts equally spaced<br>
intermediate points along the geodesic between the initial and<br>
terminus points.<br>
<br>
if radians=True, lons/lats are radians instead of degrees.<br>
<br>
Example usage:<br>
<br>
>>> from pyproj import <a href="#Geod">Geod</a><br>
>>> g = <a href="#Geod">Geod</a>(ellps='clrk66') # Use Clarke 1966 ellipsoid.<br>
>>> # specify the lat/lons of Boston and Portland.<br>
>>> boston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)<br>
>>> portland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)<br>
>>> # find ten equally spaced points between Boston and Portland.<br>
>>> lonlats = g.<a href="#Geod-npts">npts</a>(boston_lon,boston_lat,portland_lon,portland_lat,10)<br>
>>> for lon,lat in lonlats: print '%6.3f %7.3f' % (lat, lon)<br>
43.528 -75.414<br>
44.637 -79.883<br>
45.565 -84.512<br>
46.299 -89.279<br>
46.830 -94.156<br>
47.149 -99.112<br>
47.251 -104.106<br>
47.136 -109.100<br>
46.805 -114.051<br>
46.262 -118.924</tt></dd></dl>
<hr>
Static methods defined here:<br>
<dl><dt><a name="Geod-__new__"><strong>__new__</strong></a>(self, initparams<font color="#909090">=None</font>, **kwargs)</dt><dd><tt>initialize a <a href="#Geod">Geod</a> class instance.<br>
<br>
Geodetic parameters for specifying the ellipsoid<br>
can be given in a dictionary 'initparams', as keyword arguments, <br>
or as as proj4 geod initialization string.<br>
Following is a list of the ellipsoids that may be defined using the <br>
'ellps' keyword:<br>
<br>
MERIT a=6378137.0 rf=298.257 MERIT 1983<br>
SGS85 a=6378136.0 rf=298.257 Soviet Geodetic System 85<br>
GRS80 a=6378137.0 rf=298.257222101 GRS 1980(IUGG, 1980)<br>
IAU76 a=6378140.0 rf=298.257 IAU 1976<br>
airy a=6377563.396 b=6356256.910 Airy 1830<br>
APL4.9 a=6378137.0. rf=298.25 Appl. Physics. 1965<br>
NWL9D a=6378145.0. rf=298.25 Naval Weapons Lab., 1965<br>
mod_airy a=6377340.189 b=6356034.446 Modified Airy<br>
andrae a=6377104.43 rf=300.0 Andrae 1876 (Den., Iclnd.)<br>
aust_SA a=6378160.0 rf=298.25 Australian Natl & S. Amer. 1969<br>
GRS67 a=6378160.0 rf=298.2471674270 GRS 67(IUGG 1967)<br>
bessel a=6377397.155 rf=299.1528128 Bessel 1841<br>
bess_nam a=6377483.865 rf=299.1528128 Bessel 1841 (Namibia)<br>
clrk66 a=6378206.4 b=6356583.8 Clarke 1866<br>
clrk80 a=6378249.145 rf=293.4663 Clarke 1880 mod.<br>
CPM a=6375738.7 rf=334.29 Comm. des Poids et Mesures 1799<br>
delmbr a=6376428. rf=311.5 Delambre 1810 (Belgium)<br>
engelis a=6378136.05 rf=298.2566 Engelis 1985<br>
evrst30 a=6377276.345 rf=300.8017 Everest 1830<br>
evrst48 a=6377304.063 rf=300.8017 Everest 1948<br>
evrst56 a=6377301.243 rf=300.8017 Everest 1956<br>
evrst69 a=6377295.664 rf=300.8017 Everest 1969<br>
evrstSS a=6377298.556 rf=300.8017 Everest (Sabah & Sarawak)<br>
fschr60 a=6378166. rf=298.3 Fischer (Mercury Datum) 1960<br>
fschr60m a=6378155. rf=298.3 Modified Fischer 1960<br>
fschr68 a=6378150. rf=298.3 Fischer 1968<br>
helmert a=6378200. rf=298.3 Helmert 1906<br>
hough a=6378270.0 rf=297. Hough<br>
intl a=6378388.0 rf=297. International 1909 (Hayford)<br>
krass a=6378245.0 rf=298.3 Krassovsky, 1942<br>
kaula a=6378163. rf=298.24 Kaula 1961<br>
lerch a=6378139. rf=298.257 Lerch 1979<br>
mprts a=6397300. rf=191. Maupertius 1738<br>
new_intl a=6378157.5 b=6356772.2 New International 1967<br>
plessis a=6376523. b=6355863. Plessis 1817 (France)<br>
SEasia a=6378155.0 b=6356773.3205 Southeast Asia<br>
walbeck a=6376896.0 b=6355834.8467 Walbeck<br>
WGS60 a=6378165.0 rf=298.3 WGS 60<br>
WGS66 a=6378145.0 rf=298.25 WGS 66<br>
WGS72 a=6378135.0 rf=298.26 WGS 72<br>
WGS84 a=6378137.0 rf=298.257223563 WGS 84<br>
sphere a=6370997.0 b=6370997.0 Normal Sphere (r=6370997)<br>
<br>
The parameters of the ellipsoid may also be set directly using<br>
the 'a' (semi-major or equatorial axis radius) keyword, and<br>
any one of the following keywords: 'b' (semi-minor,<br>
or polar axis radius), 'e' (eccentricity), 'es' (eccentricity<br>
squared), 'f' (flattening), or 'rf' (reciprocal flattening).<br>
<br>
See the proj documentation (<a href="http://proj.maptools.org">http://proj.maptools.org</a>) for more<br>
information about specifying ellipsoid parameters (specifically,<br>
the chapter 'Specifying the Earth's figure' in the main <a href="#Proj">Proj</a><br>
users manual).<br>
<br>
Example usage:<br>
<br>
>>> from pyproj import <a href="#Geod">Geod</a><br>
>>> g = <a href="#Geod">Geod</a>(ellps='clrk66') # Use Clarke 1966 ellipsoid.<br>
>>> # specify the lat/lons of some cities.<br>
>>> boston_lat = 42.+(15./60.); boston_lon = -71.-(7./60.)<br>
>>> portland_lat = 45.+(31./60.); portland_lon = -123.-(41./60.)<br>
>>> newyork_lat = 40.+(47./60.); newyork_lon = -73.-(58./60.)<br>
>>> london_lat = 51.+(32./60.); london_lon = -(5./60.)<br>
>>> # compute forward and back azimuths, plus distance<br>
>>> # between Boston and Portland.<br>
>>> az12,az21,dist = g.<a href="#Geod-inv">inv</a>(boston_lon,boston_lat,portland_lon,portland_lat)<br>
>>> print "%7.3f %6.3f %12.3f" % (az12,az21,dist)<br>
-66.531 75.654 4164192.708<br>
>>> # compute latitude, longitude and back azimuth of Portland,<br>
>>> # given Boston lat/lon, forward azimuth and distance to Portland.<br>
>>> endlon, endlat, backaz = g.<a href="#Geod-fwd">fwd</a>(boston_lon, boston_lat, az12, dist)<br>
>>> print "%6.3f %6.3f %13.3f" % (endlat,endlon,backaz)<br>
45.517 -123.683 75.654<br>
>>> # compute the azimuths, distances from New York to several<br>
>>> # cities (pass a list)<br>
>>> lons1 = 3*[newyork_lon]; lats1 = 3*[newyork_lat]<br>
>>> lons2 = [boston_lon, portland_lon, london_lon]<br>
>>> lats2 = [boston_lat, portland_lat, london_lat]<br>
>>> az12,az21,dist = g.<a href="#Geod-inv">inv</a>(lons1,lats1,lons2,lats2)<br>
>>> for faz,baz,d in zip(az12,az21,dist): print "%7.3f %7.3f %9.3f" % (faz,baz,d)<br>
54.663 -123.448 288303.720<br>
-65.463 79.342 4013037.318<br>
51.254 -71.576 5579916.649<br>
>>> g2 = <a href="#Geod">Geod</a>('+ellps=clrk66') # use proj4 style initialization string<br>
>>> az12,az21,dist = g2.<a href="#Geod-inv">inv</a>(boston_lon,boston_lat,portland_lon,portland_lat)<br>
>>> print "%7.3f %6.3f %12.3f" % (az12,az21,dist)<br>
-66.531 75.654 4164192.708</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Methods inherited from _geod.Geod:<br>
<dl><dt><a name="Geod-__reduce__"><strong>__reduce__</strong></a>(...)</dt><dd><tt>special method that allows pyproj.<a href="#Geod">Geod</a> instance to be pickled</tt></dd></dl>
<hr>
Data descriptors inherited from _geod.Geod:<br>
<dl><dt><strong>geodstring</strong></dt>
</dl>
<dl><dt><strong>proj_version</strong></dt>
</dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="Proj">class <strong>Proj</strong></a>(_proj.Proj)</font></td></tr>
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
<td colspan=2><tt>performs cartographic transformations (converts from<br>
longitude,latitude to native map projection x,y coordinates and<br>
vice versa) using proj (<a href="http://proj.maptools.org/">http://proj.maptools.org/</a>)<br>
<br>
A <a href="#Proj">Proj</a> class instance is initialized with proj map projection<br>
control parameter key/value pairs. The key/value pairs can<br>
either be passed in a dictionary, or as keyword arguments,<br>
or as a proj4 string (compatible with the proj command). See<br>
<a href="http://www.remotesensing.org/geotiff/proj_list">http://www.remotesensing.org/geotiff/proj_list</a> for examples of<br>
key/value pairs defining different map projections.<br>
<br>
Calling a <a href="#Proj">Proj</a> class instance with the arguments lon, lat will<br>
convert lon/lat (in degrees) to x/y native map projection<br>
coordinates (in meters). If optional keyword 'inverse' is True<br>
(default is False), the inverse transformation from x/y to<br>
lon/lat is performed. If optional keyword 'radians' is True<br>
(default is False) lon/lat are interpreted as radians instead of<br>
degrees. If optional keyword 'errcheck' is True (default is<br>
False) an exception is raised if the transformation is invalid.<br>
If errcheck=False and the transformation is invalid, no<br>
exception is raised and 1.e30 is returned. If the optional keyword<br>
'preserve_units' is True, the units in map projection coordinates<br>
are not forced to be meters.<br>
<br>
Works with numpy and regular python array objects, python<br>
sequences and scalars.<br> </tt></td></tr>
<tr><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="pyproj.html#Proj">Proj</a></dd>
<dd>_proj.Proj</dd>
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="Proj-__call__"><strong>__call__</strong></a>(self, *args, **kw)</dt><dd><tt>Calling a <a href="#Proj">Proj</a> class instance with the arguments lon, lat will<br>
convert lon/lat (in degrees) to x/y native map projection<br>
coordinates (in meters). If optional keyword 'inverse' is True<br>
(default is False), the inverse transformation from x/y to<br>
lon/lat is performed. If optional keyword 'radians' is True<br>
(default is False) the units of lon/lat are radians instead of<br>
degrees. If optional keyword 'errcheck' is True (default is<br>
False) an exception is raised if the transformation is invalid.<br>
If errcheck=False and the transformation is invalid, no<br>
exception is raised and 1.e30 is returned.<br>
<br>
Instead of calling with lon, lat, a single ndarray of<br>
shape n,2 may be used, and one of the same shape will<br>
be returned; this is more efficient.<br>
<br>
Inputs should be doubles (they will be cast to doubles if they<br>
are not, causing a slight performance hit).<br>
<br>
Works with numpy and regular python array objects, python<br>
sequences and scalars, but is fastest for array objects.</tt></dd></dl>
<dl><dt><a name="Proj-is_geocent"><strong>is_geocent</strong></a>(self)</dt><dd><tt>returns True if projection in geocentric (x/y) coordinates</tt></dd></dl>
<dl><dt><a name="Proj-is_latlong"><strong>is_latlong</strong></a>(self)</dt><dd><tt>returns True if projection in geographic (lon/lat) coordinates</tt></dd></dl>
<hr>
Static methods defined here:<br>
<dl><dt><a name="Proj-__new__"><strong>__new__</strong></a>(self, projparams<font color="#909090">=None</font>, preserve_units<font color="#909090">=False</font>, **kwargs)</dt><dd><tt>initialize a <a href="#Proj">Proj</a> class instance.<br>
<br>
Proj4 projection control parameters must either be given in a<br>
dictionary 'projparams' or as keyword arguments. See the proj<br>
documentation (<a href="http://proj.maptools.org">http://proj.maptools.org</a>) for more information<br>
about specifying projection parameters.<br>
<br>
Example usage:<br>
<br>
>>> from pyproj import <a href="#Proj">Proj</a><br>
>>> p = <a href="#Proj">Proj</a>(proj='utm',zone=10,ellps='WGS84') # use kwargs<br>
>>> x,y = p(-120.108, 34.36116666)<br>
>>> print 'x=%9.3f y=%11.3f' % (x,y)<br>
x=765975.641 y=3805993.134<br>
>>> print 'lon=%8.3f lat=%5.3f' % p(x,y,inverse=True)<br>
lon=-120.108 lat=34.361<br>
>>> # do 3 cities at a time in a tuple (Fresno, LA, SF)<br>
>>> lons = (-119.72,-118.40,-122.38)<br>
>>> lats = (36.77, 33.93, 37.62 )<br>
>>> x,y = p(lons, lats)<br>
>>> print 'x: %9.3f %9.3f %9.3f' % x<br>
x: 792763.863 925321.537 554714.301<br>
>>> print 'y: %9.3f %9.3f %9.3f' % y<br>
y: 4074377.617 3763936.941 4163835.303<br>
>>> lons, lats = p(x, y, inverse=True) # inverse transform<br>
>>> print 'lons: %8.3f %8.3f %8.3f' % lons<br>
lons: -119.720 -118.400 -122.380<br>
>>> print 'lats: %8.3f %8.3f %8.3f' % lats<br>
lats: 36.770 33.930 37.620<br>
>>> p2 = <a href="#Proj">Proj</a>('+proj=utm +zone=10 +ellps=WGS84') # use proj4 string<br>
>>> x,y = p2(-120.108, 34.36116666)<br>
>>> print 'x=%9.3f y=%11.3f' % (x,y)<br>
x=765975.641 y=3805993.134<br>
>>> p = <a href="#Proj">Proj</a>(init="epsg:32667")<br>
>>> print 'x=%12.3f y=%12.3f (meters)' % p(-114.057222, 51.045)<br>
x=-1783486.760 y= 6193833.196 (meters)<br>
>>> p = <a href="#Proj">Proj</a>("+init=epsg:32667",preserve_units=True)<br>
>>> print 'x=%12.3f y=%12.3f (feet)' % p(-114.057222, 51.045)<br>
x=-5851322.810 y=20320934.409 (feet)</tt></dd></dl>
<hr>
Data descriptors defined here:<br>
<dl><dt><strong>__dict__</strong></dt>
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
</dl>
<dl><dt><strong>__weakref__</strong></dt>
<dd><tt>list of weak references to the object (if defined)</tt></dd>
</dl>
<hr>
Methods inherited from _proj.Proj:<br>
<dl><dt><a name="Proj-__reduce__"><strong>__reduce__</strong></a>(...)</dt><dd><tt>special method that allows pyproj.<a href="#Proj">Proj</a> instance to be pickled</tt></dd></dl>
<hr>
Data descriptors inherited from _proj.Proj:<br>
<dl><dt><strong>proj_version</strong></dt>
</dl>
<dl><dt><strong>srs</strong></dt>
</dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-set_datapath"><strong>set_datapath</strong></a>(...)</dt></dl>
<dl><dt><a name="-test"><strong>test</strong></a>()</dt><dd><tt>run the examples in the docstrings using the doctest module</tt></dd></dl>
<dl><dt><a name="-transform"><strong>transform</strong></a>(p1, p2, x, y, z<font color="#909090">=None</font>, radians<font color="#909090">=False</font>)</dt><dd><tt>x2, y2, z2 = <a href="#-transform">transform</a>(p1, p2, x1, y1, z1, radians=False)<br>
<br>
Transform points between two coordinate systems defined by the<br>
<a href="#Proj">Proj</a> instances p1 and p2.<br>
<br>
The points x1,y1,z1 in the coordinate system defined by p1 are<br>
transformed to x2,y2,z2 in the coordinate system defined by p2.<br>
<br>
z1 is optional, if it is not set it is assumed to be zero (and<br>
only x2 and y2 are returned).<br>
<br>
In addition to converting between cartographic and geographic<br>
projection coordinates, this function can take care of datum<br>
shifts (which cannot be done using the __call__ method of the<br>
<a href="#Proj">Proj</a> instances). It also allows for one of the coordinate<br>
systems to be geographic (proj = 'latlong').<br>
<br>
If optional keyword 'radians' is True (default is False) and p1<br>
is defined in geographic coordinate (pj.is_latlong() is True),<br>
x1,y1 is interpreted as radians instead of the default degrees.<br>
Similarly, if p2 is defined in geographic coordinates and<br>
radians=True, x2, y2 are returned in radians instead of degrees.<br>
if p1.is_latlong() and p2.is_latlong() both are False, the<br>
radians keyword has no effect.<br>
<br>
x,y and z can be numpy or regular python arrays, python<br>
lists/tuples or scalars. Arrays are fastest. For projections in<br>
geocentric coordinates, values of x and y are given in meters.<br>
z is always meters.<br>
<br>
Example usage:<br>
<br>
>>> # projection 1: UTM zone 15, grs80 ellipse, NAD83 datum<br>
>>> # (defined by epsg code 26915)<br>
>>> p1 = <a href="#Proj">Proj</a>(init='epsg:26915')<br>
>>> # projection 2: UTM zone 15, clrk66 ellipse, NAD27 datum<br>
>>> p2 = <a href="#Proj">Proj</a>(init='epsg:26715')<br>
>>> # find x,y of Jefferson City, MO.<br>
>>> x1, y1 = p1(-92.199881,38.56694)<br>
>>> # transform this point to projection 2 coordinates.<br>
>>> x2, y2 = <a href="#-transform">transform</a>(p1,p2,x1,y1)<br>
>>> print '%9.3f %11.3f' % (x1,y1)<br>
569704.566 4269024.671<br>
>>> print '%9.3f %11.3f' % (x2,y2)<br>
569706.333 4268817.680<br>
>>> print '%8.3f %5.3f' % p2(x2,y2,inverse=True)<br>
-92.200 38.567<br>
>>> # process 3 points at a time in a tuple<br>
>>> lats = (38.83,39.32,38.75) # Columbia, KC and StL Missouri<br>
>>> lons = (-92.22,-94.72,-90.37)<br>
>>> x1, y1 = p1(lons,lats)<br>
>>> x2, y2 = <a href="#-transform">transform</a>(p1,p2,x1,y1)<br>
>>> xy = x1+y1<br>
>>> print '%9.3f %9.3f %9.3f %11.3f %11.3f %11.3f' % xy<br>
567703.344 351730.944 728553.093 4298200.739 4353698.725 4292319.005<br>
>>> xy = x2+y2<br>
>>> print '%9.3f %9.3f %9.3f %11.3f %11.3f %11.3f' % xy<br>
567705.072 351727.113 728558.917 4297993.157 4353490.111 4292111.678<br>
>>> lons, lats = p2(x2,y2,inverse=True)<br>
>>> xy = lons+lats<br>
>>> print '%8.3f %8.3f %8.3f %5.3f %5.3f %5.3f' % xy<br>
-92.220 -94.720 -90.370 38.830 39.320 38.750</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>__version__</strong> = '1.8.7'<br>
<strong>pyproj_datadir</strong> = '/usr/local/lib/python2.5/site-packages/pyproj/data'</td></tr></table>
</body></html>
|