POST
|
I was able to import the arcgis module in jupyter notebook fine until today. The interpreter is unable to find the arcgis module even though 'arcgis-1.0-py35_1' exists in 'C:\Program Files\Miniconda3\pkgs'. When I run the cell with 'from arcgis.gis import GIS', I Keep getting this error - ImportError: No module named 'arcgis' The arcgis package files are all intact. Any incompatibility issues I need to check?
... View more
06-02-2017
08:50 AM
|
1
|
5
|
13747
|
BLOG
|
Thank you for sharing all the videos. Can you share the crime mapping analysis notebook that was demoed in 'ArcGIS Python API for GIS Analysts and Data Scientists' video? Or any sample notebook with Predictive analysis using Machine learning would be helpful. Thanks!
... View more
05-05-2017
07:18 AM
|
0
|
0
|
771
|
POST
|
Thank you, that worked. I was able to search without item_type too. mygis.content.search('title:Bhag')
... View more
01-10-2017
07:04 AM
|
0
|
0
|
524
|
POST
|
I am trying to search a feature layer and add it to my map object in jupyter notebook. This is the layer I tried searching - http://www.arcgis.com/sharing/rest/content/items/9f2fd655aa624b8080299196d841ae54/data my_gis.content.search('title:Ekal',item_type='Feature Layer') returns empty list. Am I missing something? I tried searching with full title - my_gis.content.search('title:Ekal AP Bhag layer',item_type='Feature Layer') Still no results. Thank you!
... View more
01-04-2017
10:34 AM
|
0
|
3
|
1682
|
POST
|
I uninstalled and reinstalled arcgis package and the map is displayed now.
... View more
12-29-2016
11:21 AM
|
0
|
2
|
963
|
POST
|
I have the same environment as above and installed with: conda install -c esri arcgis. as per the Install and Set Up | ArcGIS for Developers. But map isn't returned with my_gis.map()
... View more
12-29-2016
10:26 AM
|
0
|
3
|
963
|
POST
|
If the feature classes reside in feature dataset then you need to include the feature dataset name in the path.
... View more
10-20-2016
06:41 AM
|
0
|
0
|
210
|
POST
|
I am having similar issue but with a custom Addin. I have Silverlight 5 installed. The custom Addin has couple of tools and a behavior. I am able to upload successfully but once I try to run the tool from the viewer it freezes. And when I go back to the edit the viewer from builder it throws the Class load failed error. Any other suggestions? Thanks!
... View more
10-11-2013
10:46 AM
|
0
|
0
|
736
|
POST
|
Jamal, If were not able to fix this issue this is what I figured - I had this same error publishing the map service to AGS 10.1 and a warning was also given after analyzing the map document (which we tend to ignore) - "Layer is being published with custom class extension. " If you experienced similar warning make sure the necessary class extensions applied on the feature classes are installed on your machine. Once I installed these the map document was published successfully. Error I got - The base table definition string "Conductor" is invalid. Thanks!
... View more
10-10-2013
10:53 AM
|
0
|
0
|
709
|
POST
|
Thanks Tim! This page has the link to the videos I was looking for.
... View more
05-28-2013
07:02 AM
|
0
|
0
|
245
|
POST
|
Hi, I found videos on Esri website beginning of this year Jan/Feb 2013. These were training videos by Dave Peters specific to the Building a system Architecture Design Strategies for Managers GIS book. It must have been for the latest release. This page had 3 videos of the training each video length more than an hour or so. I forgot to bookmark it and I would like to review those videos. Does anyone have the page/video bookmarked or downloaded? Please Share!
... View more
05-27-2013
01:11 PM
|
0
|
2
|
3180
|
POST
|
Lu, Did you find an answer to this one? I tried using the same code but it doesn't give the right screen coordinates back. Thanks!
... View more
04-05-2013
04:01 PM
|
0
|
0
|
175
|
POST
|
Hi Kim, I too have a table with just village, district, state in India. I can search this in ArcMap manually. I was able to find some addresses like this. But I try to geocode the table this is the error - There was an error trying to process this table. Token required. Do we need any license to the online geocode service? Thanks!
... View more
03-29-2013
07:10 PM
|
0
|
0
|
414
|
POST
|
Thanks Mike! I looked at the posting you referred to but I found ArcGIS Runtime doesn't support workspacefactorytype of SQL Server database. So this might not work as desired. I can think of only looping through the data and editing the a default table everytime the application is connected to a new database. Since its not possible to connect to SQL server in ArcGIS Runtime. Actually I need to attach a mdf file to SQL Server. Is there another way? Thanks! Hi, Are these Access / SQL Server databases actually Geodatabases? Or would you like to join a non-spatial table from the database to a spatial dataset in another datasource? I'm assuming it's the latter... you could take a look at this earlier post which discusses using the JoinDataSource: http://forums.arcgis.com/threads/74686-Joining-Database-with-Map-Layer? Cheers Mike
... View more
02-25-2013
07:36 AM
|
0
|
0
|
233
|
POST
|
Hi Mike, I wanted this same kind of functionality - to access the attributes of a shapefile added on the fly. For which I contacted Esri Tech support and the GIS Analyst after research concluded that its not possible to access attributes for shapefile. Thanks for the code. Hi, I had a revelation that actually I'd probably confused the issue by keeping the ArcGISDynamicMapServiceLayer in my example whilst introducing a FeatureLayer as well. So I've simplified it to just use a FeatureLayer (below). So it now assumes that you actually want to add the FeatureLayer to the map and display that instead of the ArcGISDynamicMapServiceLayer. I'd recommend you definitely use the accelerated display mode if the feature layer may contain many thousands of graphics, or graphics with complex polygons. Code:
/// <summary>
/// Interaction logic for DynamicLayersFeatureDataGrid.xaml
/// </summary>
public partial class DynamicLayersFeatureDataGrid : UserControl
{
// Get the path of the "empty" MPK from the application folder
string _emptyMpkPath = @"..\Data\DynamicLayers\EmptyMPK_WGS84.mpk";
public DynamicLayersFeatureDataGrid()
{
InitializeComponent();
MyDataGrid.SelectionChanged += (s3, e3) =>
{
foreach (Graphic graphic in e3.RemovedItems)
{
graphic.SetZIndex(0);
}
foreach (Graphic graphic in e3.AddedItems)
{
graphic.SetZIndex(1);
}
};
}
/// <summary>
/// Handles the Click event of the AddShapefileButton control.
/// </summary>
/// <param name="sender">The source of the event.</param>
/// <param name="e">The <see cref="System.Windows.RoutedEventArgs"/> instance containing the event data.</param>
private void AddShapefileButton_Click(object sender, RoutedEventArgs e)
{
// Setup the OpenFiledialog.
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "Shapefiles (*.shp)|*.shp";
openFileDialog.RestoreDirectory = true;
openFileDialog.Multiselect = false; // This sample assumes a single file is selected
if (openFileDialog.ShowDialog() == true)
{
try
{
// Remove any existing FeatureLayers in the Map
List<FeatureLayer> featureLayers = MyMap.Layers.OfType<FeatureLayer>().ToList();
foreach (var fl in featureLayers)
{ MyMap.Layers.Remove(fl); }
// Call the add dataset method with workspace type, parent directory path, file names (without extensions) and delegate.
AddFileDatasetToDynamicMapServiceLayer(WorkspaceFactoryType.Shapefile,
Path.GetDirectoryName(openFileDialog.FileName),
Path.GetFileNameWithoutExtension(openFileDialog.SafeFileName));
}
catch (Exception ex)
{
MessageBox.Show("Error: Could not read file from disk. Original error: " + ex.Message);
}
}
}
/// <summary>
/// Adds a file dataset (Shapefile) to a new feature layer.
/// </summary>
/// <param name="workspaceType">The workspace type (FileGDB, Raster, SDE, Shapefile) <see cref="http://resources.arcgis.com/en/help/runtime-wpf/apiref/index.html?ESRI.ArcGIS.Client.Local~ESRI.ArcGIS.Client.Local.WorkspaceFactoryType.html"/>.</param>
/// <param name="directoryPath">A <see cref="System.String"/> representing the directory path.</param>
/// <param name="fileNames">A <see cref="System.Collections.Generic.List{System.String}"/> representing the name of the file.</param>
public void AddFileDatasetToDynamicMapServiceLayer(WorkspaceFactoryType workspaceType, string directoryPath, string fileName)
{
try
{
// Generate a unique workspace ID (any unique string).
string uniqueId = Guid.NewGuid().ToString();
// Create a new WorkspaceInfo object with a unique ID.
WorkspaceInfo workspaceInfo = new WorkspaceInfo(uniqueId, workspaceType, "DATABASE=" + directoryPath);
// Create a new LocalMapService instance.
LocalMapService localMapService = new LocalMapService
{
Path = _emptyMpkPath, // Set the path property.
EnableDynamicLayers = true, // Enable the dynamic layers capability.
MaxRecords = 1000000, // Set the maximum number of records
};
// Register the workspace to be used with this service.
localMapService.DynamicWorkspaces.Add(workspaceInfo);
// Asynchronously start the local map service.
localMapService.StartAsync(x =>
{
// Create a new ArcGISLocalDynamicMapServiceLayer passing in the newly started local service.
FeatureLayer featureLayer = new FeatureLayer()
{
Url = localMapService.UrlMapService + "/dynamicLayer", // Construct the URL to include the /dynamicLayer resource.
ID = fileName, // Assign ID
OutFields = new ESRI.ArcGIS.Client.Tasks.OutFields() { "*" }, // Display all fields
SelectionColor = new SolidColorBrush(Colors.Yellow), // Yellow is generally a nice selection color
};
// The workspace is a feature class so create a new TableDataSource
DataSource dataSource = new TableDataSource
{
DataSourceName = fileName, // Match the DataSourceName to the physical filename on disk (excluding extension).
WorkspaceID = workspaceInfo.Id // Provide the WorkspaceID (the unique workspace identifier created earlier).
};
// Set the Source property of the DynamicLayerInfo object.
LayerDataSource layerDataSource = new LayerDataSource { DataSource = dataSource };
// Assign the LayerDataSource
featureLayer.Source = layerDataSource;
featureLayer.Initialized += (s, e) =>
{
// Set the FeatureDataGrid's Map property
MyDataGrid.Map = MyMap;
// Set the new FeatureLayer as the FeatureDataGrid's GraphicsLayer property
MyDataGrid.GraphicsLayer = featureLayer as GraphicsLayer;
SimpleRenderer renderer = null;
switch (featureLayer.LayerInfo.GeometryType)
{
case ESRI.ArcGIS.Client.Tasks.GeometryType.MultiPoint:
renderer = new SimpleRenderer() { Symbol = new SimpleMarkerSymbol() { Color = new SolidColorBrush(GetRandomColor()), Size = 8 } };
break;
case ESRI.ArcGIS.Client.Tasks.GeometryType.Point:
renderer = new SimpleRenderer() { Symbol = new SimpleMarkerSymbol() { Color = new SolidColorBrush(GetRandomColor()), Size = 8 } };
break;
case ESRI.ArcGIS.Client.Tasks.GeometryType.Polygon:
renderer = new SimpleRenderer() { Symbol = new SimpleFillSymbol() { Fill = new SolidColorBrush(GetRandomColor()), BorderBrush = new SolidColorBrush(GetRandomColor()) } };
break;
case ESRI.ArcGIS.Client.Tasks.GeometryType.Polyline:
renderer = new SimpleRenderer() { Symbol = new SimpleLineSymbol() { Color = new SolidColorBrush(GetRandomColor()) } };
break;
default:
break;
}
featureLayer.Renderer = renderer;
};
MyMap.Layers.Add(featureLayer);
});
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
}
}
// Utility function: Generate a random System.Windows.Media.Color
Random _random = new Random();
private Color GetRandomColor()
{
var colorBytes = new byte[3];
_random.NextBytes(colorBytes);
Color randomColor = Color.FromRgb(colorBytes[0], colorBytes[1], colorBytes[2]);
return randomColor;
}
private void Legend_Refreshed(object sender, Legend.RefreshedEventArgs e)
{
// Clear the sub items from the basemap layer.
if (e.LayerItem.Layer == _worldTopographicBasemap)
e.LayerItem.LayerItems.Clear();
}
}
Sorry - I haven't had time to look at the code in your previous yet... it's the end of the week here... Cheers Mike
... View more
02-19-2013
10:27 AM
|
0
|
0
|
610
|
Title | Kudos | Posted |
---|---|---|
1 | 06-02-2017 08:50 AM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|