201 | | Here is an example of how to create a geometry object (assuming the {{{Zip}}} model example above). Geometries can be represented in either the WKT (Well Known Text) format, or in HEXEWKB (PostGIS specific, essentially a WKB geometry in hexadecimal). ''See'' Open GIS Consortium, Inc., ''[http://portal.opengeospatial.org/files/?artifact_id=829&ei=Z5oGRv6aCZ-IwQKh2LXwAw&usg=__4YgoHsbqjocl8Z01SwMAyN84aW0=&sig2=4DpSpm83ZDEIBKSivWcYGQ OpenGIS Simple Feature Specification For SQL]'', Document 99-049 (May 5, 1999), at Ch. 3.2.5 (SQL Textual Representation of Geometry, pg. 53); ''see also'' [http://postgis.refractions.net/docs/ch04.html#id2904792 "PostGIS EWKB, EWKT and Canonical Forms"], PostGIS documentation at Ch. 4.1.2]. |
| 214 | Here is an example of how to create a geometry object (assuming the {{{Zip}}} model example above). Geometries can be represented in either the WKT (Well Known Text) format, or in HEXEWKB (PostGIS specific, essentially a WKB geometry in hexadecimal). ''See'' Open GIS Consortium, Inc., ''[http://portal.opengeospatial.org/files/?artifact_id=829&ei=Z5oGRv6aCZ-IwQKh2LXwAw&usg=__4YgoHsbqjocl8Z01SwMAyN84aW0=&sig2=4DpSpm83ZDEIBKSivWcYGQ OpenGIS Simple Feature Specification For SQL]'', Document 99-049 (May 5, 1999), at Ch. 3.2.5 (SQL Textual Representation of Geometry, pg. 53); ''see also'' [http://postgis.refractions.net/docs/ch04.html#id2904792 "PostGIS EWKB, EWKT and Canonical Forms"], PostGIS documentation at Ch. 4.1.2. |
| 220 | |
| 221 | = Database API = |
| 222 | |
| 223 | == PostGIS Operator Field Lookup Types == |
| 224 | |
| 225 | * ''See generally'', [http://postgis.refractions.net/docs/ch06.html#id2618041 "Operators", PostGIS Documentation at Ch. 6.2.2] |
| 226 | * '''Note:''' This API is subject to some change, ''i.e.'', {{{overlapsbelow}}} is expected to become {{{overlaps_below}}}. |
| 227 | * {{{overlapsleft}}} |
| 228 | * Returns true if A's bounding box overlaps or is to the left of B's bounding box. |
| 229 | * PostGIS equivalent "{{{&<}}}" |
| 230 | * {{{overlapsright}}} |
| 231 | * Returns true if A's bounding box overlaps or is to the right of B's bounding box. |
| 232 | * PostGIS equivalent "{{{&>}}}" |
| 233 | * {{{left}}} |
| 234 | * Returns true if A's bounding box is strictly to the left of B's bounding box. |
| 235 | * PostGIS equivalent "{{{<<}}}" |
| 236 | * {{{right}}} |
| 237 | * Returns true if A's bounding box is strictly to the right of B's bounding box. |
| 238 | * PostGIS equivalent "{{{>>}}}" |
| 239 | * {{{overlapsbelow}}} |
| 240 | * Returns true if A's bounding box overlaps or is below B's bounding box. |
| 241 | * PostGIS equivalent "{{{&<|}}}" |
| 242 | * {{{overlapsabove}}} |
| 243 | * Returns true if A's bounding box overlaps or is above B's bounding box. |
| 244 | * PostGIS equivalent "{{{|&>}}}" |
| 245 | * {{{strictlybelow}}} |
| 246 | * Returns true if A's bounding box is strictly below B's bounding box. |
| 247 | * PostGIS equivalent "{{{<<|}}}" |
| 248 | * {{{strictlyabove}}} |
| 249 | * Returns true if A's bounding box is strictly above B's bounding box. |
| 250 | * PostGIS equivalent "{{{|>>}}}" |
| 251 | * {{{sameas}}} |
| 252 | * The "same as" operator. It tests actual geometric equality of two features. So if A and B are the same feature, vertex-by-vertex, the operator returns true. |
| 253 | * PostGIS equivalent "{{{~=}}}" |
| 254 | * {{{contained}}} |
| 255 | * Returns true if A's bounding box is completely contained by B's bounding box. |
| 256 | * PostGIS equivalent "{{{@}}}" |
| 257 | * {{{bbcontains}}} |
| 258 | * Returns true if A's bounding box completely contains B's bounding box. |
| 259 | * PostGIS equivalent "{{{~}}}" |
| 260 | * {{{bboverlaps}}} |
| 261 | * Returns true if A's bounding box overlaps B's bounding box. |
| 262 | * PostGIS equivalent "{{{&&}}}" |
| 263 | |
| 264 | == PostGIS GEOS Function Field Lookup Types == |
| 265 | * ''See generally'' "Geometry Relationship Functions", PostGIS Documentation at Ch. 6.1.2. This documentation will be updated completely with the content from the aforementioned PostGIS docs. |
| 266 | * {{{distance}}} |
| 267 | * Return the cartesian distance between two geometries in projected units. |
| 268 | * PostGIS equivalent {{{Distance(geometry, geometry)}}} |
| 269 | * {{{equals}}} |
| 270 | * Requires GEOS |
| 271 | * Returns 1 (TRUE) if the given Geometries are "spatially equal". |
| 272 | * Use this for a 'better' answer than '='. equals('LINESTRING(0 0, 10 10)','LINESTRING(0 0, 5 5, 10 10)') is true. |
| 273 | * PostGIS equivalent {{{Equals(geometry, geometry)}}}, OGC SPEC s2.1.1.2 |
| 274 | * {{{disjoint}}} |
| 275 | * Requires GEOS |
| 276 | * Returns 1 (TRUE) if the Geometries are "spatially disjoint". |
| 277 | * |
| 278 | * PostGIS equivalent {{{Disjoint(geometry, geometry)}}} |
| 279 | * {{{intersects}}} |
| 280 | * PostGIS equivalent {{{Intersects(geometry, geometry)}}} |
| 281 | * {{{touches}}} |
| 282 | * PostGIS equivalent {{{Touches(geometry, geometry)}}} |
| 283 | * {{{crosses}}} |
| 284 | * PostGIS equivalent {{{Crosses(geometry, geometry)}}} |
| 285 | * {{{overlaps}}} |
| 286 | * PostGIS equivalent {{{Overlaps(geometry, geometry)}}} |
| 287 | * {{{contains}}} |
| 288 | * PostGIS equivalent {{{Contains(geometry, geometry)}}} |
| 289 | * {{{intersects}}} |
| 290 | * PostGIS equivalent {{{Intersects(geometry, geometry)}}} |
| 291 | * {{{relate}}} |
| 292 | * PostGIS equivelent {{{Relate(geometry, geometry)}}} |