Hexagon Geospatial
MENU

Spatial Modeler

Discuss topics with other Hexagon Geospatial Product pioneers and experts to get the most out of our products.
Showing results for 
Search instead for 
Do you mean 
Reply
Contributor
Posts: 65
Registered: ‎09-19-2018

How to use SQL Server features on Spatial Modeler?

[ Edited ]

Hi

 

I am trying to connect my database to Spatial model but I'm not sure if I am doing the right thing.

 

I have the following workflow:

 

Capture.PNG

 

I have two input ports that should be a database feature. For that, when I run the model it will prompt two inputs:

 

untitled.png

 

 

On file dialog I will pick Connect.. and I set my database connection. 

 

untitled.png

 

but after that Spatial modeler raises an error "Object reference not set to an instance of an object."

 

I wonder if I missing something here.. What is the right way to import a feature from database?

 

Thank you

Staff
Posts: 123
Registered: ‎06-30-2016

Re: How to use SQL Server features on Spatial Modeler?

Your credentials may be incorrect. Have you tried displaying the features in the database in the IMAGINE viewer? That is a good test to verify that you have the correct connection credntials.

 

In the Viewer, right click and select "Open Vector layer..."

Once the dialog comes up, select SQL Server Features Proxy, connect to the database and display it. 

 

Regards, Sam

Contributor
Posts: 65
Registered: ‎09-19-2018

Re: How to use SQL Server features on Spatial Modeler?

Hi Sam,

thank you  for your suggestion.

 

I don't have the IMAGINE viewer but I actually can display the features and actually run the model on Geomedia Desktop. So, the credentials are ok. 

I want to be able to run my model on Spatial Modeler 2018 but unfortunately when I use 'SQL Server Features Proxy' the connection doesn't seem to work.

Thank you.

 

 

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

Re: How to use SQL Server features on Spatial Modeler?

Contributor
Posts: 65
Registered: ‎09-19-2018

Re: How to use SQL Server features on Spatial Modeler?

Hi Shaun,

Thank you for your answer.

 

 I believe I installed the "appropriate 'Microsoft SQL Server System CLR Types' software for the SQL Server database version that is being used" but the issue  persists.

 

Although,  I believe the issue regarding to the following message: "Object reference not set to an instance of an object." it could be simpler. think I only need to know how to create a SQL Server Feature proxy file in first place.

 

I wonder how to generate a SQL Server Features Proxy file?  

 

Does this make sense?

Highlighted
Super Contributor
Posts: 359
Registered: ‎10-12-2015

Re: How to use SQL Server features on Spatial Modeler?

>> how to generate a SQL Server Features Proxy file

 

In Spatial Model Editor with model open

  • Click Preview and dialog asking for inputs will open. Click the open folder.
    1-OpenFolder.png
  • Change 'Files of type:' to 'SQL Server Features Proxy (*.sfp) and click the 'Connect...' button
    2-ConnectDialog.png
  • In Connection Manger, Click Add button next to Database Connections
    • Populate SQL Server connection parameters
      3-DbConnection.png
      Or if db connection already exists click the row selector for the connection and click open.

    • A green tick should appear next to the connection.
      Initially the bottom of the Dialog under 'Feature Tables' will be empty.
      Click the row selector for the database connection.
      4-ConnectionMade.png
    • Depending on the content of your DB, it will take a while for the Features Tables to be populated.
      Once populated scroll down and locate feature of interest, click the row selector and click ok
      5-selectFeature.png
    • Click OK in next dialog.
      Should default the name of the .sfp file to that of the selected feature.
    • Continue with selecting remaining inputs

 

Contributor
Posts: 65
Registered: ‎09-19-2018

Re: How to use SQL Server features on Spatial Modeler?

Yes Shaun,

 

That's right.

but when I get to the stage of selecting the connection by clicking on the first cell on left as you indicate on picture I will get an error.

4-ConnectionMade.png

 

 

As you can see on my example below:

 

ConnectionManager.png

 

After I select the connection I will get the following error:

 

 

Capture.PNG

 

 

Cheers,

 

 

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

Re: How to use SQL Server features on Spatial Modeler?

Does it work on any other machines with GeoMedia 2018 Professional installed?

Contributor
Posts: 65
Registered: ‎09-19-2018

Re: How to use SQL Server features on Spatial Modeler?

I have tried on another machine but unfortunately, it didn't work as well.

 

This doesn't work. It's a bit annoying as I only can run my spatial modeller on geomedia desktop and I'm not able to debug my work process on Spatial modeller.

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

Re: How to use SQL Server features on Spatial Modeler?

I replicated the issue using the dataset you previously provided and logged a support ticket.

We were unable to find out what there was about the SQL Server database that leads to the problem, the ticket will be reviewed in due course.

I have not tried, but only other suggestion is to export to a fresh database. Whether that helped would depend on whether it is GeoMedia metadata content causing problems or data content causing problems.

Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.