Ok, I can point you at the code that does the reading of Oracle geometries, but I'm not sure that I quite understand what you want to do...
The class that does the geometry reading is: http://svn.geotools.org/geotools/trunk/gt/plugin/oraclespatial/src/org/geotools/data/oracle/attributeio/SDOAttributeIO.java
it currently uses:
http://svn.geotools.org/geotools/trunk/gt/plugin/oraclespatial/src/org/geotools/data/oracle/sdo/SDO.java
which was written by refractions to replace Oracle's SDO code. There is also an older version that just uses the Oracle SDO code.
So you may be able to modify that class to also read the compound stuff.
Though if you're doing that, the better route might be to improve JTS to do so, if it doesn't already. David, does JTS make any attempt to handle circular-arc stuff? Or does it just do the same things gt2 does? I'm pretty sure we're planning on having the oracle data reading be done by JTS directly. (when we do that port it might make sense to use packed coordinate sequences for better speed?)
Stephen, the one part of your post that confuses me is:
> What I need to do is transform, within GeoServer or GeoTools, the compound
> line-string into an approximately equivalent line-string comprised
> entirely of
> line segments, with no circular arcs. As far as I know, this can be achieved
> simply by replacing the SDO_ELEM_INFO_ARRAY with a single triple (1, 2, 1).
How are you proposing going about replacing the SDO_ELEM_INFO_ARRAY? Is there a call you can make to oracle to do it? Or are you looking for code that makes the arc in GeoTools and then turns it in to line strings? I'm pretty sure the latter does not exist. The former is actually kind of tricky, since there's not a straightforward mechanism to make such calls to Oracle.
I could be totally wrong, but it also seems to me that if you are just replacing the SDO_ELEM_INFO_ARRAY with 1,2,1, that it wouldn't very closely approximate the curves. Like it would just draw straight lines between the various points, instead of coming up with shorter lines that closer approximate the arc. But I also could just be understanding things completely wrong. It just seems like you'd need a function of some sort to do the transform in oracle, instead of just replacing the element info array...
Chris
staylor@anonymised.com wrote:
Hi all,
I'm new to GeoServer and would like to use it, or modify it, to handle
circular-arc and other non-standard geometries imported from an Oracle
database. My knowledge of the codebase is so far slight, so I have been
unable to find which classes, if any, in the source code for GeoServer
and/or GeoTools would need to be modified in order to transform circular-arc
data so that GeoTools/GeoServer can understand it. I'm pretty sure that
FeatureReader must be calling classes that transform data, but don't know how
exactly.
The geometry data in a typical feature/row from my data is
SDO_GEOMETRY(2002, NULL, NULL, SDO_ELEM_INFO_ARRAY(1, 4, 4, 1, 2, 1, 3, 2,
2, 7,
2, 2, 11, 2, 1), SDO_ORDINATE_ARRAY(213384.927, 599385.252, 213286.163,
599553.
117, 213271.298, 599575.081, 213253.785, 599594.997, 213210.193,
599656.786, 213
186.753, 599728.679, 213138.458, 599899.775))
where the first triple '1, 4, 4' of the SDO_ELEM_INFO_ARRAY indicates a
'compound line-string', i.e., a line string comprising both straight line
segments and circular arcs. The second '4' in this triple indicates that the
compound line-string has four sub-elements, the triples for which in the same
array are '1, 2, 1', '3, 2, 2', '7, 2, 2', and '11, 2, 1' respectively: a
triple of the form 'X, 2, 1' indicates a line-string of line segments, and
the
form 'X, 2, 2' indicates a connected sequence of circular arcs.
What I need to do is transform, within GeoServer or GeoTools, the compound
line-string into an approximately equivalent line-string comprised
entirely of
line segments, with no circular arcs. As far as I know, this can be achieved
simply by replacing the SDO_ELEM_INFO_ARRAY with a single triple (1, 2, 1).
I suspect that code for such a transformation already exists within GeoTools
or GeoServer, but I've spent several days searching through the design
documentation and source code, to no avail. I would be very grateful to
anyone
who can point me to the appropriate class - and they would also be hastening
adoption of open-source tools by the Australian ACT government!
Thanks very much in advance,
Stephen Taylor
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642
_______________________________________________
Geoserver-devel mailing list
Geoserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-devel
--
Chris Holmes
The Open Planning Project
thoughts at: http://cholmes.wordpress.com