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
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,
Jiri
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?
Jiri,
For the following compound geometry...
SHAPE(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO, SDO_ORDINATES)--------------------------------------------------------------------------------------------------------------------------------------------SDO_GEOMETRY(2003, 32145, NULL, SDO_ELEM_INFO_ARRAY(1, 1005, 2, 1, 2, 1, 5, 2, 2), SDO_ORDINATE_ARRAY(6, 10, 10, 1, 14, 10, 10, 14, 6, 10))
...use of the "Oracle Spatial" node in the Interoperability application can produce the following...
...feature instance which preserves the arc. For reference GDAL/OGR is not used for geometry retrieval when using registered schema or ad-hoc "Oracle Spatial" connections.
Attached also is a simple example C# and VBA application...
...which demonstrates how to develop a COM enabled .NET assembly which can be used by VBA to create an "Oracle Spatial" connection and demonstrates feature lock, edit and post functionalities.
Regards,
Jeff Bielefeld [Bentley]
Thank you a lot Jeff!
I am newbie to C# and I encountered a problem while trying to build your project - I corrected all of the references to point to my microstation and map dlls, but it still complains me about:
Error 1 Unexpected error creating debug information file 'Z:\projekty\os2dgn\xfm_oracle1\xfmOracleExtensions\xfmOracleExtensions\xfmOracleExtensions\obj\Release\Bentley.Geospatial.Extensions.Oracle.PDB' -- 'Z:\projekty\os2dgn\xfm_oracle1\xfmOracleExtensions\xfmOracleExtensions\xfmOracleExtensions\obj\Release\Bentley.Geospatial.Extensions.Oracle.pdb: System could not find the specified file.
' Oracle Spatial Extensions
What am I missing? Or am I using incompatible version of .Net? I have Visual C# 2010 Express .Net Framework 4 Client Profile. Microstation 08.11.07.171 and Map 08.11.07.87
Telling the truth, I don't need a gui interface, I would be perfectly satisfied with a simple program that would just import data from specified Oracle Special table into my opened DGN and which execution I could just simply start from VBA...
Sorry, the Framework I am using while attempting to compile, is ".Net Framework 4"