|
POST
|
Thanks, that was the first place I looked. Just can’t believe it is not a built in, out of the box functionality in Web AppBuilder.
... View more
06-29-2015
11:17 AM
|
0
|
3
|
1856
|
|
POST
|
Rickey, ArcGIS online has the capability but Web AppBuilder does not. We are creating custom Web apps using Web AppBuilder and need to give the users the ability to add their own data. There is no out of the box widget for this in Web AppBuilder and haven’t found anything about it in my searches.
... View more
06-29-2015
11:14 AM
|
0
|
0
|
1856
|
|
POST
|
Rebecca, Thanks for the reply, that was one of the first places I looked in. Carlos
... View more
06-29-2015
11:11 AM
|
0
|
0
|
1856
|
|
POST
|
I'm a newbie with about 2 months experience using Web AppBuilder and was wondering if anyone has an "Add Data" widget similar to what is available in Web Maps. I haven't found anything about it in my searches and it seems odd to me that this basic functionality is not an out of the box widget. Thanks, Carlos
... View more
06-29-2015
11:04 AM
|
0
|
12
|
6356
|
|
POST
|
I am facing a similar problem while accessing a raster from a geoDB. Did you find a solution? No, I didn't.
... View more
05-30-2014
05:14 AM
|
0
|
0
|
729
|
|
POST
|
Thanks for the reply. Unfortunately, I already went through that exercise and the resulting code I got returned a new error, grrr! That is what I was refering to in the last sentence of my post. Thanks anyhow, I appreciate it. If you have other ideas, I'm all ears. Never mind, I found the problem. It was the projection on one of the layers. Eventough both layers have the same factory code (2881) one is listed as "feet" while the other is not. That is the ONLY difference between the two layers, coordinate system, projection, etc. were all identical. The ONLY difference is esriSRProjCS_NAD1983HARN_StatePlane_Florida_East_FIPS_0901_Ft (2881) versus esriSRProjCS_NAD1983HARN_StatePlane_Florida_East_FIPS_0901 (2881) Hopefully this will save someone from having the headache I did today trying to fix this! Carlos
... View more
04-14-2014
01:14 PM
|
0
|
0
|
854
|
|
POST
|
Ah yes, the HRESULT error. Give this a look: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//0001000002zz000000 find out what the code is representing, and that may narrow down what exactly is happening... also migrating from 9.3 to 10 has caused some bad/weird problems for me in the past. Thanks for the reply. Unfortunately, I already went through that exercise and the resulting code I got returned a new error, grrr! That is what I was refering to in the last sentence of my post. Thanks anyhow, I appreciate it. If you have other ideas, I'm all ears.
... View more
04-14-2014
10:55 AM
|
0
|
0
|
854
|
|
POST
|
Hi everyone, I have a script that checks the percentage of overlap between two polygons. The code below was working fine in 9.3 but now in 10.1 it crashes every time on the pTopologicalOperator.Intersect line with an error of "Exception from HRESULT: 0x80040215." I looked this code up on the Web but only found a few results and none of them matched my problem. I also followed the ESRI instructions to convert the hexidecimal number but I got no results when using ErrorLookup. Any help is greatly appreciated. Thanks, Carlos private static bool DetermineOverlapArea(IFeature pFeature1, IFeature pFeature2)
{
ITopologicalOperator2 pTopologicalOperator = null;
IGeometry pGeometry1 = null;
IGeometry pGeometry2 = null;
IGeometry pIntersectGeometry = null;
IArea pIntersectArea = null;
IArea pFeature1Area = null;
IArea pFeature2Area = null;
try
{
pGeometry1 = pFeature1.Shape;
pGeometry2 = pFeature2.Shape;
//Simplify geometries.
pTopologicalOperator = pGeometry1 as ITopologicalOperator2;
pTopologicalOperator.IsKnownSimple_2 = false;
pTopologicalOperator.Simplify();
pTopologicalOperator = pGeometry2 as ITopologicalOperator2;
pTopologicalOperator.IsKnownSimple_2 = false;
pTopologicalOperator.Simplify();
pGeometry1.SnapToSpatialReference();
pGeometry2.SnapToSpatialReference();
//Get intersection area.
pTopologicalOperator = pGeometry1 as ITopologicalOperator2;
pIntersectGeometry = pTopologicalOperator.Intersect(pGeometry2, esriGeometryDimension.esriGeometry2Dimension) as IGeometry;
pIntersectArea = pIntersectGeometry as IArea;
pFeature1Area = pGeometry1 as IArea;
pFeature2Area = pGeometry2 as IArea;
//Get overlap area.
int appOverlap = Convert.ToInt32((pIntersectArea.Area / pFeature1Area.Area) * 100);
int ensOverlap = Convert.ToInt32((pIntersectArea.Area / pFeature2Area.Area) * 100);
if (appOverlap > 5 || ensOverlap > 5)
return true;
else
return false;
}
catch (Exception ex)
{
return true;
}
}
... View more
04-14-2014
10:27 AM
|
0
|
3
|
3086
|
|
POST
|
Yes Otto, you can email me at cpicciri@sfwmd.gov if you wish. Yes, I speak Spanish. Unfortunately, I have not found a solution to the problem. Hello Carlos, I am dealing with same problem. May I email you? It is just because I think you speak Spanish and that is my language. Thank you in advantage, Otto Arturo.
... View more
03-19-2013
02:48 AM
|
0
|
0
|
419
|
|
POST
|
Hi everyone, I am converting C# code from ArcGIS 9.3 to 10.1 and have hit a wall trying to set the metadata stylesheet in code. In 9.3 the code to change the stylesheet was: IMetadataViewWindow metadataWindow = new MetadataViewWindowClass(); metadataWindow.Layer = pLayer; metadataWindow.Application = m_application; metadataWindow.DataSource = pDataLayer.DataSourceName as IDatasetName; metadataWindow.MetadataHelper.Stylesheet = "FGDC ESRI"; The main problem is that the Stylesheet property on the IMetadataViewWindow interface is read only in 10.1 where it used to be read/write in 9.3. My attempt at the 10.1 code using the IMetadataHelper Stylesheet Example is: IExtension pExtension = m_application.FindExtensionByName("ESRI Metadata Extension") as IExtension; IMetadataHelper pMetadataHelper = pExtension as IMetadataHelper; pMetadataHelper.Stylesheet = "ARCGIS"; I also tried pMetadataHelper.Stylesheet = "FGDC ESRI"; and pMetadataHelper.Stylesheet = "FGDC CSDGM Metadata"; The code produces no errors but it does not work either. Opening some metadata after running the code produces the default "Item Description" metadata style. I can change it manually by going to Customize > Options and on the Metadata tab choose the style I want but I need to do this in code because most of the users accessing our code are not very ArcGIS literate so the more things I can automate, the better. I have looked through the old forums as well as the new ones and found very few posts dealing with metadata. Thanks for your time, Carlos
... View more
03-12-2013
10:19 AM
|
0
|
2
|
704
|
|
POST
|
Hi everyone, We have a form with a listview control that lists over 1,300 available layers. The form has filters and keyword searching capability to narrow down the results. Once the user finds what the want to load, they select one or more layers and click an OK button. The code behind the the OK button loads all selected layers into ArcMap. This all works great but now my boss wants to fancy it up and have the ability to select one or more layers and drag them into ArcMap like you can do from Windows Explorer for a layer file. I've seen a few similar posts in the old forums but never saw a solution. Searching the web I found one promising example at [HTML]http://kiwigis.blogspot.com/2009/05/drag-and-drop-in-arcgis-desktop.html[/HTML] In their example, they open a GxDialog to allow the user to select one or more layers. The selected layers are added to a listview control on a form and then the user can drag/drop the layer from the form into ArcMap. I cannot use their approach because that would require getting a reference to each layer in my listview and doing that for 1,300+ layers would surely take a LONG time to complete. What I am doing is when the user selects a layer from the listview, the listview_click event gets a reference to the selected layer and returns an ILayer. Here begins my problem. In order to follow their code as much as possible, I need to convert the ILayer reference to an IGxObject. I've spent two days now trying to do that but have not been able to. Below is the pertinent code from the example. private void Button_Click(object sender, EventArgs e)
{
// Create GxObjectFilter for GxDialog
IGxObjectFilter gxObjectFilter = new GxFilterGeoDatasets();
// Create GxDialog
IGxDialog gxDialog = new GxDialogClass();
gxDialog.AllowMultiSelect = true;
gxDialog.ButtonCaption = "Select";
gxDialog.ObjectFilter = gxObjectFilter;
gxDialog.RememberLocation = true;
gxDialog.Title = "Select one or more feature classes";
// Declare Enumerator to hold selected objects
IEnumGxObject enumGxObject = null;
// Open Dialog
if (!gxDialog.DoModalOpen(this.Handle.ToInt32(), out enumGxObject)) { return; }
if (enumGxObject == null) { return; }
// Get Selected Object (if any)
IGxObject gxObject = enumGxObject.Next();
while (gxObject != null)
{
// Get Named Object
IGxDataset gxDataset = gxObject as IGxDataset;
if (gxDataset == null) { continue; }
IDatasetName datasetName = gxDataset.DatasetName;
// Add to list
ListViewGroup g = null;
foreach(ListViewGroup group in this.listViewNames.Groups)
{
if (group.Header == Form1.GetDescription(datasetName.Type))
{
g = group;
}
}
if (g == null)
{
g = new ListViewGroup(Form1.GetDescription(datasetName.Type), HorizontalAlignment.Left);
this.listViewNames.Groups.Add(g);
}
DatasetNameItem d = new DatasetNameItem(datasetName);
d.Group = g;
this.listViewNames.Items.Add(d);
// Get Next Item
gxObject = enumGxObject.Next();
}
}
... View more
11-08-2012
02:18 AM
|
0
|
0
|
1722
|
|
POST
|
Hi everyone, The code below accepts a list of layers as input, appends them into a new layer and puts the output into a file geodatabase for further processing. The script that runs immediately after this script does a spatial query between the new, appended layer and another layer. All of this works fine but my problem is a performance issue. If I run the two scripts back to back as normally would be the case, it takes the query script 3 minutes to process 100 records. If I run the append script by itself, stop the code and then run the query script by itself, it takes less than 30 seconds to process the same 100 records which leads me to believe something is not right with the append script. I am using 100 records for ease of testing but in reality, the code will cycle through over 300,000+ records so performance is an issue. I suspect there is a memory problem like something is not being released but I cannot figure it out. I've been trying different things from other forum post for almost 2 days now and am out of ideas. Can someone shed some light on what is going on or have a better way to append layers together? This is a stand alone application written in C# using Visual Studio 2008, .NET 3.5 and ArcGIS 9.3.1. public static void AppendAoiLayers(List<string> layerArray)
{
IPropertySet pPropertySet = new PropertySetClass();
IWorkspaceFactory pWorkspaceFactory = new SdeWorkspaceFactoryClass();
IWorkspaceFactory pFileGDBWorkspaceFactory = new FileGDBWorkspaceFactoryClass();
IFields pFields = new FieldsClass();
IFeatureWorkspace pFeatureWorkspace = null;
IFeatureClass pOutFeatureClass = null;
IFeatureLayer pFeatureLayer = new FeatureLayerClass();
Append pAppend = new Append();
ITrackCancel pTrackCancel = new CancelTrackerClass();
Geoprocessor pGeoprocessor = new Geoprocessor();
IWorkspaceFactory pGetFieldsWorkspaceFactory = new SdeWorkspaceFactoryClass();
IFeatureWorkspace pGetFieldsFeatureWorkspace = null;
IFeatureClass pGetFieldsFeatureClass = null;
string AppendLayers = string.Empty;
int arrayIndex = 0;
string fieldsCollectionLayer = string.Empty;
try
{
//Delete connection file if it exists.
if (File.Exists(ClsENS.PATH_Scratch_Local + "grespsde.sde"))
File.Delete(ClsENS.PATH_Scratch_Local + "grespsde.sde");
//Create connection file.
pPropertySet = ClsENS.GetSdePropertySet("grespsde", null);
pWorkspaceFactory.Create(ClsENS.PATH_Scratch_Local, "grespsde.sde", pPropertySet, 0);
//Set inputs.
foreach (String layerName in layerArray)
{
if (arrayIndex == layerArray.Count - 1)
{
AppendLayers += ClsENS.PATH_Scratch_Local + "grespsde.sde\\" + layerName;
//Use last layer to get fields collection from.
fieldsCollectionLayer = layerName;
}
else
{
AppendLayers += ClsENS.PATH_Scratch_Local + "grespsde.sde\\" + layerName + ";";
}
arrayIndex++;
}
pAppend.inputs = AppendLayers;
//Set output.
pAppend.target = ClsENS.PATH_Scratch_Local + "temp.gdb" + "\\" + "App_Merge";
pAppend.schema_type = "NO_TEST";
//Get fields collection from an input layer so it can be applied to the destination layer.
pGetFieldsFeatureWorkspace = pGetFieldsWorkspaceFactory.OpenFromFile(ClsENS.PATH_Scratch_Local + "\\grespsde.sde", 0) as IFeatureWorkspace;
pGetFieldsFeatureClass = pGetFieldsFeatureWorkspace.OpenFeatureClass(fieldsCollectionLayer);
pFields = pGetFieldsFeatureClass.Fields;
//Create destination layer.
pFeatureWorkspace = pFileGDBWorkspaceFactory.OpenFromFile(ClsENS.PATH_Scratch_Local + "temp.gdb", 0) as IFeatureWorkspace;
pOutFeatureClass = ClsENS.CreateFeatureClass(pFeatureWorkspace, "App_Merge", esriFeatureType.esriFTSimple, esriGeometryType.esriGeometryPolygon, pFields, null, null, null);
pFeatureLayer.FeatureClass = pOutFeatureClass;
pTrackCancel.CancelOnClick = false;
pTrackCancel.CancelOnKeyPress = true;
//Do Append.
pGeoprocessor.SetEnvironmentValue("workspace", ClsENS.PATH_Scratch_Local + "temp.gdb");
pGeoprocessor.Execute(pAppend, pTrackCancel);
}
catch (Exception ex)
{
//ClsENS.LogError(ex.StackTrace, ex.Message, "AppendFeatureClasses", "myApplications");
MessageBox.Show(ex.StackTrace + "\r\n" + ex.Message);
}
finally
{
if (pWorkspaceFactory != null) { Marshal.ReleaseComObject(pWorkspaceFactory); pWorkspaceFactory = null; }
if (pFileGDBWorkspaceFactory != null) { Marshal.ReleaseComObject(pFileGDBWorkspaceFactory); pFileGDBWorkspaceFactory = null; }
if (pPropertySet != null) { Marshal.ReleaseComObject(pPropertySet); pPropertySet = null; }
if (pFields != null) { Marshal.ReleaseComObject(pFields); pFields = null; }
if (pFeatureWorkspace != null) { Marshal.ReleaseComObject(pFeatureWorkspace); pFeatureWorkspace = null; }
if (pOutFeatureClass != null) { Marshal.ReleaseComObject(pOutFeatureClass); pOutFeatureClass = null; }
if (pFeatureLayer != null) { Marshal.ReleaseComObject(pFeatureLayer); pFeatureLayer = null; }
if (pTrackCancel != null) { Marshal.ReleaseComObject(pTrackCancel); pTrackCancel = null; }
if (pGetFieldsWorkspaceFactory != null) { Marshal.ReleaseComObject(pGetFieldsWorkspaceFactory); pGetFieldsWorkspaceFactory = null; }
if (pGetFieldsFeatureWorkspace != null) { Marshal.ReleaseComObject(pGetFieldsFeatureWorkspace); pGetFieldsFeatureWorkspace = null; }
if (pGetFieldsFeatureClass != null) { Marshal.ReleaseComObject(pGetFieldsFeatureClass); pGetFieldsFeatureClass = null; }
if (pGeoprocessor != null) { pGeoprocessor = null; }
if (pAppend != null) { pAppend = null; }
}
} Thanks for your time and assistance! Carlos
... View more
10-11-2012
08:50 AM
|
0
|
0
|
519
|
|
POST
|
Thank you for your advice and time, I appreciate it. Carlos
... View more
09-13-2012
04:34 AM
|
0
|
0
|
341
|
|
POST
|
My group is getting ready to start a new project and I would like to get some advice on what front end application (API) would be best for our needs. The requirements are: Have a mapping component (ability to show spatial data, both vector and raster, zoom, layers on/off and basic querying), be able to query and populate Microsoft Access databases (plus display results) and produce reports, probably in Microsoft Word. Behind the scenes, all of the processing (spatial queries, etc.) will be handled by ArcMap programmed in C#. Right now we just want to pick a front end for the GUI, preferably Web based. My boss has suggested these as possibilities: Windows Forms (what we currently use), Windows WPF, Silverlight, HTML 5, JavaScript, ASP.NET. Can someone shed some light on the pros and cons to these or suggest something better? If one of the possibilities we are looking into cannot handle our requirements (does not support a mapping component) then we can eliminate that option altogether. Thank you all for your time and insight. Carlos
... View more
09-06-2012
03:11 AM
|
0
|
2
|
749
|
|
POST
|
Here's something I just noticed. This is the manual test setup before the code runs. I am testing on a layer with 1255 records. I sort on objectid and select the first 500 records. Then I update the value of just one field with a bogus value (TEST). Save edits and stop editing. Verify settings change. I then run the code and started noticing that when the code does not update attributes, it does update two and only two features, the 1000th feature and the last feature. I�??ve repeated this 5 times and got the same result, always the 1000th and last feature and they are never the same record. That can�??t be a co-incidence. Any idea what might be causing that? It almost sounds like a memory leak or buffer issue.
... View more
08-08-2012
08:40 AM
|
0
|
0
|
248
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 02-11-2016 06:06 AM | |
| 1 | 08-07-2015 10:13 AM | |
| 2 | 06-29-2015 12:45 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|