|
POST
|
Yes, PostGreSQL - without the ArcObjects / SDE middleware. That gives the DataStore the advantage of being able to support a lot more Feature Services but on the other hand, don't expect to make a direct connect using pgAdmin. It's possible to direct connect but you can't do anything with the data because there is no ArcObjects / SDE interface to convert the ArcGIS Commands to a DB operation. It's all REST API with the datastore.
... View more
06-19-2015
01:44 PM
|
4
|
4
|
7862
|
|
DOC
|
Holy smokes this is pretty awesome. Gaetan, do you know how I could possibly change the main rotator to be a pure CSS image slider? I'd like something very similar to the Feature Maps and Apps carousel, with navigation widgets and bullets at the bottom to indicate how many images are loaded. I would then reference multiple images in the CSS and use them to make announcements on the home page.
... View more
06-19-2015
08:17 AM
|
0
|
0
|
2924
|
|
POST
|
Hi Antti, Thanks for that response. I'm actually using Windows Desktop, I'm going to give this code a go today. I'll probably need additional help but will post here if so. Thanks
... View more
06-15-2015
08:08 AM
|
0
|
0
|
2116
|
|
POST
|
Hi Todd, thanks for the response. This is my very second day with C# and .NET. I looked at that document and I have have been struggling to implement it The document seems to indicate that the logic I should be using in XAML.cs is: try
{
// exception will be thrown here for bad credential ...
var cred = await Esri.ArcGISRuntime.Security.IdentityManager.Current.GenerateCredentialAsync(
PORTAL_SERVER_URL, UserTextBox.Text, PasswordTextBox.Password);
// add the credential if it was generated successfully
Esri.ArcGISRuntime.Security.IdentityManager.Current.AddCredential(cred);
// connecting to the portal will use an available credential (based on the server URL)
_portal = await Esri.ArcGISRuntime.Portal.ArcGISPortal.CreateAsync(new Uri(PORTAL_SERVER_URL));
}
catch(ArcGISWebException webExp)
{
var msg = "Could not log in. Please check credentials. Error code: " + webExp.Code;
var messageDlg = new MessageDialog(msg);
await messageDlg.ShowAsync();
}
What I don't know is where to drop that code within my .cs file. There also doesn't seem to be any kind of indication that I need to provide a using statement or anything else. It's very unclear for a novice.
... View more
06-11-2015
12:02 PM
|
1
|
2
|
2116
|
|
POST
|
Can someone provide an example of how I have to create the ChallengeHandler to allow a user to authenticate to an On-Premise Portal? I'm creating my FirstApp and while I can get it to work with ArcGIS Online, I can't get it to connect to our own Portal when I change the portalUri XAML.cs using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Esri.ArcGISRuntime.Controls;
using Esri.ArcGISRuntime.Portal;
using Esri.ArcGISRuntime.WebMap;
using Esri.ArcGISRuntime.Security;
namespace FirstApp
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private ArcGISPortal arcGISOnline;
private ArcGISPortalItem selectedPortalItem;
// changes the basemap layer
private void baseMap_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
var combo = sender as ComboBox;
var sel = combo.SelectedItem as ComboBoxItem;
if (sel.Tag == null) { return; }
//Find and remove the current basemap layer from the map
if (mainMap == null) { return; }
var oldBasemap = mainMap.Layers["BaseMap"];
mainMap.Layers.Remove(oldBasemap);
//Create a new basemap layer
var newBaseMap = new Esri.ArcGISRuntime.Layers.ArcGISTiledMapServiceLayer();
//Set the ServiceUri with the url defined for the ComboboxItem's Tag
newBaseMap.ServiceUri = sel.Tag.ToString();
//Give the layer an ID so it an still be found with the code above
newBaseMap.ID = "BaseMap";
//Insert the new basemap layer as the first (bottom) layer in the map
mainMap.Layers.Insert(0, newBaseMap);
}
// searches the portal for content
private async void SearchButton_Click(object sender, RoutedEventArgs e)
{
try
{
if (this.arcGISOnline == null)
{
// create the uri for the portal
var portalUri = new Uri("https://myserver.domain.com/portal/sharing/rest");
// create the portal
this.arcGISOnline = await ArcGISPortal.CreateAsync(portalUri);
}
// create a variable to store search results
IEnumerable<ArcGISPortalItem> results = null;
// get the search term provided in the UI
var searchTerm = this.SearchTextBox.Text.Trim();
var searchItem = this.ItemTypeCombobox.SelectedValue.ToString();
// build a query that searches for the specified searchItem type
// ('web mapping application' is excluded from the search since 'web map' will match those item types too)
var queryString = string.Format("\"{0}\" type:(\"{1}\" NOT \"web mapping application\")", searchTerm, searchItem);
var searchParameters = new SearchParameters()
{
QueryString = queryString,
SortField = "avgrating",
SortOrder = QuerySortOrder.Descending,
Limit = 10
};
// execute the search
var itemSearch = await this.arcGISOnline.SearchItemsAsync(searchParameters);
results = itemSearch.Results;
// show the results in the list box
this.ResultListBox.ItemsSource = results;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error searching Portal");
}
}
// resets the UI controls to keep them in sync with the currently selected portal item in the ResultsListBox
private void ResetUI()
{
// clear UI controls
this.SnippetTextBlock.Text = "";
this.ThumbnailImage.Source = null;
this.ShowMapButton.IsEnabled = false;
}
private void ResultSelectionChanged(object sender, SelectionChangedEventArgs e)
{
this.ResetUI();
// store the currently selected portal item
this.selectedPortalItem = this.ResultListBox.SelectedItem as ArcGISPortalItem;
if (this.selectedPortalItem == null) { return; }
// show the portal item snippet (brief description) in the UI
if (!string.IsNullOrEmpty(this.selectedPortalItem.Snippet))
{
this.SnippetTextBlock.Text = this.selectedPortalItem.Snippet;
}
// show a thumnail for the selected portal item (if there is one)
if (this.selectedPortalItem.ThumbnailUri != null)
{
var src = new BitmapImage(this.selectedPortalItem.ThumbnailUri);
this.ThumbnailImage.Source = src;
}
// enable the show map button when a web map portal item is chosen
this.ShowMapButton.IsEnabled = (this.selectedPortalItem.Type == ItemType.WebMap);
}
private async void ShowMapButton_Click(object sender, RoutedEventArgs e)
{
// create a web map from the selected portal item
var webMap = await WebMap.FromPortalItemAsync(this.selectedPortalItem);
// load the web map into a web map view model
var webMapVM = await WebMapViewModel.LoadAsync(webMap, this.arcGISOnline);
// show the web map view model's map in the page's map view control
this.mainMapView.Map = webMapVM.Map;
}
}
}
... View more
06-11-2015
11:06 AM
|
0
|
4
|
5144
|
|
POST
|
Got it! If your internal proxy is blocking a request you are sending outside the domain and you're getting a 407 error - provided your internal proxy uses IWA, you can simply update your App.config XML to with the <system.net> tag and set the <defaultProxy useDefaultCredentials> property to True. <?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.net>
<defaultProxy useDefaultCredentials="True" />
</system.net>
</configuration>
... View more
06-11-2015
06:30 AM
|
0
|
0
|
1659
|
|
POST
|
Hi Loren, I seem to be running into this same issue. Would you mind sharing your updated code with me?
... View more
06-11-2015
04:16 AM
|
0
|
0
|
5358
|
|
POST
|
So, this is literally my first day writing a single line of C# and working with the .NET SDK. The Developer documentation has been really good thus far and I've been able to understand everything pretty well. Unfortunately, when I got towards the end of the third tutorial, I ran into a problem - my corporate proxy. Since this is my first day working with C#, I'm not sure how to build a function to use IWA to authenticate to our internal proxy. Any help or guidance is greatly appreciated. using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Esri.ArcGISRuntime.Controls;
using Esri.ArcGISRuntime.Portal;
using Esri.ArcGISRuntime.WebMap;
namespace FirstApp
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private ArcGISPortal arcGISOnline;
private ArcGISPortalItem selectedPortalItem;
// changes the basemap layer
private void baseMap_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
var combo = sender as ComboBox;
var sel = combo.SelectedItem as ComboBoxItem;
if (sel.Tag == null) { return; }
//Find and remove the current basemap layer from the map
if (mainMap == null) { return; }
var oldBasemap = mainMap.Layers["BaseMap"];
mainMap.Layers.Remove(oldBasemap);
//Create a new basemap layer
var newBaseMap = new Esri.ArcGISRuntime.Layers.ArcGISTiledMapServiceLayer();
//Set the ServiceUri with the url defined for the ComboboxItem's Tag
newBaseMap.ServiceUri = sel.Tag.ToString();
//Give the layer an ID so it an still be found with the code above
newBaseMap.ID = "BaseMap";
//Insert the new basemap layer as the first (bottom) layer in the map
mainMap.Layers.Insert(0, newBaseMap);
}
// searches the portal for content
private async void SearchButton_Click(object sender, RoutedEventArgs e)
{
try
{
if (this.arcGISOnline == null)
{
// create the uri for the portal
var portalUri = new Uri("https://gis.kdc.capitalone.com/portal/sharing/rest");
// create the portal
this.arcGISOnline = await ArcGISPortal.CreateAsync(portalUri);
}
// create a variable to store search results
IEnumerable<ArcGISPortalItem> results = null;
if (this.ItemTypeCombobox.SelectedValue.ToString() == "BaseMap")
{
// basemap search returns web maps that contain the basemap layer
var basemapSearch = await this.arcGISOnline.ArcGISPortalInfo.SearchBasemapGalleryAsync();
results = basemapSearch.Results;
}
else
{
// get the search term provided in the UI
var searchTerm = this.SearchTextBox.Text.Trim();
var searchItem = this.ItemTypeCombobox.SelectedValue.ToString();
// build a query that searches for the specified type
// ('web mapping application' is excluded from the search since 'web map' will match those item types too)
var queryString = string.Format("\"{0}\" type:(\"{1}\" NOT \"web mapping application\")", searchTerm, searchItem);
var searchParameters = new SearchParameters()
{
QueryString = queryString,
SortField = "avgrating",
SortOrder = QuerySortOrder.Descending,
Limit = 10
};
// execute the search
var itemSearch = await this.arcGISOnline.SearchItemsAsync(searchParameters);
results = itemSearch.Results;
}
// show the results in the list box
this.ResultListBox.ItemsSource = results;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error searching Atlas");
}
}
// resets the UI controls to keep them in sync with the currently selected portal item in the ResultsListBox
private void ResetUI()
{
// clear UI controls
this.SnippetTextBlock.Text = "";
this.ThumbnailImage.Source = null;
this.ShowMapButton.IsEnabled = false;
}
private void ResultSelectionChanged(object sender, SelectionChangedEventArgs e)
{
this.ResetUI();
// store the currently selected portal item
this.selectedPortalItem = this.ResultListBox.SelectedItem as ArcGISPortalItem;
if (this.selectedPortalItem == null) { return; }
// show the portal item snippet (brief description) in the UI
if (!string.IsNullOrEmpty(this.selectedPortalItem.Snippet))
{
this.SnippetTextBlock.Text = this.selectedPortalItem.Snippet;
}
// show a thumnail for the selected portal item (if there is one)
if (this.selectedPortalItem.ThumbnailUri != null)
{
var src = new BitmapImage(this.selectedPortalItem.ThumbnailUri);
this.ThumbnailImage.Source = src;
}
// enable the show map button when a web map portal item is chosen
this.ShowMapButton.IsEnabled = (this.selectedPortalItem.Type == ItemType.WebMap);
}
private async void ShowMapButton_Click(object sender, RoutedEventArgs e)
{
// create a web map from the selected portal item
var webMap = await WebMap.FromPortalItemAsync(this.selectedPortalItem);
// load the web map into a web map view model
var webMapVM = await WebMapViewModel.LoadAsync(webMap, this.arcGISOnline);
// show the web map view model's map in the page's map view control
this.mainMapView.Map = webMapVM.Map;
}
}
}
... View more
06-10-2015
04:11 PM
|
1
|
2
|
5111
|
|
POST
|
Does anyone know of a way to silently install a Data License (*.sdlic)? So far, I've tried: Creating the directory C:\Program Files\ESRI\DataLicense and placing the *.sdlic file in there as indicated in this legacy forum posting. Running the DataLicInstall.exe that ships with ArcGIS for Server against the *.sdlic file, but I get an error "Initialize ArcObjects Failed". Using AutoHotKey to manually install the license via simulated button clicks but unfortunately the Windows UAC button will not accept simulated button clicks, so when it is raised because the ArcGIS Administrator opens, the user still needs to press Yes to allow the ArcGIS Administrator to make changes to the computer. This doesn't make any sense. There has to be a way to silently install a data license!
... View more
12-31-2014
06:19 AM
|
0
|
0
|
4658
|
|
POST
|
ESRI's10.3 Help Documentation is out and wow, it is...different. I myself preferred the legacy format over the new one but I'm interested to hear what others think about it. If you haven't seen it yet, hop on over to Help | ArcGIS Resources and click on the product for 10.3 you're interested in. Do you think the new design is an improvement? Personally, I'm finding it to be a little less detailed than the legacy documentation format and I'm having trouble finding things. Hopefully though, that's just because I'm not really familiar with this new document structure yet.
... View more
12-27-2014
12:03 PM
|
0
|
6
|
4635
|
|
POST
|
Ah, now I understand. Unfortunately I didn't see this until I had already solved my problem and came back to report my solution. What I ended up doing was actually just building a multipoint geometry and then grabbing the extent of that geometry object.
elif rowCount > 1:
if row[0].type == 'point':
array = arcpy.Array()
with arcpy.da.SearchCursor(FeatureLayer, "SHAPE@", searchQuery) as rows:
for row in rows:
array.add(row[0].trueCentroid)
points = arcpy.Multipoint(array)
df.extent = points.extent
arcpy.RefreshActiveView()
else:
print "Geometry is: " + str(row[0].type)
I think your solution is probably a little more flexible in that it will account for any geometry type. Mine on the other hand is only going to work for points.
... View more
10-23-2014
02:44 PM
|
0
|
2
|
3805
|
|
POST
|
I'm not sure I follow. I get what the function is doing, but I need to pass an extent object into your function. What I'm looking to do is get an extent for all of the records returned by a search cursor, so how would I pass the search cursor's returned records into the GetExtent function when it takes an extent object as it's parameter?
... View more
10-23-2014
12:17 PM
|
0
|
4
|
3805
|
|
POST
|
Niiice. So obvious once I saw it. Sorry, I already gave the answer to James.
... View more
10-23-2014
10:43 AM
|
0
|
0
|
3789
|
|
POST
|
What is a good way to get an extent object for the features returned by a da.SearchCursor with a where_clause applied? Certainly, I could apply a selection to the FeatureLayer and then use the getSelectedExtent method on the Layer object but frankly, I find SelectLayerByAttribute_management to be an expensive transaction. Add to this that I would also need to go back and clear the selection too. I just want to zoom to the extent of the returned features of the SearchCursor. Ideas?
with arcpy.da.SearchCursor(FeatureLayer, "SHAPE@", searchQuery) as rows:
rowCount = 0
for row in rows:
rowCount = rowCount + 1
print str(rowCount)
if rowCount == 0:
pythonaddins.MessageBox("No features found which meet criteria.",
"ERROR: INVALID SEARCH CRITERIA", 0)
return
elif rowCount == 1:
if row[0].type == "point":
extent = row[0].extent
df.extent = extent
df.scale = 5000
arcpy.RefreshActiveView()
del extent
del rows
else:
print "Geometry is: " + str(row[0].type)
return
elif rowCount > 1:
# so...now I have a bunch of features/rows returned..hmm
# how to go about getting the full extent for these
# returned features without applying a selection
... View more
10-23-2014
10:31 AM
|
0
|
6
|
8863
|
|
POST
|
Thanks James, I was trying to avoid making a query table but it seems that's the the quickest approach that doesn't require iterating. However using the MakeQueryTable tool did require spinning up the geoprocessor which took some time so in the end I actually found it was still faster to just iterate and count the rows.
with arcpy.da.SearchCursor(FeatureLayer, "SHAPE@", SuperDuperAwesomeQuery) as rows:
rowCount = 0
for row in rows:
rowCount = rowCount + 1
print rowCount
del rows
... View more
10-23-2014
09:52 AM
|
0
|
0
|
3789
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 06-11-2015 12:02 PM | |
| 2 | 02-04-2016 02:35 PM | |
| 1 | 04-11-2017 12:51 PM | |
| 1 | 08-07-2015 11:00 AM | |
| 4 | 06-19-2015 01:44 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|