This content has been marked as final. Show 11 replies
I just installed XE (quick and easy !) and have started testing locator. I could not use the sdo_geometry constructor with well-known text, e.g.:
INSERT INTO test1 VALUES (2,'church',
SDO_GEOMETRY('POLYGON ((-69 -25, -72 -25, -72 -27, -69 -27, -69 -25))', NULL));
It gave no error, but the resulting geometry was NULL. The same works with standard edition oracle 10g.
Also, when trying to print out the wkt value of the shape fields (when populated using the normal constructor) the output is always NULL, e.g.
select col1, s.shape.get_wkt() from test1 s;
Is there no support for Well-known text in Locator/XE?
Yes, there is exist one very nice open-source tool developed as extension for Oracle SQL Developer - called GeoRaptor. You need to download Oracle SQL Developer from OTN and GeoRaptor from http://mygeoraptor.googlepages.com/. Installation instructions for GeoRaptor are provided also on the same site.
You can use the JTS library (Version 1.7) to insert WKT Geometry's into your database.
Probably WAY off topic, but worth mentioning somewhere here.
Its Java code, so not for everyone, but here it is anyway:
Connection connection = getConnection();
PreparedStatement ps = connection.prepareStatement( "UPDATE TABLE SET GEOMETRY = ?" );
WKTReader reader = new WKTReader();
Geometry myPoly = reader.read( POLYGON ((-69 -25, -72 -25, -72 -27, -69 -27, -69 -25)) );
OraWriter writer = new OraWriter( connection );
STRUCT obj = writer.write( myPoly );
ps.setObject( 1, obj );
Also, the JTS OraReader Class, performs 1/3 faster than JGeometry.load(...), but does not support all the complex Geometry types that JGeometry does.
That's great, best free SQL -Editor I've ever seen and the plugin: GeoRaptor....(Geometry-View-Function !!!)...
=> A perfect double to work with spatial data.
P.S. The Plugin can also be downloaded by sourceforge, I got some problems with the direct SQL -Editor-Update-Function:
Direct Link: http://prdownloads.sourceforge.net/georaptor/org.GeoRaptor-20060202-dev.jar?download