|
POST
|
I am trying to create a simple ArcGIS Server SOAP consumer by C# like below snippet but I am getting error on NAService_NAServer as illustrated in attached image. Can you please let me know which namespace I have to use? I am already using this namespaces using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Server;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Carto; but they are not doing the job! using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Server;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Geodatabase;
using ESRI.ArcGIS.Carto;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
private void SolveRoute()
{
// Connect to server
NAService_NAServer naService = new NAService_NAServer();
naService.Url = "http://localhost/ArcGIS/services/NetworkAnalysisService/MapServer/NAServer");
//Get Route layers
string[] routeLayers = naService.GetNALayerNames(esriNAServerLayerType.esriNAServerRouteLayer);
// Get the default settings for the first route layer
NAServerRouteParams naServerRouteParams = (NAServerRouteParams)naService.GetSolverParameters(routeLayers[0]);
// Create 2 stops as property sets
List<PropertySet> propertySets = new List<PropertySet>(2);
propertySets.Add(CreatePropertySet("My starting point", -117.195905, 34.057783));
propertySets.Add(CreatePropertySet("My ending point", -117.180943, 34.056286));
// Set the property sets on a NAServerPropertySets object and set on the routeParams object
NAServerPropertySets naServerPropertySets = new NAServerPropertySets();
naServerPropertySets.PropertySets = propertySets.ToArray();
naServerRouteParams.Stops = naServerPropertySets;
// specify to return compact directions
naServerRouteParams.ReturnCompactDirections = true;
// Solve
NAServerRouteResults naServerRouteResults = (NAServerRouteResults)naServer.Solve(naServerRouteParams);
// Output directions
NACompactStreetDirections streetDirections = naServerRouteResults.CompactDirections[0];
StringBuilder sb = new StringBuilder();
sb.AppendFormat("DriveTime = {0}", streetDirections.Summary.TotalDriveTime);
sb.AppendLine();
foreach (NACompactStreetDirection streetDirection in streetDirections.Directions)
{
sb.AppendLine(streetDirection.Text);
}
Console.WriteLine(sb.ToString());
}
}
}
}
... View more
09-08-2017
12:40 PM
|
0
|
0
|
641
|
|
POST
|
Using following ArcPy snippet, I am able to get Extent of current map import arcpy
import arcpy.mapping
## Sets the MXD file
IMXD = arcpy.mapping.MapDocument("CURRENT")
## Sets the Dataframe
DF = arcpy.mapping.ListDataFrames(IMXD, "Layers")[0]
print DF.extent as: 417939.472327849 241487.977474999 477757.540444938 363798.333225001 NaN NaN NaN NaN can you please let me know how I can grab the Envelop value from This?
... View more
09-05-2017
03:11 PM
|
0
|
0
|
759
|
|
POST
|
Can you please let me know how I can list all layers inside a saved .mxd map and also get list of layers inside a SDE database connection using c# and ArcObjects? For example if I have a map document like "C:/GIS/Project.mxd" and a sde connection to enterprise geodatabase like "projects.sde" under database connection node, h lo w can I get access to them and list their contents? I know how to do this using Python - ArcPy scripting like import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\GIS\Project.mxd")
df = arcpy.mapping.ListDataFrames(mxd, "")[0]
for lyr in arcpy.mapping.ListLayers(mxd, "", df):
print lyr.name But couldn't find a solution for ArcObject!
... View more
08-29-2017
08:34 AM
|
0
|
1
|
1636
|
|
POST
|
Thanks Rebecca, I already spend some time there but it was not really helpful as it mainly focus was on fixing broken links
... View more
08-29-2017
08:20 AM
|
0
|
0
|
1387
|
|
POST
|
Thanks Asrujit SenGupta but still getting same error
... View more
08-28-2017
11:04 PM
|
0
|
1
|
1387
|
|
POST
|
Can you please take a look at this example and let me know how to I can replace Data Source data of a layer in a saved mxd map (Fuse) to a layer called SDEElectric.DBO.Fuse which is in an enterprise geodatabase through database connection I tried this code but it didnt work import arcpy
mxd = arcpy.mapping.MapDocument(r"C:\GIS\Maps\Electric.mxd")
src =r"C:\Users\xxx\AppData\Roaming\ESRI\Desktop10.4\ArcCatalog\SDEElectric.sde\SDEElectric.DBO.Dataset\SDEElectric.DBO.Fuse"
df = arcpy.mapping.ListDataFrames(mxd, "")[0]
for lyr in arcpy.mapping.ListLayers(mxd, "", df):
if lyr.name == "Fuse":
lyr.replaceDataSource(src, "FILEGDB_WORKSPACE", "")
mxd.save()
del mxd
print "done"
... View more
08-28-2017
09:40 PM
|
0
|
5
|
2422
|
|
POST
|
I have seen this ArcGIS Runtime SDK for Java for Geometric Network Tracing on Java, but couldn't find any sample for .Net C# runtime SDK. Can you please let me know if there is any place to find a sample application or code to reproduce or documented the Geometric Network Tracing on .Net?
... View more
08-15-2017
02:44 PM
|
1
|
1
|
1319
|
|
POST
|
I am trying to re-produce the demonstrated sample at this link but I am not finding the ESRI.ArcGIS.Client any where in .Net Runtime SDK references or even from "Add ArcGIS Reference" wizard from Arc Object tools but still not seeing any ESRI.ArcGIS.Client Can you please let me know how to fix this?
... View more
08-15-2017
10:36 AM
|
0
|
1
|
1010
|
|
POST
|
Using Following code from ArcGIS JavaScript API 3.21 , I am trying to display a converted map to kmz file by ArcMap at ArcGIS JavaScript API var map;
require([
"esri/map", "esri/layers/KMLLayer",
"dojo/parser", "dojo/dom-style",
"dijit/layout/BorderContainer", "dijit/layout/ContentPane", "dojo/domReady!"
], function(
Map, KMLLayer,
parser, domStyle
) {
map = new Map("map", {
basemap: "topo",
center: [-108.663, 42.68],
zoom: 6
});
parser.parse();
var kmlUrl = "http://mydomain.com/data/app.kmz";
var kml = new KMLLayer(kmlUrl);
map.addLayer(kml);
kml.on("load", function() {
domStyle.set("loading", "display", "none");
});
}); I have an .mxd map which looks like with an inserted white TEXT "Map Of Some Where" in the middle. I used the Map to KML tool to export the map to kml file but the output on ArcGIS API looks like when I load it to API map (Without inserted TEXT) Can you please let me know why this is happening and how I can fix this?
... View more
08-09-2017
09:52 AM
|
0
|
0
|
656
|
|
POST
|
Great, Thanks a lots John, but I am getting an error on my side! I download the `sflnds_current.zip` file from your sample server and load it to localhost directory at http://localhost/Portal/ I also copy entire code of the demo page you gave me and updated the urlToExternalZippedShapefile as below var urlToExternalZippedShapefile = "http://localhost/Portal/";
var zippedShapefileName = "sflnds_current"; but when I run the code I am getting this error message: Cannot read property 'expand' of undefined Can you please let me know what I am doing wrong here? Again Thanks
... View more
08-08-2017
10:26 AM
|
0
|
1
|
1674
|
|
POST
|
ArcGIS JavaScript API is using This Demo to upload and pass a Zipped shapefile to esriRequest using "esri/request" module. Now my question is is there any way that we load and pass a zipped shaefile from Server and not from client side like accessing the file by Ajax? at current demo , thr form option is filling by `uploadForm` elemt by user submit at form: dom.byId('uploadForm'), request({
url: portalUrl + '/sharing/rest/content/features/generate',
content: myContent,
form: dom.byId('uploadForm'),
handleAs: 'json',
load: lang.hitch(this, function (response) {
if (response.error) {
errorHandler(response.error);
return;
}
var layerName = response.featureCollection.layers[0].layerDefinition.name;
addShapefileToMap(response.featureCollection);
}),
error: lang.hitch(this, errorHandler)
}); Now, I need to pass a file directly to the options instead of using HTML File Dialog and Input. Something like:
//Get the zipped file from Ajax Call and pass it to a data variable
var data = "www.domain.com/GIS/App.ZIP";
// assign form with data
request({
....,
form: data,
....
});
... View more
08-06-2017
09:41 AM
|
0
|
4
|
2165
|
|
POST
|
Thomas & John , thank you both for replying but what I need is not loading from from client machine! I need to pass the zip file which is sitting on the server. like referencing to a URL in ajax call var data = "www.domain.com/GIS/App.ZIP";
... View more
08-04-2017
09:26 AM
|
0
|
1
|
2054
|
|
POST
|
The esriRequest is used for retrieving data from a remote server or uploading a file. The Request has a Form option which is used If the request is to upload a file. We specify the form element that contains the file input control here (As below sample). request({
url: portalUrl + '/sharing/rest/content/features/generate',
content: myContent,
form: dom.byId('uploadForm'),
handleAs: 'json',
load: lang.hitch(this, function (response) {
if (response.error) {
errorHandler(response.error);
return;
}
var layerName = response.featureCollection.layers[0].layerDefinition.name;
addShapefileToMap(response.featureCollection);
}),
error: lang.hitch(this, errorHandler)
}); Now, I need to pass a file directly to this options instead of using HTML File Dialog and Input. something like var data = "www.domain.com/GIS/App.ZIP";
request({
....,
form: data,
....
}); Thanks
... View more
08-03-2017
11:28 PM
|
0
|
4
|
3036
|
|
POST
|
Hi Bradley, ESRI is not doing well on documenting Server stuff. Here is what I got by experience The perReplica sync model is applicable for Versioned data. The perLayer sync model is applicable for Non-versioned archived data. Hope it helps
... View more
07-25-2017
08:32 AM
|
1
|
1
|
1903
|
|
POST
|
I am able to create Two Way Replica from ArcGIS Server 10.4.1 which has a Feature service containing only one Feature Class( Transformers feature class) and I am getting a file like _ags_data{01D644C0D8F0434DA6E65607141EC0EC}.geodatabase in ArcGIS Server directory C:\arcgisserver\directories\arcgisoutput\Test_MapServer after creating the Replica. Now I would like to check this file in an ArcMap session. I tried to connect to it through Database Connection tool but there is not any support for SQLLite on there. I also tried this link to Connect to SQLite from ArcGIS for Desktop but it says that the file must have the extension .sqlite (or .SQLITE or .SQLite) and not .geodatabase Can you please let me know if there is a way to see the actual data in the _ags_data{01D644C0D8F0434DA6E65607141EC0EC}.geodatabase through ArcMap? I already tried to open the file by SQLLite Studio but the Feature class Transformers table in empty! so where are the actual attributes?
... View more
07-14-2017
09:29 AM
|
0
|
1
|
1147
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-25-2017 08:32 AM | |
| 1 | 07-04-2017 01:47 PM | |
| 1 | 08-15-2017 02:44 PM | |
| 1 | 05-19-2017 02:36 PM | |
| 1 | 02-09-2017 12:37 PM |
| Online Status |
Offline
|
| Date Last Visited |
12-31-2020
08:22 PM
|