Tag Info

New answers tagged

0

Check your arguments. There's not enough in your call. Is that supposed to be a comma between "TableFieldName" and featureclass, and "TableName" and the cardinality? That will give you 8 arguments. memRelFact.Open("Table-Layer", (IObjectClass)fromTable, "TableFieldName" , featureClass, "FeatureClassFieldName", "FeatureClassName", "TableName" ...


2

It's hard to tell from your code sample what you're up to. What you're searching for is the enum esriFieldType which can be tested against each field to determine its type: MyComboBox.items.clear(); // empty first IFeatureLayer pFtLayer = (IFeatureLayer)gMap.get_Layer(0); IFeatureClass pFtClass = pFtLayer.FeatureClass; for (int Cnt = 0; Cnt < ...


0

The doc's say that TrackCircle does trigger OnMouseMove. Why not just track that and display the current radius where ever you want.


1

Source of problem found. It turns out the GEOTIFF_CSV environmental variable was not set. In c#, the following code: OSGeo.GDAL.Gdal.SetConfigOption("GEOTIFF_CSV", Path.GetDirectoryName(Application.ExecutablePath) + @"\gdal-data"); makes a very big difference. Now the geoTransform contains the actual lat/long.


1

There is a better way to iterate through layers, look at Map.Layers(UID,True) as IEnumLayers... this limits your layer types (IFeatureLayer, IRasterLayer..) and looks in your group layers. UID pUID = new UIDClass(); pUID.Value = "{40A9E885-5533-11d0-98BE-00805F7CED21}"; // IFeatureLayers IEnumLayer pMapLayers = ArcMap.Document.FocusMap.get_Layers(pUID, ...


1

Based on this Very old help you want to use your IStandaloneTableCollection IStandaloneTableCollection pColl = ArcMap.Document.FocusMap as IStandaloneTableCollection; IStandaloneTable pThisTable = pColl.StandaloneTable[0]; // the first table pColl.RemoveStandaloneTable(pThisTable); ArcMap.Document.UpdateContents(); //update ...


1

With a little modification, I got this to work. Thank you very much for your help. This is important to note that this is for feature layers only, not tables. IMap map; IMxDocument mxDocument; mxDocument = (IMxDocument)ArcMap.Application.Document; map = mxDocument.FocusMap; mxDocument.ActiveView.Refresh(); ...


2

I use this code and it works......... private void OUT(string line) { IMap Map; IMxDocument mxDocument; IApplication App = ArcMap.Application; mxDocument = (IMxDocument)(App.Document); Map = mxDocument.FocusMap; var pDelLayerLine = (IFeatureLayer)Map.get_Layer(0); ...


0

Here's something I put together to show how to create a shapefile (just the basics) and iterate through a feature class writing to an output as you go: void NewShapefile(string FullName, ISpatialReference SR, ILayer FromLayer ) { System.IO.FileInfo pFInfo = new System.IO.FileInfo(FullName); IWorkspaceFactory pWSfact = new ...


1

Andrew, I think you're thinking wrong and it may get you into trouble. You need to stop thinking in terms of your dataset and start thinking in terms of GDAL and GIS. Your dataset data is in some projection, in this case State Plane. That means you use state plane (ft here) coordinates to access the data. The transform (GetGeoTransform) converts between ...


0

So I found this video, which has done just what I wanted to do. https://msdn.microsoft.com/en-gb/data/hh859721.aspx Hope it helps someone else. Thanks


0

You should call Marshal.ReleaseComObject in the finally block before releasing of the cursor if you wan't to recover memory faster, because GC is lazy about RCWs releasing (they have finalizers). If you use recycling cursor to iterate over more than one feature, don't release feature because this will throw InvalidComObjectException first time you access ...


0

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 ...


0

You can easily solve this with something like (Javascript code) var dataRows = [{ id: 1, geom: "LINESTRING(-1.131510412 52.65531, -1.13286 52.65559)" }]; features = []; dataRows.forEach(function (row) { var coords = row.geom.replace("(", "[").replace(")", "]").substring(row.geom.indexOf("("), row.geom.length); ...


0

You need to set your application variable to reference the application. In old school ArcObjects this done through the hook provided by your control that implements ICommand or ITool etc. public override void OnCreate(object hook) { _application = hook as IApplication; //get the editor environment UID editorUid = new UID(); ...


0

Found the answer . . . https://geonet.esri.com/thread/80929 Basically, there is a bug in the REST template.


2

For C# NetTopologySuite is a great option. It's one of the children of the JavaTopologySuite, father of GEOS, Shapely, JSTS, ffi-geos... and maybe Thorin too. I haven't tested on a real SQL Server database, but you could use it like this: MsSql2008GeometryReader geometryReader = new MsSql2008GeometryReader(); MsSql2008GeometryWriter geometryWriter = new ...


0

Using loop to access each graphic in the graphic collection, the code should look like this: foreach(graphic p in graphiclayer.graphics) { p.Attribute.add ('Status','confirmed'); }


0

I believe I have done something similar using layer groups and the visibility option. I added multiple layer groups to an object and then used the visible option to hide and show the different layers. You can probably do the same thing not using groups as well if you don't want to. I'll try to provide a small example illustrating what I mean. var layers = ...


0

for checking if polygon contain a point it's better to use Contain method instead Within method. Dim aRing As IPointCollection = New RingClass() aRing.AddPoint(new Point() With {.X=412853 ,.Y = 3785339}) aRing.AddPoint(new Point() With {.X=412990 ,.Y = 3785276}) aRing.AddPoint(new Point() With {.X=412926 ,.Y = 3784889}) aRing.AddPoint(new Point() With ...


0

A custom tool using IDisplayFeedback Interface might help you for panning and zooming while editing your feature. Code sample: ArcGIS snippet for Panning and Zooming while editing using C#



Top 50 recent answers are included