3. Buffer a point
echo "POINT (1 1)" | geom buffer -d 100
Reproject a Point
echo "POINT (1 1)" | geom project -s "EPSG:4326" -t "EPSG:2927"
Generate random points
echo "POINT (1 1)" | geom buffer -d 100 | geom random -n 200
4.
5. "Write programs that do
one thing and do it well.
Write programs to work
together.Write programs
to handle text streams,
because that is a universal
interface."
6. Write programs that do
one thing and do it well...
buffer centroid envelope convexHull voronoiDiagram
7. Write programs to work
together...
Unix Pipes
stdin -> program -> stdout
... program -> stdout -> stdin -> program ...
buffer | centroid | envelope
wkt -> buffer -> wkt | wkt -> centroid -> wkt | wkt -> envelope -> envelope
8. Write programs to handle
text streams...
WKT
POINT (1 1)
LINESTRING (0 0, 5 5, 10 10)
POLYGON ((0 0, 0 10, 10 10, 10 0, 0 0))
46. Extend
• Create a Java class that implements Command
Interface
• or extends GeometryCommand
• or extends OtherGeometryCommand
• Add command line options by creating an
Options subclass with Args4J annotations
• Java Service Provider Interface
• META-INF/services/org.geometrycommands/Command
• Add line with the full path (package and class name)