openlayers 3 (or oracle) convert 2d to 3d

المشرف العام

Administrator
طاقم الإدارة
We have an existing oracle gis which is being reworked. We're not really touching the oracle stored procedures or tables. In the table, the sdo_geometry appears to be a 3D line, with 0 as the z value. I'm not entirely sure why it was written this way, I wasn't there when it was written. However, when this data gets brought into an openlayers vector layer and I observer the feature geometry, there is no Z value, so somehow it's being converted from 3D to 2D. In my new code I'm actually sending the data to oracle as a WKT, and then converting it to an sdo_geometry in an oracle helper function which passes the data to the other procedure which takes an sdo_geometry (I couldn't find a way to convert to sdo_geometry format in c# or javascript). So the linestring is being sent as 2D which the database expects 3D so therein lies my problem. I think I can get around this on a few ways, but I don't know how to do any of them. I could...

A. Force my vector layer in openlayers to be 3D. with z value of 0.

B. use some (unknown to me) openlayers function to return a 3D version of the geometry (or WKT) given a 2D, with Z set to 0.

C. use Oracle (in my helper function) to make the sdo_geometry 3D (a different constuctor maybe?) currently using sdo_geometry(wkt_in,srid) srid is 8307 if that matters.

D. Write my own function in javascript or C# which will just parse the WKT and add a 0 to each coordinate set. I don't have a problem doing this, but would rather use existing functions if they're available.

E. something else I haven't thought of :)



أكثر...
 
أعلى