06-07-2016 05:24 AM
I need to create new feature from outside GMSC using MSSQL statement... the Geometry_SPA column is ok... the problem is at Geometry column with type VARBINARY(MAX)
I have created it using: CAST(Geometry_SPA AS VARBINARY(MAX)) but the point feature is not displayed at GMSC.
i have compared my generated value with the GMSC genertaed values... i got the following: my generated hex value have length = 62 .. but the values which are generated from Geomedia have length = 130
Solved! Go to Solution.
06-07-2016 05:32 AM
You cannot cast Geometry_SPA to varbinary(MAX) type. GeoMedia uses two related fields to store geometries. Geometry_SPA is regular geometry field, it holds the values in WKB format and can be accessed or inserted from variety of tools using WKT format. Geometry is varbinary(MAX) type and holds the geometries as INGR BLOB format. This is a binary format, it is documented, however, it is quite complex task to insert such values outside GeoMedia or GeoMedia Objects environment. On the other hand, my guess is that SmartClient does not require these fields to be populated except the geometry type is text or ratser iamge geometry. In this case, you should use GeoMedia to insert correct values.
06-07-2016 02:16 PM
You can use CAST(NULL AS VARBINARY(MAX)) as Geometry.
GMSC will then get the content from the Geometry_SPA field quite happily.
06-08-2016 03:47 PM
I have tried CAST(NULL AS VARBINARY(MAX)) as Geometry... it is displayed correctly at GMSC... but Geometry field still Null (Not filled from GMSC)
06-08-2016 04:13 PM
You populated the Geometry_SPA field outside GMSC.
GMSC would only populate the Geometry (varbinary(max) gdo column if GMSC did the edit - and then only if the geometry couldn't be fully represented by the Geometry_SPA field. If the Geometry_SPA can fully represent the geometry, then the GDO (Geometry) column is left null.
Have a look at documentation topic 'Using SQL Server Spatial Connections>Data Storage and Type Matching>Geometry Storage and GeoMedia’s Binary Geometry to Native Geometry Type Matching'
for a description of how GMSC and Geomedia handle the GDO field. Summary: If the geometry can be 100% represented by the SPA column then the GDO column is left null. If the SPA is edited outside GMSC and GeoMedia then the GDO will be left null.
10-14-2016 05:46 PM
Hi Pavel, I have access to GeoMedia Objects, GMSC JAVA API & GMSC .NET API
My geometries are stored in GeometryCollection, is there a way to replcate TextPointGeometry stored with new TextPointGeometry
I need to edit the text stored in TextPointGeometry and that is readonly property so I am thinking to create new TextPointGeometry and replace
10-14-2016 06:04 PM
As an alternative, could you restructure the data model so the TextPointGeometry is instead represented by a standard point geometry plus a db field representing the text and perhaps another db field representing the point orientation (if required)?
10-14-2016 08:20 PM
Thank you Shaun, yes that is fallback plan, however I am not keen on it as there are multiple distinct features each feature collection has multiple Compound Geometry each with another compound TextGeometry. Thus I am thinking rather than separate all geometries; we already have GeometryCollection and GMSC does great job in displaying them, so all I require to know is same way to reconstruct that, except this time push it in with changed text value.
Any example on changing the text of GDO TextGeometry either on sql level, JAVA API or .NET API will be great help
If we cannot change the text then I can Create new TextGeometry and that’s fine but then the problem is how do I remove the old object from GeometryCollection and add the newly created TextGeometry?