Skip to content

Commit 6000fce

Browse files
authored
list exported and GeoInterface methods in readme (#168)
* list exported methods in readme This isn't a substitute for docs, but lacking them its nice to at least list the functions and objects people can use. * Update README.md
1 parent 1ae44e3 commit 6000fce

File tree

1 file changed

+141
-0
lines changed

1 file changed

+141
-0
lines changed

README.md

Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,146 @@ polygon = LibGEOS.union(g1, g3)
3434

3535
GEOS functionality is extensive, so coverage is incomplete, but the basic functionality for working with geospatial data is already available. I'm learning as I go along, so documentation is lacking, but if you're interested, you can have a look at the examples in the `examples/` folder, or the tests in `test/test_geo_interface.jl` and `test/test_geos_operations.jl`.
3636

37+
38+
Conversion to/from GeoInterface objects
39+
---------------------------------------
40+
41+
[GeoInterface.jl](https://github.com/JuliaGeo/GeoInterface.jl) compatible geometries from many
42+
packages including GeometryBasics.jl, Shapefile.jl, GeoJSON.jl, KML.jl, ArchGDAL.jl, GADM.jl
43+
and others can be easily converted to LibGEOS geometries using:
44+
45+
```
46+
GeoInterface.convert(LibGEOS, other_package_geometry)
47+
```
48+
49+
To broadcast this over a vector or iterable we need to use `Ref` on `LibGEOS`:
50+
51+
```
52+
GeoInterface.convert.(Ref(LibGEOS), iterable_of_geometries)
53+
```
54+
55+
The same applies in reverse, such as for interop with the Makie.jl/GeometryBasics.jl ecosystem:
56+
57+
```
58+
GeoInterface.convert(GeometryBasics, libgeos_geometry)
59+
```
60+
61+
For packages like Shapefile.jl and GeoJSON.jl, converting to their objects isn't
62+
possible, as theyre not particularly useful on their own. Instead, we can just write directly:
63+
64+
```
65+
Shapefile.write("myfile.shp", libgeos_geometry)
66+
```
67+
68+
GeoInterface methods
69+
-----------------------
70+
71+
GeoInterace.jl OGC standards methods work on LibGEOS objects:
72+
73+
- `GeoInterface.distance`
74+
- `GeoInterface.buffer`
75+
- `GeoInterface.convexhull`
76+
- `GeoInterface.equals`
77+
- `GeoInterface.disjoint`
78+
- `GeoInterface.intersects`
79+
- `GeoInterface.touches`
80+
- `GeoInterface.within`
81+
- `GeoInterface.contains`
82+
- `GeoInterface.overlaps`
83+
- `GeoInterface.crosses`
84+
- `GeoInterface.symdifference`
85+
- `GeoInterface.difference`
86+
- `GeoInterface.intersection`
87+
- `GeoInterface.union`
88+
89+
See the GeoInterface.jl [API docs](https://juliageo.org/GeoInterface.jl/stable/reference/api/) for details.
90+
91+
Exported LibGEOS geometries:
92+
--------------------
93+
94+
- `GeometryCollection`
95+
- `LineString`
96+
- `LinearRing`
97+
- `MultiLineString`
98+
- `MultiPoint`
99+
- `MultiPolygon`
100+
- `Point`
101+
- `Polygon`
102+
- `STRtree`
103+
104+
Exported LibGEOS functions:
105+
-------------------
106+
107+
- `area`
108+
- `boundary`
109+
- `buffer`
110+
- `bufferWithStyle`
111+
- `centroid`
112+
- `constrainedDelaunayTriangulation`
113+
- `containsproperly`
114+
- `convexhull`
115+
- `coveredby`
116+
- `covers`
117+
- `crosses`
118+
- `delaunayTriangulation`
119+
- `delaunayTriangulationEdges`
120+
- `difference`
121+
- `disjoint`
122+
- `distance`
123+
- `endPoint`
124+
- `envelope`
125+
- `equals`
126+
- `equalsexact`
127+
- `exteriorRing`
128+
- `geomLength`
129+
- `getGeometries`
130+
- `getGeometry`
131+
- `getPrecision`
132+
- `getXMax`
133+
- `getXMin`
134+
- `getYMax`
135+
- `getYMin`
136+
- `hasZ`
137+
- `hausdorffdistance`
138+
- `interiorRing`
139+
- `interiorRings`
140+
- `interpolate`
141+
- `interpolateNormalized`
142+
- `intersection`
143+
- `intersects`
144+
- `isClosed`
145+
- `isEmpty`
146+
- `isRing`
147+
- `isSimple`
148+
- `isValid`
149+
- `lineMerge`
150+
- `minimumRotatedRectangle`
151+
- `nearestPoints`
152+
- `node`
153+
- `numGeometries`
154+
- `numPoints`
155+
- `overlaps`
156+
- `pointOnSurface`
157+
- `polygonize`
158+
- `prepareGeom`
159+
- `project`
160+
- `projectNormalized`
161+
- `query`
162+
- `readgeom`
163+
- `setPrecision`
164+
- `sharedPaths`
165+
- `simplify`
166+
- `snap`
167+
- `startPoint`
168+
- `symmetricDifference`
169+
- `topologyPreserveSimplify`
170+
- `touches`
171+
- `unaryUnion`
172+
- `union`
173+
- `uniquePoints`
174+
- `within`
175+
- `writegeom`
176+
37177
Installation
38178
------------
39179
1. At the Julia prompt, run
@@ -48,6 +188,7 @@ Installation
48188
```
49189

50190
# Ecosystem
191+
* All [GeoInterface.jl](https://github.com/JuliaGeo/GeoInterface.jl) compatible geometries will work in LibGEOS without conversion.
51192
* Makie support for LibGEOS is available via [LibGEOSMakie.jl](https://github.com/jw3126/LibGEOSMakie.jl)
52193
* LibGEOS integrates with [GeoInterface.jl](https://github.com/JuliaGeo/GeoInterface.jl) making it easy to combine LibGEOS with other geometry packages.
53194

0 commit comments

Comments
 (0)