New answers tagged

0

The actual remote path was like: private const String NetworkShapeFilePath = @"\\NetworkServer\FakePath\_vectordata.shp" and I had it written like: private const String NetworkShapeFilePath = @"\\NetworkServer\FakePath\vector_data.shp"


0

Point on point isn't going to work, even if the coordinates are exact match, it's a 50/50 whether the feature class point will be selected by the query point. To overcome this I always buffer the point by a very small amount - this depends on your spatial reference, 1 metre (or foot) usually isn't very much but 1 degree usually is a very large number, you'll ...


0

This is a good case for a global variable: namespace lecture5test { public class Button1 : ESRI.ArcGIS.Desktop.AddIns.Button { private int ClickCount = 0; // global to keep track of clicks public Button1() { then in your OnClick event: protected override void OnClick() { ClickCount ++; // go to next click colour ...


0

I couldn't find a library, but I coded up a solution that fit my requirements to handle polygons only. The code is provided below for anyone else who might find it useful. ConvertGeoJsonToKml generates complete KML and ConvertGeoJsonToKmlGeometryOnly generates a cut down KML output suitable for use in Google Fusion Tables. using ArcGIS.ServiceModel.Common; ...


3

GDAL has methods for that. From http://www.gdal.org/classOGRSpatialReference.html: "contains methods for converting between this object organization and well known text (WKT) format". ExportToWkt is probably what you need "Convert this SRS into WKT format. Note that the returned WKT string should be freed with OGRFree() or CPLFree() when no longer ...


1

Have you tried: projected coordinate systems: https://developers.arcgis.com/javascript/jshelp/pcs.html geographic coordinate systems: https://developers.arcgis.com/javascript/jshelp/gcs.html


5

I usually look at http://epsg.io or http://spatialreference.org for all my WKT needs.


1

Red -> Blue -> Green -> Red etc. Just wrap your pPage.BackgroundColor = in if/else if/else something like if (pPage.BackgroundColor.RGB == ic.RGB) { pPage.BackgroundColor = ib; } else if (pPage.BackgroundColor.RGB == ib.RGB) { pPage.BackgroundColor = ig; } else { pPage.BackgroundColor = ic; }


0

An extension to Nmktronas' answer: At least with Shapefiles, features hold a lock on the feature class they're from, so it is necessary to release them in order to e.g. delete the workspace (at least using System.IO.Directory.Delete for a Shapefile folder). This is true even with a recycling cursor that has been fully iterated - the recycled feature must be ...


1

If you download the GDAL source, you'll have the source for gdal_translate.cpp. Just peruse the code and duplicate it in C#. The translation is straight-forward.


1

I ended with the same result months before and I could not found a solution using IPrintAndExport. I would recommend to use theIExportdirectly. Please have a look at the following ExportActiveView function in this example in VBA or this post to a different topic with an example in C#. This works without problems in my case. You can simply exchange the ...


0

Alright I figured out what the problem was. For some reason the ServiceFeatureTable that is returned from the OpenAsync method doesn't have the OutFields defined and we must explicitly add each attribute to the list in order for the data to sync to the server. This code snippet shows how this can be done: var gpsLocFeatureTable = await ...


1

I found a solution, which works for me: var layer = Map.Layers[MyLayer] as GraphicsLayer; var selectedId = await layer.HitTestAsync(mapView, eventargs.Position); selectedId.IsSelected = true; //Nothing found sets selectedId = null var unitsFound = layer.SelectedGraphics.ToList(); This gives a list of all units found at the point you clicked. But it only ...


3

As I recall, you need to listen to IDocumentEvents. When OpenDocument fires cast the IMxDocument to IDocumentDatasets. For each IDatasetLayer2 in IDocumentDatasets.Datasets: Cast IDatasetLayer2.DataSourceName to IDataSetName. Get (by value) IDatasetName.WorkspaceName. Get (by value) the propertyset from IWorkspaceName.ConnectionProperties. Change ...



Top 50 recent answers are included