James,
I am quite sure there is a database-based solution for all your steps.
*1. load geometry information from a table with spatial filter and other conditions (where clause)*
I assume you mean something like:
CREATE TABLE load_table AS SELECT ID, GEOM FROM base_table where SDO_INSIDE(....) = 'TRUE';
*2. get the points from the geometry column (sdo_geometry)*
I assume you mean something like:
SELECT ID, v.x, v.y FROM load_table l, TABLE(sdo_util.getVertices(l.geom)) t;
(See last comment about data.)
The problem is that we need a lot more information on what it is that you want to do in steps 3 - 5.
*3. Transform the coordinates.*
What sort of transformation? Rotation, Shift, Scale, Coordinate rounding?
*4. Encoding the coordinates*
What do you mean by this? Write them out as WKT/KML/GML?
*5. Output*
Again, output to what, where? A new table? A shapefile? A text file?
Also, if you can provide a single sdo_geometry object + data and some example SQL it would help as well.
Here is an example where I take a geometry, rotate it (cf 3. Transform), extract vertices (2. get points), encode it (4. Encoding), and then output to screen (5. Output).
WITH myGeom As (
SELECT 1 as id,
MDSYS.SDO_GEOMETRY(2006, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1,2,1,5,2,1), MDSYS.SDO_ORDINATE_ARRAY(355600.52, 5407396.19, 361365.32, 5408106.36, 356488.27, 5409242.37, 357437.46, 5406457.67)) as geom
FROM DUAL
)
SELECT g.id || ',' || t.x || ',' || t.y as csv
FROM myGeom g,
TABLE (sdo_util.getVertices(
GEOM.Rotate(p_geometry => g.geom,
p_tolerance => 0.005,
p_rotatePt => MDSYS.SDO_Point_Type(357437.46,5406457.67,NULL),
p_rotation => 45 ))) t;
-- Results
--
CSV
----------------------
1,355474.91,5405822.39
1,359049.08,5410400.89
1,354797.2,5407755.57
1,357437.46,5406457.67
Now show us what it is you want to do!!
regards
Simon