| | 1 | [[TOC()]] |
| | 2 | = GEOS Geometries = |
| | 3 | |
| | 4 | == Background == |
| | 5 | |
| | 6 | === What is GEOS? === |
| | 7 | |
| | 8 | [http://geos.refractions.net/ GEOS] stands for '''G'''eometry '''E'''ngine - '''O'''pen '''S'''ource, and is a C++ port of the [http://www.jump-project.org/project.php?PID=JTS&SID=OVER Java Topology Suite], implementing the OpenGIS [http://www.opengeospatial.org/standards/sfs Simple Features for SQL] spatial predicate functions and spatial operators. |
| | 9 | |
| | 10 | === Why the new API? === |
| | 11 | 1. The GEOS SWIG wrapper is no longer maintained, and requires the installation of SWIG. |
| | 12 | * ''See'' Sean Gillies, ''[http://zcologia.com/news/150/geometries-for-python/ Geometries for Python]'' (blog post explaining rationale for abandoning GEOS support); ''see also'' Sean's message on the [http://geos.refractions.net/pipermail/geos-devel/2007-March/002851.html GEOS-Devel Mailing List] (Mar. 5, 2007). |
| | 13 | 2. The [http://trac.gispython.org/projects/PCL/browser/PCL/trunk/PCL-Core/cartography/geometry PCL implementation] is over 2K+ lines of C and would make PCL a requisite package for the GeoDjango application stack. |
| | 14 | 3. Cross-platform compatibility. |
| | 15 | |
| | 16 | Thus, the Python {{{ctypes}}} package was used to wrap the [http://geos.refractions.net/ro/doxygen_docs/html/geos__c_8h-source.html GEOS C API] to bring the rich capabilities of GEOS to Python and GeoDjango. |
| | 17 | |
| | 18 | === Related Work === |
| | 19 | |
| | 20 | == Geometry Objects == |
| | 21 | |
| | 22 | === Point === |
| | 23 | |
| | 24 | === LineString === |
| | 25 | |
| | 26 | === LinearRing === |
| | 27 | |
| | 28 | === Polygon === |
| | 29 | |
| | 30 | == Geometry Collections == |
| | 31 | |
| | 32 | === MultiPoint === |
| | 33 | |
| | 34 | === MultiLineString === |
| | 35 | |
| | 36 | === MultiPolygon === |
| | 37 | |
| | 38 | === GeometryCollection === |
| | 39 | |
| | 40 | == API == |
| | 41 | |
| | 42 | === Creation === |
| | 43 | |
| | 44 | === Spatial Predicate Properties === |
| | 45 | * empty |
| | 46 | * valid |
| | 47 | * simple |
| | 48 | * ring |
| | 49 | * hasz |
| | 50 | |
| | 51 | === Spatial Predicate Methods === |
| | 52 | * contains() |
| | 53 | * crosses() |
| | 54 | * disjoint() |
| | 55 | * equals() |
| | 56 | * equals_exact() |
| | 57 | * intersects() |
| | 58 | * overlaps() |
| | 59 | * relate_pattern() |
| | 60 | * within() |
| | 61 | |
| | 62 | === Topological Methods === |
| | 63 | * buffer() |
| | 64 | * difference() |
| | 65 | * intersection() |
| | 66 | * relate() |
| | 67 | * sym_difference() |
| | 68 | * union() |
| | 69 | |
| | 70 | === Topological Properties === |
| | 71 | * area |
| | 72 | * boundary |
| | 73 | * centroid |
| | 74 | * convex_hull |
| | 75 | * envelope |
| | 76 | * point_on_surface |