<br><font size=2 face="sans-serif">Hi</font>
<br>
<br><font size=2 face="sans-serif">I think Daniel asked, how Mapserver-users
could deal with this issue in the case, they have</font>
<br><font size=2 face="sans-serif">no direct influence on the way points
are represented in the oracle-database.</font>
<br>
<br><font size=2 face="sans-serif">Maybe this is a workaround:</font>
<br><font size=2 face="sans-serif">...</font>
<br><font size=2 face="sans-serif">DATA &quot;GEOMETRY FROM (SELECT <b>MDSYS.SDO_GEOM.SDO_CENTROID</b>(shape)
geometry,... FROM MYTABLE &nbsp;) ....&quot;</font>
<br><font size=2 face="sans-serif">...</font>
<br>
<br><font size=2 face="sans-serif">I didn't test it with mapserver. But
the following SQL-statement delivers &quot;544347.756&quot;:</font>
<br><font size=2 face="sans-serif">SELECT &nbsp;MDSYS.SDO_GEOM.SDO_CENTROID(</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;SDO_GEOMETRY(2001, 82247, NULL, </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
SDO_ELEM_INFO_ARRAY(1, 1, 1), </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
SDO_ORDINATE_ARRAY(544347.756, 4350295.7)),</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;0.05).sdo_point.x</font>
<br><font size=2 face="sans-serif">FROM DUAL;</font>
<br>
<br><font size=2 face="sans-serif">It seems, that MDSYS.SDO_GEOM.SDO_CENTROID
converts the way a point is represented.</font>
<br>
<br><font size=2 face="sans-serif">Bye</font>
<br><font size=2 face="sans-serif">benedikt Rothe</font>
<br>
<br>
<br><tt><font size=2>mapserver-dev-bounces@lists.osgeo.org schrieb am 13.02.2008
03:18:12:<br>
<br>
&gt; Fernando,<br>
&gt; <br>
&gt; &nbsp; &nbsp; Good suggestion.<br>
&gt; <br>
&gt; SQL&gt; select * from tt;<br>
&gt; <br>
&gt; GEOM(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)<br>
&gt; --------------------------------------------------------------------------------<br>
&gt; SDO_GEOMETRY(2001, 82247, NULL, SDO_ELEM_INFO_ARRAY(1, 1, 1), <br>
&gt; SDO_ORDINATE_ARRAY<br>
&gt; (544347.756, 4350295.7))<br>
&gt; <br>
&gt; SQL&gt; select sdo_geom.validate_geometry_with_context(geom, 0.000005)
from tt;<br>
&gt; <br>
&gt; SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT(GEOM,0.000005)<br>
&gt; --------------------------------------------------------------------------------<br>
&gt; TRUE<br>
&gt; <br>
&gt; &nbsp; &nbsp; This one geometry in a large table in which the point
geometry <br>
&gt; representations vary between SDO_POINT and SDO_ORDINATES. &nbsp;The
original <br>
&gt; data stored its ordinates in SDO_POINT, but a frontend app inserts
new <br>
&gt; geometries with ordinates in SDO_ORDINATES. &nbsp;The app developers
<br>
&gt; construct Oracle JGeometry objects in java, then insert then using
JDBC. <br>
&gt; &nbsp; Obviously the process is pretty lax since the data is inserted
as <br>
&gt; SDO_ORDINATES, and yet rendered identically by Oracle MapViewer.<br>
&gt; <br>
&gt; &nbsp; &nbsp; Here's some information on their oriented point extension:
<br>
&gt; http://download-west.oracle.com/docs/cd/B19306_01/appdev.<br>
&gt; 102/b14255/sdo_objrelschema.htm#CBBIGEFH<br>
&gt; <br>
&gt; Thanks,<br>
&gt; <br>
&gt; Dave<br>
&gt; <br>
&gt; <br>
&gt; Fernando Simon wrote:<br>
&gt; &gt; Hi Daniel and David,<br>
&gt; &gt; &nbsp; &nbsp; Well, about the SDO_POINT. The Mapserver driver
just read the point<br>
&gt; &gt; data from SDO_POINT, from the Oracle Spatial manual (page 2.2,
for point<br>
&gt; &gt; example and figure 2-6): &quot;SDO_ELEM_INFO and SDO_ORDINATES
are both NULL,<br>
&gt; &gt; as required if the SDO_POINT attribute is specified.&quot; And
the SDO_POINT<br>
&gt; &gt; topic in the manual hint that you can just store points using
the<br>
&gt; &gt; SDO_POINT attribute.<br>
&gt; &gt; &nbsp; &nbsp; Maybe you can force the use of the<br>
&gt; &gt; SDO_GEOM.VALIDATE_GEOMETRY_WITH_CONTEXT function to verify if
the<br>
&gt; &gt; geometry is valid, if it returns true and Mapserver can't draw,
we have<br>
&gt; &gt; a bug :).<br>
&gt; &gt; &nbsp; &nbsp; David, about the kind of the point that you wrote,
the Mapserver<br>
&gt; &gt; can't draw it. I never head about it, I will read about it and
other<br>
&gt; &gt; things for release 11 to check new features. Now a question for
core<br>
&gt; &gt; developers, if I read angle data from database (like David wrote
about<br>
&gt; &gt; the point) can I set the angle attribute for the layer? Will
work, the<br>
&gt; &gt; angle?<br>
&gt; &gt; &nbsp; &nbsp; We can check about this special kind of data, but
I believe that<br>
&gt; &gt; Mapserver just need to draw the data/kinds/types defined in the
2-2<br>
&gt; &gt; table for SDO_ELEM_INFO.<br>
&gt; &gt; &nbsp; &nbsp; Daniel, in my opinion the data that you report
was wrong. You can<br>
&gt; &gt; write in the Oracle forum (in the OTN page) about it, the developers
of<br>
&gt; &gt; the Oracle Spatial read and reply there.<br>
&gt; &gt; &nbsp; &nbsp; Best regards.<br>
&gt; &gt; <br>
&gt; &gt; Fernando Simon<br>
&gt; &gt; <br>
&gt; &gt; David Fuhry wrote:<br>
&gt; &gt;&gt; Daniel,<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Point ordinates wouldn't ever be in SDO_ELEM_INFO; it only
stores<br>
&gt; &gt;&gt; metadata for how to interpret SDO_ORDINATES.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; I'm not sure what MapServer does, but Oracle MapViewer will
render a<br>
&gt; &gt;&gt; point if the ordinates are stored in either the SDO_POINT
or the<br>
&gt; &gt;&gt; SDO_ORDINATES substructure of SDO_GEOMETRY.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Notably, 10g+ has a feature known as &quot;oriented points&quot;,
in which<br>
&gt; &gt;&gt; SDO_POINT is null, and the (x,y[,z]) point ordinates are
stored in<br>
&gt; &gt;&gt; SDO_ORDINATES, and are followed by values (still in SDO_ORDINATES)
which<br>
&gt; &gt;&gt; describe an angle, for obvious use in labeling.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; The correct behavior would be for MapServer to render the
point at the<br>
&gt; &gt;&gt; location stored in SDO_ORDINATES iff the SDO_POINT is null.<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Thanks,<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Dave<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; Daniel Morissette wrote:<br>
&gt; &gt;&gt;&gt; Fernando,<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; I've had someone report to me that when MapServer reads
point layers<br>
&gt; &gt;&gt;&gt; from Oracle, it works fine if the coordinates are stored
in the<br>
&gt; &gt;&gt;&gt; SDO_POINT, but it doesn't work if they are stored in
SDO_ELEM_INFO or<br>
&gt; &gt;&gt;&gt; SDO_ORDINATES which are apparently two other valid ways
of storing<br>
&gt; &gt;&gt;&gt; point data.<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; Are you aware of this issue? Is there a way around it
or do you have<br>
&gt; &gt;&gt;&gt; any advice to provide to users who run into this problem?<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; Thanks<br>
&gt; &gt;&gt;&gt;<br>
&gt; &gt;&gt;&gt; Daniel<br>
&gt; &gt;&gt; _______________________________________________<br>
&gt; &gt;&gt; mapserver-dev mailing list<br>
&gt; &gt;&gt; mapserver-dev@lists.osgeo.org<br>
&gt; &gt;&gt; http://lists.osgeo.org/mailman/listinfo/mapserver-dev<br>
&gt; &gt;&gt;<br>
&gt; _______________________________________________<br>
&gt; mapserver-dev mailing list<br>
&gt; mapserver-dev@lists.osgeo.org<br>
&gt; http://lists.osgeo.org/mailman/listinfo/mapserver-dev<br>
</font></tt>