Hexagon Geospatial
MENU

Developer Discussions

Discuss topics with other Hexagon Geospatial Power Portfolio developers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Frequent Contributor
Posts: 143
Registered: ‎04-29-2016
Accepted Solution

Create new feature from outside GMSC - Problem at Geometry VARBINARY(MAX) MSSQL

Hello,

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

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

Re: Create new feature from outside GMSC - Problem at Geometry VARBINARY(MAX) MSSQL

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.

 

Pavel

Frequent Contributor
Posts: 143
Registered: ‎04-29-2016

Re: Create new feature from outside GMSC - Problem at Geometry VARBINARY(MAX) MSSQL

Thank you... May you please send me any documentation about  INGR BLOB format

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

Re: Create new feature from outside GMSC - Problem at Geometry VARBINARY(MAX) MSSQL

I have sent you the document by e-mail.

 

Pavel

Super Contributor
Posts: 334
Registered: ‎10-12-2015

Re: Create new feature from outside GMSC - Problem at Geometry VARBINARY(MAX) MSSQL

You can use CAST(NULL AS VARBINARY(MAX)) as Geometry.

GMSC will then get the content from the Geometry_SPA field quite happily.

Highlighted
Frequent Contributor
Posts: 143
Registered: ‎04-29-2016

Re: Create new feature from outside GMSC - Problem at Geometry VARBINARY(MAX) MSSQL

Thank you,

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)

Super Contributor
Posts: 334
Registered: ‎10-12-2015

Re: Create new feature from outside GMSC - Problem at Geometry VARBINARY(MAX) MSSQL

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'

https://hexagongeospatial.fluidtopics.net/book#!book;uri=d697ac1e302b4bce1d79722e4e4261b0;breadcrumb...

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.

Occasional Contributor
Posts: 9
Registered: ‎06-22-2016

Re: Create new feature from outside GMSC - Problem at Geometry VARBINARY(MAX) MSSQL

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

 

Thanking you,

Nrupesh

Super Contributor
Posts: 334
Registered: ‎10-12-2015

Re: Create new feature from outside GMSC - Problem at Geometry VARBINARY(MAX) MSSQL

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)?

  • GMSC can then display the text using the point geometry with an library style having ABS applied to display the db text field as text label and orientated according to the db orientation field.
  • GeoMedia can do the same
  • From outside GMSC / GeoMedia you can directly edit the text field, orientation field and geometry.
    Would no longer need to edit the GDO field as it would no longer have content.
    Editing process in GeoMedia would change.
Occasional Contributor
Posts: 9
Registered: ‎06-22-2016

Re: Create new feature from outside GMSC - Problem at Geometry VARBINARY(MAX) MSSQL

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?

Polls
Please register to vote
Do you need immediate support?
Please submit a Ticket through our
Development Ticket Portal.