POST
|
Does Survey123 have a note/comment icon associated with a survey? Can a user comment/write notes on a particular items in the survey and have it stored in a single note/comment field that is related by that item in the survey? I am asking this because I don’t want to create a note/text field every time a selected item needs some additional notes. I am hoping that Survey123 has a single field that stores notes and relates it back by an item id or something. Similar to the way domains are/were stored in a enterprise database (Single Field Multiple Domains).
... View more
09-16-2017
10:18 AM
|
0
|
1
|
625
|
POST
|
public static double Calc(double Lat1, double Long1, double Lat2, double Long2) { /* The Haversine formula according to Dr. Math. http://mathforum.org/library/drmath/view/51879.html dlon = lon2 - lon1 dlat = lat2 - lat1 a = (sin(dlat/2))^2 + cos(lat1) * cos(lat2) * (sin(dlon/2))^2 c = 2 * atan2(sqrt(a), sqrt(1-a)) d = R * c Where * dlon is the change in longitude * dlat is the change in latitude * c is the great circle distance in Radians. * R is the radius of a spherical Earth. * The locations of the two points in spherical coordinates (longitude and latitude) are lon1,lat1 and lon2, lat2. */ double dDistance = Double.MinValue; double dLat1InRad = Lat1 * (Math.PI / 180.0); double dLong1InRad = Long1 * (Math.PI / 180.0); double dLat2InRad = Lat2 * (Math.PI / 180.0); double dLong2InRad = Long2 * (Math.PI / 180.0); double dLongitude = dLong2InRad - dLong1InRad; double dLatitude = dLat2InRad - dLat1InRad; // Intermediate result a. double a = Math.Pow(Math.Sin(dLatitude / 2.0), 2.0) + Math.Cos(dLat1InRad) * Math.Cos(dLat2InRad) * Math.Pow(Math.Sin(dLongitude / 2.0), 2.0); // Intermediate result c (great circle distance in Radians). double c = 2.0 * Math.Asin(Math.Sqrt(a)); // Distance. // const Double kEarthRadiusMiles = 3956.0; const Double kEarthRadiusKms = 6376.5; dDistance = kEarthRadiusKms * c; return dDistance; }
... View more
04-23-2013
02:55 PM
|
0
|
0
|
1081
|
POST
|
Is there an easy way to generate contours from a DEM based on the screen extent rather than DEM extent? Do I need to clip the DEM first or is there a faster method? http://resources.esri.com/help/9.3/arcgisdesktop/com/gp_toolref/spatial_analyst_tools/contour.htm http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//0024000000n300000
... View more
09-14-2012
10:53 AM
|
0
|
0
|
455
|
POST
|
What about setting the definition query of the initial layer using the feature???s ID and feeding that layer into the clip tool?
... View more
06-21-2012
11:51 AM
|
0
|
0
|
174
|
POST
|
Neil Thank you for the code sample, the ESRI C# code wasn't very helpful (http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//0014000001tt000000). I include my C# code. class GxFilterPersonalGDB : IGxObjectFilter { IGxObjectFilter basicFilter; IGxObjectFilter geoFilter; public GxFilterPersonalGDB() { //For Displaying Basic Types basicFilter = new GxFilterBasicTypes(); //For Displaying Personal Geodatabases geoFilter = new GxFilterPersonalGeodatabases(); } public bool CanChooseObject(IGxObject gxObject,ref esriDoubleClickResult result) { try { if (!(geoFilter.CanDisplayObject(gxObject))) { return false; } IGxDatabase2 gxDatabase = gxObject as IGxDatabase2; return gxDatabase.Workspace.PathName.EndsWith(".mdb", StringComparison.CurrentCultureIgnoreCase); } catch { return false; } } public bool CanSaveObject(IGxObject gxObject, string newObjectName, ref bool objectAlreadyExists) { try { if (!(geoFilter.CanDisplayObject(gxObject))) { return false; } IGxDatabase2 gxDatabase = gxObject as IGxDatabase2; return gxDatabase.Workspace.PathName.EndsWith(".mdb", StringComparison.CurrentCultureIgnoreCase); } catch { return false; } } public bool CanDisplayObject(IGxObject gxObject) { try { //Display Basic Types if (basicFilter.CanDisplayObject(gxObject)) { return true; } else if (!(geoFilter.CanDisplayObject(gxObject))) { return false; } //Filter out File Geodatabases IGxDatabase2 gxDatabase = gxObject as IGxDatabase2; return gxDatabase.Workspace.PathName.EndsWith(".mdb", StringComparison.CurrentCultureIgnoreCase); } catch { return false; } } public string Name { get { return "Personal Geodatabase"; } } public string Description { get { return "Personal Geodatabase"; } } }
... View more
06-21-2012
07:48 AM
|
0
|
0
|
490
|
POST
|
Dim pMxDoc As IMxDocument Dim pFLayer As IFeatureLayer Dim pData As IDataStatistics Dim pCursor As ICursor Try pMxDoc = My.ArcMap.Document pFLayer = pMxDoc.FocusMap.Layer(0) 'change the index according to the layer of interest pCursor = pFLayer.Search(Nothing, False) 'Create the new table that the selected records will populate. pData = New DataStatistics pData.Field = "typeAndNum" 'change to match FC attribute with multiple records pData.Cursor = pCursor 'this is the same cursor created above Dim pEnumVar As IEnumerator pEnumVar = CType(pData.UniqueValues, IEnumerator) pEnumVar.Reset() pEnumVar.MoveNext() Dim pFeatureSelection As IFeatureSelection pFeatureSelection = pFLayer 'QI Dim pActiveView As IActiveView pActiveView = pMxDoc.ActiveView Dim d As DateTime Do Until IsNothing(pEnumVar.Current) Dim pQF As IQueryFilter pQF = New QueryFilter pQF.WhereClause = "typeAndNum = '" & pEnumVar.Current & "'" 'change to match FC attribute with multiple records Dim pFc As ICursor Dim pTable As ITable pTable = pFLayer pFc = pTable.Search(pQF, False) Dim pDataStats1 As IDataStatistics pDataStats1 = New DataStatistics pDataStats1.Field = "dt_stamp" 'FC attribute you want the most recent value of pDataStats1.Cursor = pFc Dim pDataStatResults1 As IStatisticsResults pDataStatResults1 = pDataStats1.Statistics 'Create the query filter Dim pQueryFilter As IQueryFilter pQueryFilter = New QueryFilter pQueryFilter.WhereClause = "typeAndNum = '" & pEnumVar.Current & "' AND dt_stamp = date '" & Date.FromOADate(pDataStatResults1.Maximum).Date & "'" pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, Nothing, Nothing) 'Flag original selection pFeatureSelection.SelectFeatures(pQueryFilter, esriSelectionResultEnum.esriSelectionResultAdd, False) 'Perform the selection pActiveView.PartialRefresh(esriViewDrawPhase.esriViewGeoSelection, Nothing, Nothing) 'Flag the new selection pEnumVar.MoveNext() Loop Catch End Try
... View more
04-10-2012
10:34 AM
|
0
|
0
|
489
|
POST
|
Try IsNothing http://msdn.microsoft.com/en-us/library/kaf4ssya(vs.71).aspx
... View more
04-09-2012
12:04 PM
|
0
|
0
|
489
|
POST
|
I write my messages to stdout in python and read those within the application. Doesn't answer your question but another approach. http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Writing_messages_in_script_tools Python sys.stdout.write("false"") or print "false" sys.stdout.write(arcpy.GetMessages()) In My C# Program string result; Process pProcess = new Process(); result = pProcess.StandardOutput.ReadToEnd();
... View more
04-04-2012
11:58 AM
|
0
|
0
|
427
|
POST
|
http://resources.esri.com/help/9.3/ArcGISengine/ArcObjects/esriGeometry/Share_a_line_segment.htm http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/esriGeometryDimension_Constants/002m00000017000000/
... View more
04-02-2012
09:31 PM
|
0
|
0
|
218
|
POST
|
I could never get the Append Tool with the NO_TEST option to work so I called a Python script. Test Failed try { ESRI.ArcGIS.Geoprocessor.Geoprocessor gp = new ESRI.ArcGIS.Geoprocessor.Geoprocessor(); ESRI.ArcGIS.ConversionTools.MapToKML mk = new ESRI.ArcGIS.ConversionTools.MapToKML(); mk.in_map_document = @"U:\kmltest.mxd"; mk.data_frame = "Layers"; mk.map_output_scale = 24000; mk.out_kmz_file = @"U:\junk5.kml"; /*mk.is_composite = "NO_COMPOSITE"; mk.is_vector_to_raster = "VECTOR_TO_VECTOR"; mk.extent_to_export =""; mk.image_size = 2048; mk.dpi_of_client = 192;*/ gp.Execute(mk, null); } catch { MessageBox.Show("Failed"); } this.Close(); Python Fix appendStatus = RunPythonScript.ExecuteCommand("cmd", "/c " + @"C:\python26\ArcGIS10.0\python.exe " + @"U:\loc\GIS\PROJECTS\CustomTools\PythonScripts\append.py" + " " + input + "," + output); class RunPythonScript { public static Boolean ExecuteCommand(string command, string arug) { Boolean appendComplete = true; try { string result; Process pProcess = new Process(); pProcess.StartInfo.UseShellExecute = false; pProcess.StartInfo.Arguments = arug; pProcess.StartInfo.CreateNoWindow = true; pProcess.StartInfo.RedirectStandardOutput = true; pProcess.StartInfo.RedirectStandardError = true; pProcess.StartInfo.FileName= command; pProcess.Start(); result = pProcess.StandardOutput.ReadToEnd(); if (result.Substring(0, 4) == "true") { appendComplete = true; } else { appendComplete = false; } } catch { appendComplete = false; } return appendComplete; } }
... View more
04-02-2012
05:09 PM
|
0
|
0
|
302
|
POST
|
C# Flash Code http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//004900000075000000 ComboBox ListBox Where Clause example calling Flash Geometry private void btnZoom_Click(object sender, EventArgs e) { try { string strWhere; Boolean boStatus = ckbQuery.Checked; IMxDocument IMxDoc = (IMxDocument)ArcMap.Application.Document; ILayer iLayer1; //HARD CODED //Build where Clause if (rdName.Checked) { strWhere = "Allot_NAME = '" + listName.SelectedItem.ToString() + "' AND " + "ADM_OFC_CD = '" + cmbOffice.Text + "'"; } else { strWhere = "ST_ALLOT = 'ID" + listNumber.SelectedItem.ToString() + "'"; } //Hard Coded if (iLayer != null) { iLayer1 = cUtils.ExistsFeatureReturnLayer((IMap)IMxDoc.FocusMap, iLayer); if (iLayer1 != null) { cUtils.SelectFeatureQuery(iLayer1, strWhere, boStatus); } else { cUtils.AddLayerToActiveView(IMxDoc.ActiveView, iLayer); IMxDoc.ActiveView.Refresh(); cUtils.SelectFeatureQuery(iLayer, strWhere, boStatus); } } } catch { } } public void SelectFeatureQuery(ILayer iLayer, string sQuery, Boolean bDef) { IFeatureLayer iFeatureLayer = iLayer as IFeatureLayer; IFeatureLayerDefinition iFLD = iFeatureLayer as IFeatureLayerDefinition; IFeatureSelection iFeatureSelection = iFeatureLayer as IFeatureSelection; IQueryFilter iQF = new QueryFilter(); ISelectionSet iSelSet; try { UID uUID = new UID(); uUID.Value = "esriArcMapUI.ClearSelectionCommand"; ArcMap.Application.Document.CommandBars.Find(uUID).Execute(); if (bDef) { iFLD.DefinitionExpression = sQuery; } else { iFLD.DefinitionExpression = ""; } iQF.WhereClause = sQuery; iFeatureSelection.SelectFeatures(iQF, esriSelectionResultEnum.esriSelectionResultNew, false); iFeatureSelection.SelectionChanged(); iSelSet = iFeatureSelection.SelectionSet; if (iFeatureSelection.SelectionSet.Count == 0) { MessageBox.Show("Feature Not Found!", "Query Results"); } else { uUID.Value = "esriArcMapUI.ZoomToSelectedCommand"; ArcMap.Application.Document.CommandBars.Find(uUID).Execute(); //example passing flash parameters delete Application.DoEvents(); FeatureClassUtils fc = new FeatureClassUtils(); IFeature feature = iFeatureLayer.FeatureClass.GetFeature(iSelSet.IDs.Next()); IGeometry ig = feature.Shape; IRgbColor iColor = new RgbColor(); iColor.RGB = 233; IMxDocument iMxDoc = ArcMap.Document; fc.FlashGeometry(ig, iColor, iMxDoc.ActiveView.ScreenDisplay, 1000); } } catch { } }
... View more
03-29-2012
04:35 PM
|
0
|
0
|
644
|
POST
|
Code I use private void ZoomSel(double X, double Y) { try { IMap iMap = iMxDoc.FocusMap; IActiveView iAV = iMxDoc.ActiveView; IPoint iPoint = new ESRI.ArcGIS.Geometry.Point(); IEnvelope Env = iAV.FullExtent; iPoint.PutCoords(X,Y); Env.CenterAt(iPoint); iAV.Extent = (IEnvelope)Env; iMap.MapScale = 2000; iAV.Refresh(); } catch { MessageBox.Show("Unable to Zoom to Selected Location", "Zoom Error"); } }
... View more
03-27-2012
08:24 AM
|
0
|
0
|
514
|
POST
|
Hopefully, the example below converting to IRaster -> Byte Array -> IMemoryBlobStream helps. IRasterValue.Raster http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//0048000000mn000000 try { IFunctionRasterDataset pFuncRasterDataset = mybuilderItem.Dataset; // Get the FunctionRasterDataset from mybuilderItem IRasterDataset pRasterDataset; pRasterDataset = (IRasterDataset)pFuncRasterDataset; // Cast the FunctionRasterDataset to Raster Dataset IPropertySet thePropSet = pFuncRasterDataset.Properties; // Get the properties of the raster Dataset IRaster praster = pRasterDataset.CreateDefaultRaster(); // Create default raster from the above raster dataset praster.ResampleMethod = rstResamplingTypes.RSP_NearestNeighbor; // The raster is resampled by RSP_NearestNeighbor IRasterProps pRasterProps = (IRasterProps)praster; // Raster properties are used to update the height, width of the raster pRasterProps.Height = 256; pRasterProps.Width = 256; IRasterExporter pConverter = new RasterExporterClass(); // IRasterExporter object is used to convert the raster to byte array. byte[] pBytesArr; pBytesArr = pConverter.ExportToBytes(praster, "TIFF"); // Convert the resampled Raster to a Byte array IMemoryBlobStream memBlobStream = new MemoryBlobStream(); // Create new IMemoryBlobStream IMemoryBlobStreamVariant varBlobStream = (IMemoryBlobStreamVariant)memBlobStream; // Assign to IMemoryBlobStreamVariant object anObject = pBytesArr; varBlobStream.ImportFromVariant(anObject); // IMemoryBlobStreamVariant object is assigned the byte array thePropSet.SetProperty("ThumbNail", memBlobStream); // and saved to the property "ThumbNail" } http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/d/0001000001qr000000.htm // Open a file as a memory blob stream. IMemoryBlobStream memoryBlobStream = new MemoryBlobStreamClass(); memoryBlobStream.LoadFromFile("Image1.png"); // Create an attachment. IAttachment attachment = new AttachmentClass { ContentType = "image/png", Data = memoryBlobStream, Name = "Image1.png" }; http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/ISaveAs2_Interface/0025000007z5000000/
... View more
03-26-2012
08:53 AM
|
2
|
0
|
432
|
POST
|
http://ryanfarley.com/blog/archive/2004/03/23/465.aspx http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//00480000013m000000
... View more
03-26-2012
08:10 AM
|
0
|
0
|
1100
|
POST
|
When I make a duplicate copy of an ArcMap 10 file geodatabase and try to append a featureclass, the "NO_TEST" option only copies the features without the attributes. The "TEST" option copies both - WHY??? Do I have something wrong in the code below? I found this code on the web and modified it to go from geodatabase to geodatabase. My original code had the same results. using System; using System.Collections.Generic; using System.Text; using System.IO; using ESRI.ArcGIS.Geodatabase; using ESRI.ArcGIS.Geoprocessor; using ESRI.ArcGIS.DataManagementTools; using ESRI.ArcGIS.DataSourcesGDB; namespace Bug { public class Bug : ESRI.ArcGIS.Desktop.AddIns.Button { public Bug() { } protected override void OnClick() { // // TODO: Sample code showing how to access button host // ArcMap.Application.CurrentTool = null; try { ESRI.ArcGIS.Geodatabase.IWorkspace pWorkspace; ESRI.ArcGIS.Geodatabase.IWorkspaceFactory pWorkspaceFactory; ESRI.ArcGIS.Geodatabase.IFeatureWorkspace SdeFeatureWorkspace; pWorkspaceFactory = new FileGDBWorkspaceFactory(); pWorkspace = pWorkspaceFactory.OpenFromFile(@"R:\loc\GIS\PROJECTS\cultural\Development\CulturalTemp_1.gdb", 0); SdeFeatureWorkspace = (ESRI.ArcGIS.Geodatabase.IFeatureWorkspace)pWorkspace; IFeatureClass featureClass = SdeFeatureWorkspace.OpenFeatureClass("FeatArt_point"); Geoprocessor gp = new Geoprocessor(); gp.SetEnvironmentValue("workspace", @"R:\loc\GIS\PROJECTS\cultural\Temporary Database\CulturalTemp.gdb"); ESRI.ArcGIS.DataManagementTools.Append append = new ESRI.ArcGIS.DataManagementTools.Append(); append.inputs = featureClass; append.target = @"R:\loc\GIS\PROJECTS\cultural\Temporary Database\CulturalTemp.gdb\FeatArt_point"; append.schema_type = "NO_TEST"; gp.Execute(append, null); } catch { } } protected override void OnUpdate() { Enabled = ArcMap.Application != null; } } }
... View more
03-23-2012
01:15 PM
|
0
|
0
|
985
|
Title | Kudos | Posted |
---|---|---|
2 | 03-26-2012 08:53 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|