Spatial Modeler Discussions

Gain, exchange, and share knowledge, or discuss topics with other Hexagon Geospatial Product pioneers and experts to get the most out of Hexagon Geospatial products.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
Frequent Contributor
Posts: 105
Registered: ‎01-20-2016
Accepted Solution

Join polygon features and tables

Hi all,

 

I have a polygon shapefile and an excel table.

The polygon shape should save all attributes from the excel table.

Both files do have a column with identical values to be able to connect them.

 

Is there a way to join this kind of data in Spatial Modeler?

 

Any help appreciated,

Ruth

Highlighted
Staff
Posts: 164
Registered: ‎06-30-2016

Re: Join polygon features and tables

[ Edited ]

Yes it is possible.

 

First save the excel table as a comma delimited csv file. The csv file can be read as a feature data using the features input operator.

 

Then use the Join features operator to join the shapefile and the csv file into one feature stream.

Look at the attached model screenshot.

 

Regards, Sam

 

Highlighted
Frequent Contributor
Posts: 105
Registered: ‎01-20-2016

Re: Join polygon features and tables

Hi Sam,

 

if I follow your workflow, I get the error "Read fewer bytes than expected".

I do not have any coordinates in my csv-file, this might be the problem.

 

28/03/19 16:18:26 SessionMgr(15176): ERROR: #1197 from SetupLegend()
28/03/19 16:18:26 SessionMgr(15176): ERROR: evec_SymbologyAntInfoCreate failed
28/03/19 16:18:26 SessionMgr(15176): ERROR: #6 from evec_SymbologyAntInfoCreate
28/03/19 16:18:26 SessionMgr(15176): ERROR: Error returned from eant_GetFakeEevgDrawing
28/03/19 16:18:26 SessionMgr(15176): ERROR: #3 from eant_GetFakeEevgDrawing
28/03/19 16:18:26 SessionMgr(15176): ERROR: Error returned from eant_CreateFakeEevgDrawingFromBoundingBox
28/03/19 16:18:26 SessionMgr(15176): ERROR: #6 from eant_CreateFakeEevgDrawingFromBoundingBox
28/03/19 16:18:26 SessionMgr(15176): ERROR: Error returned from eevg_DrawingInit
28/03/19 16:18:26 SessionMgr(15176): ERROR: #10 from eevg_DrawingInit
28/03/19 16:18:26 SessionMgr(15176): ERROR: Error setting world for drawing
28/03/19 16:18:26 SessionMgr(15176): ERROR: #1 from eevg_World
28/03/19 16:18:26 SessionMgr(15176): ERROR: Invalid World Coordinate System
28/03/19 16:19:59 SessionMgr(15176): erdas::sb_CGP::FeaturesOutput:Smiley SurprisednExecute failed
28/03/19 16:19:59 Read fewer bytes than expected.
28/03/19 16:19:59 SessionMgr(15176): Operator execution failed.

 

Highlighted
Staff
Posts: 164
Registered: ‎06-30-2016

Re: Join polygon features and tables

No, you dont need coordinates in the CSV file. Can you share the data?

Highlighted
Frequent Contributor
Posts: 105
Registered: ‎01-20-2016

Re: Join polygon features and tables

Hi Sam,

here is a subset of my data.

 

Thank you

Highlighted
Staff
Posts: 164
Registered: ‎06-30-2016

Re: Join polygon features and tables

Hi Ruth, 

 

You only sent me the .shp file for the shapefile. I also need the other associated files (*.shx, *.dbf, *.prj)

 

Regards, Sam

Highlighted
Frequent Contributor
Posts: 105
Registered: ‎01-20-2016

Re: Join polygon features and tables

Highlighted
Staff
Posts: 164
Registered: ‎06-30-2016

Re: Join polygon features and tables

Please send me the original Excel file also. 

 

Thansk, Sam

Highlighted
Frequent Contributor
Posts: 105
Registered: ‎01-20-2016

Re: Join polygon features and tables

Highlighted
Staff
Posts: 164
Registered: ‎06-30-2016

Re: Join polygon features and tables

Which field is the key field in the Excel and shapefile that will be used to do the join operation?