Hi all,
I encountered a problem while trying to import Oracle Spatial's compound polygons (that are those which contains both straight and arc segments - sdo_gtype=2003, elem_type=1005). I am using VBA to connect and import via gdi keyins:
myMSApp.CadInputQueue.SendKeyin "gdi open name=iskn user=" & ISKN_USER & " password=" & ISKN_PASSWD & " server=" & ISKN_SIDmyMSApp.CadInputQueue.SendKeyin "gdi import storage=iskn feature=jino_hranice_kp_pol level=""Hranice z RN_POLYGONY_KU"" color=4 weight=0 style=0"
Specified table (jino_hranice_kp_pol) contains polygons - with or without hole(s) (gtype=2003,elem_type=1003), multipolygons - with or without hole(s) (gtype=2007, elem_type=1003) and the discussed compound polygons (gtype=2003,elem_type=1005).
Import is successfull, but all of the compound geometries are omited without providing any error message.
All geometries in the table are valid (based on the sdo_geom.validate_geometry_with_context), table is registered in user_sdo_geom_metadata, has spatial index, primary key, everything...
MDSYS.SDO_GEOMETRY(2003, NULL, NULL, MDSYS.SDO_ELEM_INFO_ARRAY(1,1005,3,1,2,1,203,2,2,207,2,1), MDSYS.SDO_ORDINATE_ARRAY(-741245.35,-1043118.49,-741238.33,-1043100.16, ............))
I am using Oracle 11g (version 11.1.0.7.0).
Any clue, what am I doing wrong or any other idea how to achieve importing compound polygons from VBA?
Thank you for any kind of help,
Jiri Novak,
CUZK
Could this be because you have more than one sdo_gtype defined in the table ?
I don´t think so - I prepared a test table, where there were geometries of just one sdo_gtype = 2003 and with the spatial index with parameter 'layer_gtype=polygon' defined and it did not solve the problem. Still the compound polygons continues to be skipped :(
Could you please try this in the GeoDataInterchange user interface ? Make sure you are using the "Oracle" node for your import, not the "Import" node which goes through GDAL. I think that's what you are actually doing through your program but it's just to remove some variables.
Martin
Yes, you're right, I am using the "Import" node, not the "Oracle" one. The reason is that I don't know how to automate the opening of "Oracle" node from VBA. I am doing export from approximately 120 design files from Oracle Spatial, I need a way of opening a connection and importing the features directly from script without human intervention. Any clue how to achieve this? "gdi open" key-in opens just the "Import" node...
Jiri
I know how to retrieve Orracle Spatial features with where clauses, etc. thru .NET but VBA, if ou want to go that route.
2Martin: I don't think it is a GDAL thing - I was checking it on a Linux machine with GDAL1.7.2 by importing the same geometries to Grass and no problem occured...
2Jerry: Well, I would be happier if there was a solution in VBA, because I don't have experience with Microstation's port to .Net, but if you would be so glad and provide me a short example, it would be great. Nevertheless, do you think, this approach would not result finally in using the same library for import which didn't work me from VBA?
Thanks a lot for clarifying,
I did an investigation on GDAL and found several things - it implements strictly OGC Simple Features design, therefore any arc is automatically translated into LINESTRING and there does not exist such a thing as polygon with both linear and circular segments :( Ogr2ogr generates a V7 DGN file for me, doesn't skip any geometry, but implicitly converts every arc into linestring feature. Because what am I writing requires automatization and preserving arc geometries i am still lack of solution... Anybody please have an idea?