Most spatial Java™ API
applications need to perform the steps described in this section.
Using Logging
Using the SpatialManager class, you
can turn on logging, for example to a file /tmp/spatial.log.
You can alternatively send formatted log records to an existing writer
object.
Assigning a Connection to CoordRefManager
Applications must assign an open database connection to
the CoordRef- Manager object. This enables the CoordRefManager object
to query the
spatial_references table and cache its contents locally. If
you forget to do this, a SpatialException with the message Invalid
argument: CoordRef=null is usually thrown whenever you try
to instantiate a geometry object.
Reading Coordinate Data
Many applications need to read coordinate data from a geometry
object. This example uses for loops to read the coordinates of an
existing geometry object, to temporarily hold the coordinates in a
buffer, and then to pass the coordinates to a drawing function.