0

I am trying to display data in ArcGIS Runtime Engine Developer kit 10.2.2 using OGRPlugin/OGRPlugin/ develop by Ragi Yaser Burhum on https://github.com/RBURHUM/arcgis-ogr . I am using this format but I am unable to get any result. Can anyone be of help please.

        // Open workspace and feature class.


        IWorkspaceFactory wksf = new PostGisWorkspaceFactory();

        IPropertySet ps = new PropertySetClass();
        ps.SetProperty("server", "localhost");

        ps.SetProperty("database", "spatial");
        ps.SetProperty("user", "postgres");
        ps.SetProperty("password", "michael");
        ps.SetProperty("port", "5432");



        IFeatureClass fc = fwks.OpenFeatureClass("parcel");
        // Create the new layer (default renderer is ISimpleRenderer)
        IFeatureLayer layer = new PostGisFeatureLayer();
        layer.FeatureClass = fc;
        layer.Name = fc.AliasName;
        ILayer ly = layer as ILayer;
        IGeoFeatureLayer gfl = layer as IGeoFeatureLayer;
        //doSimpleRenderer(gfl);
        doUniqueValueRenderer(gfl);
        //IFeatureRenderer fr = new VerySimpleCustomRenderer();
        //gfl.Renderer = fr;
        axMapControl1.AddLayer(gfl as ILayer, 0);
1

I haven't used ArcGIS SDKs, but for troubleshooting these kinds of issues, it's helps to enable logging on your database

ALTER DATABASE spatial
  SET log_statement = 'all';

Then run your code and look at the latest log file which is usually in a folder called pg_log in the folder where your PostgreSQL data cluster is. This will confirm that your server is being hit and may highlight errors that are not being emitted by your app. I also like to run the sql statements being sent to confirm they return data. Your issue might be as simple as your SRID of your data is wrong and doesn't align with your map or can't be reprojected to your map spatial reference system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.