Gdi import from oracle spatial ommits compound polygons geometry (gtype=1003,elem_info=1005)

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_SID
myMSApp.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

  • Thank you, the problem was exactly where you pointed - I had to change "copy local" to false. Now I succeded building your dll. Nevertheless when I open the Microstation Macro and want to add the reference to "Bentley.Geospatial.Extensions.Oracle.dll" it fails with "Microstation Visual Basic: can't add a reference to the specified file". Do you think this can be caused by compiling in VS C# Express 2010?

    Jiri

  • ...not familiar with that particular error, but at this time I would recommend the use of Visual Studio 2005 Edition when developing applications for the Bentley Map V8i (SELECTseries 1) platform. Also when adding/replacing references to accomodate your local installation, be sure and set the "Copy Local" property to "False".

    The provided VBA user interface is intended for testing purposes. Your VBA application can connect to Oracle Spatial and perform queries w/o ever showing a user interface if you desire.

    Regards,

    Jeff Bielefeld [Bentley]



  • Sorry, the Framework I am using while attempting to compile, is ".Net Framework 4"

    Jiri

  • 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...

    Regards,

    Jiri

  • 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]



    xfm_oracle1.zip