简体   繁体   中英

WKT to SDO_Geometry

I need to transform data from Well Known-Text to Oracle SDO_Geometry . I found the method SDO_UTIL.FROM_WKTGEOMETRY in Oracle that is perfect for my porpuses but it takes a long time and I need to transform a lot of geometries. Also, I know about the SDOAPI in Java but I didn't found any useful method there and I don't want to reinvent the wheel. Are there any Java API or SQL method to solve it?

Thanks.

Found a solution in the package oracle.spatial.util in SDOUTL.jar and SDOAPI.jar included in Oracle to convert from WKT to SDO_Geometry and vice-versa:

String geom = "MULTIPOLYGON (..."
byte[] bgeom = geom.getBytes();
WKT wkt = new WKT ();
JGeometry jgeom = wkt.toJGeometry(bgeom);
bgeom = wkt.fromJGeometry(jgeom);
System.out.println(new String(bgeom, "UTF-8"));

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM