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 
Frequent Contributor
Posts: 159
Registered: ‎01-14-2018

EquijoinPipe output Geometry is missing

[ Edited ]

Hello all,


I have joined 2 text files using "EquijoinPipe" and displayed it on the map window but when I try to export it to "File Geodatabase", the output geometry type is dimmed which should be line,


input coordinate system.png



Although I made the same join for the same files in the GUI and it worked successfully.


Also I tried to make the export through the export to OutputToTableService and it gives an error of "Input Recordset's coordinate system is missing", although I reviewed that I gave the connection a coordinate system.


and Here is my code:


PClient.Connections pClientConnections = this._document.Connections as PClient.Connections;
PClient.Connection pClientConnectionLIN = _currentApplication.CreateService("GeoMedia.Connection") as PClient.Connection;
PClient.Connection pClientConnectionLI2 = _currentApplication.CreateService("GeoMedia.Connection") as PClient.Connection;

        pClientConnectionLIN.Type = "TextFile.GDatabase";
        pClientConnectionLIN.Name = "Text File Connection LIN";
        pClientConnectionLIN.Location = @"C:\Users\A\Desktop\SDRFiles\AG617394d26.LIN";
        pClientConnectionLIN.ConnectInfo =       @"DATA=C:\Users\A\Desktop\SDRFiles\AG617394d26.LIN;FORMAT=C:\Users\A\Desktop\SDRFiles\GM Project Config\TFD LIN.tfd;CSF=C:\Users\A\Desktop\SDRFiles\EgyptRedBelt.csf";
        pClientConnectionLIN.Mode = 0;
        pClientConnectionLIN.CoordSystemsMgr = coordSystemsMgr;        

        pClientConnectionLI2.Type = "TextFile.GDatabase";
        pClientConnectionLI2.Name = "Text File Connection LI2";
        pClientConnectionLI2.Location = @"C:\Users\A\Desktop\SDRFiles\AG617394d26.LI2";
        pClientConnectionLI2.ConnectInfo =          @"DATA=C:\Users\A\Desktop\SDRFiles\AG617394d26.LI2;FORMAT=C:\Users\A\Desktop\SDRFiles\GM Project Config\TFD LI2.tfd;CSF=C:\Users\A\Desktop\SDRFiles\EgyptRedBelt.csf";
        pClientConnectionLI2.Mode = 0;
        pClientConnectionLI2.CoordSystemsMgr = coordSystemsMgr;


// LIN & LI2 OriginatingPipes
PClient.OriginatingPipe _LIN_origPipe = null;
PClient.OriginatingPipe _LI2_origPipe = null;

pClientConnectionLIN.CreateOriginatingPipe(out _LIN_origPipe);
_LIN_origPipe.Table = "AG617394d26";

pClientConnectionLI2.CreateOriginatingPipe(out _LI2_origPipe);
_LI2_origPipe.Table = "AG617394d26";

// LIN and LI2 GRecordset
PClient.GRecordset _LIN_GRecordset;
PClient.GRecordset _LI2_GRecordset;

_LIN_GRecordset = _LIN_origPipe.OutputRecordset;

_LI2_GRecordset = _LI2_origPipe.OutputRecordset;

// Lines EquijoinPipe
PDBPipe.EquijoinPipe _Lines_equijoinPipe =
            _currentApplication.CreateService("GeoMedia.EquijoinPipe") as PDBPipe.EquijoinPipe;

string[,] LinesArray = new string[2, 1];
LinesArray[0, 0] = "Line";
LinesArray[1, 0] = "Line";

_Lines_equijoinPipe.LeftRecordset = _LIN_GRecordset as PDBPipe.GRecordset;
_Lines_equijoinPipe.RightRecordset = _LI2_GRecordset as PDBPipe.GRecordset;
_Lines_equijoinPipe.JoinFieldNames = LinesArray;
_Lines_equijoinPipe.JoinType = 2;       
PClient.GRecordset _Lines_Joined_GRecordset = (PClient.GRecordset)_Lines_equijoinPipe.OutputRecordset;

//Query for Lines (myQuery_Lines)
PDBPipe.Query myQuery_Lines;
myQuery_Lines = _Lines_Joined_GRecordset.GetExtension("Name") as PDBPipe.Query;
myQuery_Lines.Name = "Join of LIN and LI2";

PDBPipe.QueryFolder qF = (PDBPipe.QueryFolder)_document.QueryFolder;
        qF = qF.QuerySubFolders["Queries"];




Your help is appreciated,


Kind Regards, Smiley Happy


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

Re: EquijoinPipe output Geometry is missing

Hi Khaled,


in order your pipe is compatible with GeoMedia framework, you should do two more things:

  1. Add also the Query objects corresponding to the two OriginatingPipes to the "Features" query folder.
  2. Create CSSTransformPipe and insert it between each originating pipe and the EquiJoinPipe. GeoMedia requires this, even if the source and target coordinate system is the same.


Frequent Contributor
Posts: 159
Registered: ‎01-14-2018

Re: EquijoinPipe output Geometry is missing

[ Edited ]

Hi Pavel,


I added the Features Query folder as follows:


PDBPipe.Query QuerLIN = _LIN_origPipe.OutputRecordset.GetExtension("Name") as PDBPipe.Query;
QuerLIN.Name = pClientConnectionLIN.Name + " " + _LIN_origPipe.Table;
PDBPipe.Query QuerLI2 = _LI2_origPipe.OutputRecordset.GetExtension("Name") as PDBPipe.Query; QuerLI2.Name = pClientConnectionLI2.Name + " " + _LI2_origPipe.Table; PDBPipe.QueryFolder Feauresqufo = (PDBPipe.QueryFolder)_document.QueryFolder; Feauresqufo = Feauresqufo.QuerySubFolders["Features"]; Feauresqufo.Queries.Append(QuerLIN);

Is it the right way?



I made also the CSSTransformPipe  as follows:

PDBPipe.CSSTransformPipe csstpLIN = new PDBPipe.CSSTransformPipe();
csstpLIN.InputRecordset = _LIN_origPipe.OutputRecordset as PDBPipe.GRecordset;
csstpLIN.CoordSystemsMgr = coordSystemsMgr;
csstpLIN.OutputCSGUID = coordSystemsMgr.CoordSystem.GUID;
csstpLIN.InputGeometryFieldName = "Geometry";


The second question about the CSSTransformPipe  I made but, one of my files that I want to join is not a graphical (have no geometry) so I can't make a CSSTransformPipe for it, so I used its originatingpipe.OutputRecordset as RightRecordset for the equijoinpipe.

_Lines_equijoinPipe.LeftRecordset = csstpLIN.OutputRecordset;
_Lines_equijoinPipe.RightRecordset = _LI2_GRecordset as PDBPipe.GRecordset;


The problem is that the output geometry type is still dimmed, 

Do I made the above steps in the right way?


Or should I use aggregation pipe instead of equijoinpipe?





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

Re: EquijoinPipe output Geometry is missing

Hi Khaled,


everything seems to be perfect, except the name for the queries. You've got it right that it should be composed from the connection name and the table name, but they should be separated by tabulator, not by space. So please try to replace + " " + by + "\t" + and hopefully it will start working.