Changeset 1007
- Timestamp:
- 01/04/08 11:03:24
- Files:
-
- Shapely/trunk/manual/manual.txt (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
Shapely/trunk/manual/manual.txt
r994 r1007 19 19 20 20 .. contents:: 21 21 22 22 23 Background … … 34 35 .. _wiki: http://trac.gispython.org/projects/PCL/wiki/Shapely 35 36 37 36 38 Geometries 37 39 ========== … … 44 46 45 47 Shapely 1.0 does not provide circles, arcs, splines or the like. 48 46 49 47 50 Factories … … 112 115 order. 113 116 117 114 118 Multipart Geometry Factories 115 119 ---------------------------- … … 156 160 >>> holes = [(b1, ..., bN), ...] 157 161 >>> lines = MultiPolygon([(shell, holes), ...]) 162 163 164 Null Geometries 165 --------------- 166 167 Null geometries can be created by calling the factories with no arguments, but 168 almost nothing can be done with a null geometry. 169 170 .. code-block:: python 171 172 >>> line_null = LineString() 173 >>> line_null.length 174 Traceback (most recent call last): 175 ... 176 ValueError: Null geometry supports no operations 177 178 The coordinates of a null geometry *can* be set (see Section 3), after which 179 the geometry is no longer null. 180 181 .. code-block:: python 182 183 >>> l_null.coords = [(0, 0), (1, 1)] 184 >>> print l_null.length 185 1.414... 186 158 187 159 188 Constructive Spatial Analysis Methods … … 233 262 'POINT (-0.0000000000000000 -0.0000000000000000)' 234 263 235 236 264 Convex Hull 237 265 +++++++++++ … … 265 293 <shapely.geometry.polygon.Polygon object at ...> 266 294 295 Envelope 296 ++++++++ 297 298 .envelope : geometry 299 Returns the geometry's rectangular polygon envelope. 300 301 .. code-block:: python 302 303 >>> polygon.envelope 304 <shapely.geometry.polygon.Polygon object at ...> 305 267 306 Intersection 268 307 ++++++++++++ … … 302 341 >>> hull.union(polygon) 303 342 <shapely.geometry.polygon.Polygon object at ...> 343 304 344 305 345 Unary Spatial Predicates … … 351 391 True 352 392 >>> polygon.has_z 353 True 354 355 (Note: that last return value exposes a bug in GEOS 2.2.3. Should be False.) 393 False 394 395 (Note: that last return value exposes a bug in GEOS 2.2.3.) 396 356 397 357 398 Binary Spatial Predicates … … 438 479 The inverse of *contains*. 439 480 481 440 482 General Methods 441 483 --------------- … … 463 505 multi-polygons). 464 506 507 Bounds 508 ++++++ 509 510 .bounds : tuple 511 The geometry's (minx, miny, maxx, maxy) bounding box. 512 465 513 Length 466 514 ++++++ … … 477 525 >>> polygon.area 478 526 4.0 527 >>> polygon.bounds 528 (-1.0, -1.0, 1.0, 1.0) 479 529 >>> polygon.length 480 530 8.0 … … 483 533 >>> line_b.length 484 534 3.9812058474788765 535 485 536 486 537 Geometry Parts and Coordinates … … 524 575 [(1.0, 1.0), (2.0, 2.0)] 525 576 577 526 578 Polygon Rings 527 579 ------------- … … 539 591 The interior boundaries (or holes) of a polygon can be accessed through the 540 592 *interiors* attribute, which is a list of rings. 593 541 594 542 595 Sub-geometries … … 561 614 described above. 562 615 616 617 Point Coordinates 618 ----------------- 619 620 For the sake of convenience the coordinate values of points can be accessed 621 read-only via **x**, **y**, and **z** attributes: 622 623 .. code-block:: python 624 625 >>> point = Point(1.0, 1.0) 626 >>> point.x 627 1.0 628 >>> point.y 629 1.0 630 631 563 632 Interoperation 564 633 ============== … … 613 682 >>> loads(feature.GetGeometryRef().ExportToWkb()) 614 683 <shapely.geometry.polygon.Polygon object at ...> 684 615 685 616 686 Python Sequences … … 653 723 5 654 724 725 655 726 Numpy Array Interface 656 727 --------------------- … … 695 766 696 767 There is no Numpy array representation of a polygon. 768 697 769 698 770 Python Geo Interface … … 729 801 .. _Python geo interface: http://trac.gispython.org/projects/PCL/wiki/PythonGeoInterface 730 802 803 731 804 Advanced Features 732 805 ================= … … 764 837 ['POINT (0.5000000000000000 0.5000000000000000)'] 765 838 839 766 840 Credits 767 841 =======
