PostGisWorkspaceFactory Issue

Skip to first unread message


Aug 4, 2010, 9:46:53 AM8/4/10
to zigGIS
Hello again,

I'm having issues using zipGIS to programatically get data from
PostGIS and load it into ArcMap. I've used the following code, look
closely at the comments towards the end as you'll see I've tried
variations that haven't worked.

m_mapControl = (IMapControl3)axMapControl1.Object;


//disable the Save menu (since there is no document yet)
menuSaveDoc.Enabled = false;

IWorkspaceFactory wksf = new PostGisWorkspaceFactory();

//Open the PostGIS Workspace from a from IPropertySet (in
the SDEWorkspaceFactory fashion)
IPropertySet ps = new PropertySetClass();
ps.SetProperty("server", "localhost");
ps.SetProperty("database", "db");
ps.SetProperty("user", "user");
ps.SetProperty("password", "pass");
ps.SetProperty("port", "5432");
//specify the configfile property if you want to log
zigGis actions for debugging
//ps.SetProperty("configfile", @"C:\ziggis\ZigGis
IWorkspace ws = wksf.Open(ps, 0);

//Alternatively you can open the PostGIS Workspace from a
//ws = wksf.OpenFromFile(@"C:\ziggis\ZigGis\example.zig",

//Open the PostGIS feature class
IFeatureWorkspace fwks = ws as IFeatureWorkspace;
IFeatureClass fc =

//Create the new layer (default renderer is
IFeatureLayer layer = new PostGisFeatureLayer();
layer.FeatureClass = fc;
layer.Name = fc.AliasName;

//Add the layer to the Map Control
m_mapControl.AddLayer(layer, 0);
//axMapControl1.AddLayer(layer, 0);

This code is taken from
which is obviously outdated, but I was in the hope it'd work. As for
OpenFeatureClass having that format, if you don't specify exactly four
layers semi-colon separated then it doesn't work at all.

This is the last feature we require in order to determine if we are to
buy a license of zipGIS. I wasn't sure if it was because we don't
have a full license?

Many thanks in advance.

Abe Gillespie

Aug 4, 2010, 11:26:45 AM8/4/10
Yes, Paolo's example is very outdated and probably is not even worth
looking at at this point. You should really have a look at the source
code as I advised before. It shouldn't be too hard to follow and is
the de facto example.


> --
> You received this message because you are subscribed to the Google Groups "zigGIS" group.
> To post to this group, send email to
> To unsubscribe from this group, send email to
> For more options, visit this group at

Kieran Senior

Aug 5, 2010, 3:42:18 AM8/5/10
Hi Abe,

I've checked out the source.  Who and where do I submit bug reports to?

Many thanks.
Kieran Senior
Reply all
Reply to author
0 new messages