Geometry from Oracle 10g into SQL server 2012


  • I'm building a service(C#) which selects a number of geometries from a system that stores its geometries in an Oracle 10g, and then save a copy of those into a SQL Server database for use by another system.

    Looked first at SDO_UTIL.TO_WKTGEOMETRY(). However, the geometries is stored as 3d geometries (Even though the z-layer is always 0, so it will not work as WKT only works if in 2d).

    Option number two was then SDO_UTIL.TO_GMLGEOMETRY(), this however returns GMLs in V2, and SQL Server would like them in GML V3.1.1(from what I could read)(And have not found a simple way to convert these).

    Does anyone have an idea of ​​other options, maybe some third-party libraries that can be used for this?

    Understand that some may find this more to belong in a. net forum, but have been trying for such, but not been able to find anything. Any ideas would be appreciated!

    Friday, May 03, 2013 8:26 PM

All replies

  • Why are you storing 3D geometries if the Z value is always 0?:)

    It's been a while since I used Oracle but it seems to me that if TO_WKTGEOMETRY() only works with 2d geometries (couldn't see where this limitation was documented anywhere?) then what you need to do is "flatten" the data into 2d first, using something like the MAKE_2D function: then export them as WKT.

    twitter: @alastaira blog: | Pro Spatial with SQL Server 2012

    Saturday, May 04, 2013 7:25 AM

  • The system that uses the Oracle as data source is not under our control, another apartments(or more like a different municipal). The 3d geom choice has something to do with the future needs.

    When you try to run it with TO_WKTGEOMETRY(), it states(TOAD) it's not compatible with 3d geoms. This might be something that is an Oracle 10g limitation though, cos I first took a look at MAKE_2D(), but it's not available until 11g. And they are not to keen on paying for that. Atleast not yet...

    But thanks for the advice!

    Saturday, May 04, 2013 3:23 PM