GeoMedia Discussions

Search for an answer, post a question, or answer other users' questions in our GeoMedia support discussions. This discussion board is a great way to collaborate with industry peers around the world. It is intended for discussion and support of the GeoMedia Desktop and Add-on applications.
Showing results for 
Search instead for 
Do you mean 
Reply
Occasional Contributor
Posts: 5
Registered: ‎12-20-2017
Accepted Solution

DGMGeometryStorageService SetGeometry, Invalid geometry object; IGMGeometry is not supported

Hello,

one of our customers has upgraded GeoMedia from version 15.0.0.799 to version 16.6.0.1200. After short tests we came to the conclusion that our software also needs to be updated. This I have done, too, by updating the used dll's from GeoMedia.

Most functions are working to this dll update, however the “DGMGeometryStorageService.SetGeometry” don’t. I’m trying to pass the object of type GField and RasterGeometry to the method SetGeometry.

The first time the data is loaded, "Invalid geometry object; IGMGeometry is not supported”, the following attempts always result in the exception "Value does not fall within the expected range".

I also tried to use GeometryToStorage instead of SetGeomtry, without success.

I assume that the transferred parameters no longer correspond to the GeoMedia Api. Can anyone give me a hint?

My current code looks like this:

// Create Raster Geometry object

                Intergraph.GeoMedia.PRaster.RasterGeometry RasterGeometry;

                RasterGeometry = gm.CreateService("GeoMedia.RasterGeometry") as Intergraph.GeoMedia.PRaster.RasterGeometry;

                RasterGeometry.Filename = m_RasterService.Filename;

                RasterGeometry.DisplayMatrix = ViewMatrix;

                //Create GeometryStorageService

                Intergraph.GeoMedia.PClient.GeometryStorageService RasterGeoStore;

                Intergraph.GeoMedia.PClient.GDatabase Database;

                ClientRecordset = null;

                object dummy = null;

                ConnID = GetWareHouseID(ref conns);

                Database = conns.Item(ConnID).Database as Intergraph.GeoMedia.PClient.GDatabase;

                ClientRecordset = Database.OpenRecordset("Select * from " + "EPSG_" + EPSG.ToString(), 2, dummy, dummy, dummy, "Geometrie");

                ClientRecordset.AddNew();

                RasterGeoStore = gm.CreateService("GeoMedia.GeometryStorageService") as Intergraph.GeoMedia.PClient.GeometryStorageService;

                //object rasterChunk;

                //RasterGeoStore.GeometryToStorage(RasterGeometry, out rasterChunk);

                RasterGeoStore.SetGeometry(ClientRecordset.GFields["GEOMETRIE"], RasterGeometry);

                ClientRecordset.GFields["Beschreibung"].Value = LegName;

                ClientRecordset.Update();

                ClientRecordset.Close();

                string PreLegName = string.Empty;

                LegEntryFound(ref view, conns.Item(ConnID), ref LegName, "EPSG_" + EPSG.ToString());

                ReloadLegendEntries(ref conns, ref ConnID);

                appLogger.AppendDebugLog("Get InsertWMSImage Ende (OK)");

                return true;

 

Technical Evangelist
Posts: 567
Registered: ‎09-11-2015

Re: DGMGeometryStorageService SetGeometry, Invalid geometry object; IGMGeometry is not supported

Hi JanArz,

 

if this used to work in GM 2015 then it looks like a bug. You should create a support ticket in this case.

 

Pavel

Technical Evangelist
Technical Evangelist
Posts: 434
Registered: ‎02-03-2016

Re: DGMGeometryStorageService SetGeometry, Invalid geometry object; IGMGeometry is not supported

When you move from 15.0 software, past 16.0 / 16.1 / 16.2, past 16.5, and then to 16.6, you are jumping many releases and probably 5 calendar years.  We definitely encourage this!  But this normally involves more than just "updating the used dll's" - somewhat rarely there are breaking changes in API, more often there are environmental changes such as use of a newer version of Visual Studio and .net runtime, changes in our delivery structure, and so on.  All such impacts are covered in the GeoMedia Object Reference (available from your Start menu).  Look in the very first section entitled Overview -> Developer Impacts.  That section covers changes that have accumulated since the 16.5 (2018) release.

 

I do not recall any change to GeometryStorageService specifically, that would create such issues.  - Hal

Occasional Contributor
Posts: 16
Registered: ‎02-22-2016

Re: DGMGeometryStorageService SetGeometry, Invalid geometry object; IGMGeometry is not supported

Hi,

 

i don't know if this is helpful. I had some Problems like this too, i changed the way i am creating objects from "createservice" to a simple "new". I'm using vb.net in visual studio 2017.

 

Source Code:

 

'Change Geometry in Recordset
mRs.Edit()
mRs.GFields(sGFieldName) = Geometry2Blob(mGeometry)
mRs.Update

 

'geometry to blob
Function Geometry2Blob(ByVal Geometry As Object) As Object
   Dim vBlob As Object = Nothing
   Dim mGss As New Intergraph.GeoMedia.PClient.GeometryStorageService
   mGss.GeometryToStorage(Geometry, vBlob)
   Return vBlob
End Function

 

... Ingo

 

 

Occasional Contributor
Posts: 5
Registered: ‎12-20-2017

Re: DGMGeometryStorageService SetGeometry, Invalid geometry object; IGMGeometry is not supported

The problem could be solved. "Only" the appropriate environment variables had to be set. In a previous version, these were not necessary. Thanks for the help.

Technical Evangelist
Posts: 567
Registered: ‎09-11-2015

Re: DGMGeometryStorageService SetGeometry, Invalid geometry object; IGMGeometry is not supported

Hi Jan,

 

you are not quite right. The need for some GM folders in the PATH environment variable, (or using the registry AppPath mechanism on production systems) was always there. The location of the folders changed from time to time, but always was there at least since version 4, which is the oldest I remember. And it is well documented in the GeoMedia Object Reference.

 

Please update also the support ticket, so that we can close it.

 

Thanks, Pavel