|
POST
|
Hi This is ArcObjects question. This code works for me: IPropertySet propertySet = new PropertySetClass();
string agsUrl = "http://mody-pc:6080/arcgis/services";
string serviceName = "MosaicMap";
propertySet.SetProperty("url", agsUrl);
//Open an AGS connection.
Type factoryType = Type.GetTypeFromProgID("esriGISClient.AGSServerConnectionFactory");
IAGSServerConnectionFactory agsFactory = (IAGSServerConnectionFactory)Activator.CreateInstance(factoryType);
IAGSServerConnection agsConnection = agsFactory.Open(propertySet, 0);
IName pName = null;
IAGSEnumServerObjectName agsServerObjectNames = agsConnection.ServerObjectNames;
agsServerObjectNames.Reset();
IAGSServerObjectName agsServerObjectName = agsServerObjectNames.Next();
while (agsServerObjectName != null)
{
if (agsServerObjectName.Type == "MapServer")
{
pName = (IName)agsServerObjectName;
IAGSServerObject agsServerObject = (IAGSServerObject)pName.Open();
// do something
}
agsServerObjectName = agsServerObjectNames.Next();
}
... View more
01-23-2016
10:03 PM
|
0
|
0
|
878
|
|
POST
|
Hi I think I found a great solution (Dan post gave me the idea). We work so much with complex software that we forget how quick a computer is when it just do in memory calculation. The code below sort the point by distance (direct distance). It is running in memory and takes less the 3 seconds for 2000 points (including reading and writing to layer). import arcpy
import sys
import traceback
import math
points = arcpy.GetParameterAsText(0)
# globals
coords = []
order = []
# find the closest point that is not connected
def FindClosest(x,y):
global coords
global order
max1 = 1000000000000
closest = -1
for i in range(0, len(order)):
if (order != 0): continue
# noo need for sqrt - just looking for the smallest
dist = math.pow((coords[0] - x),2) + math.pow((coords[1] - y),2)
if (dist < max1):
max1 = dist
closest = i
return closest
try:
#read into memory
with arcpy.da.SearchCursor(points, ["SHAPE@X", "SHAPE@Y"]) as cursor:
for row in cursor:
p = [row[0],row[1]]
coords.append(p)
order.append(0)
arcpy.AddMessage("read %s records" % len(coords))
# first record
next1 = 2
order[0] = 1
x1 = coords[0][0]
y1 = coords[0][1]
# endless loop until we have no free points
while(True):
x = FindClosest(x1,y1)
if(x == -1): break # done
order = next1
x1 = coords [0]
y1 = coords [1]
next1 = next1 + 1
# update results
i = 0
with arcpy.da.UpdateCursor(points, ["order1"]) as cursor:
for row in cursor:
row[0] = order
cursor.updateRow(row)
i = i + 1
#for i in range(0,len(order)):
# arcpy.AddMessage("point %s order = %s" % (order,i))
except:
... View more
01-16-2016
09:58 PM
|
1
|
0
|
2368
|
|
POST
|
Hi Dan The route is not going in one direction only but it might be a good idea to order the points by ariel distance first and then run the route in this order. Do you know any ready to use tool that will order the point (starting from a known point) or do I have to write it? Thanks
... View more
01-14-2016
10:23 PM
|
0
|
1
|
2368
|
|
POST
|
We have a network dataset with around 300k lines. We have a car that has to do inspections on some elements along a route. It needs to visit 500-700 elements (most of them are close to each other). The points create one simple route but are not ordered. The way we solve the problem is to load the points as steps and to ask for best order route (usually the first point is really the start). It creates a good route that visits every element. The only problem is the time it takes. About 7 minutes to 700 points. When the points is ordered it takes a few seconds. Is there any way to speed the best route algorithm? Thanks
... View more
01-14-2016
02:09 AM
|
0
|
7
|
4412
|
|
POST
|
Hello all We have a large mosaic with about 50k tiles. We created a reference mosaic on it and published it as Image service. Many users are displaying this image server. While everybody is showing the raster we try to AddRasters to the original mosaics. We sometime get an error that the AddRaster could not create a lock. In most times it works but still sometime the AddRaster fail. Why viewers are blocking us? My understanding was that the reference mosaic should handle these locks. Anybody have the same problem? Thanks
... View more
01-13-2016
08:01 AM
|
0
|
0
|
2233
|
|
POST
|
Hi Thanks for the quick response. To my understanding ESRI uses the display to be able to give different people different licenses even if they all connect under the same user So I think they will not implmented the DUP_DISPLAY. I would open a call a week ago if I sould repreduce it anywhere else or even at the site every time I try. It works fine in most cases and only show the problem a few times a day. Thanks
... View more
01-11-2016
06:09 AM
|
0
|
1
|
893
|
|
POST
|
Hello all I would like to share with you some of our cache problems and see if my understanding is correct and what can be done. I have a map service with many rasters all over the US. I would like the site to be faster for New York area. There are two scenarios: I define cache up to scale 1:4000 and build all levels for New York area only. I define cache up to scale 1:1000 and build up to level 1:4000 for New York area only. Now what happened if I am in scale 1:1000 in New York or Los angles? To my understanding in New York with option 1 I see resample of the cache and in option 2 I see nothing since the server does not find the tile that should be there. In Los Angles I see nothing in both cases since even the tile above does not exists and it cannot be resampled. What I would like to see is the dynamic data where cache does not exists even if it a little slower. Building tiles on demand is very slow and filling my disk without any control. One more problem is that if I update the data I have no idea where the cache is build and should be updated. We tried WMS connection. It is sowing cache where it exists and dynamic where it does not exist (without building real cache). It works well when you zoom in but when you zoom out to an area without cache it is very slow. It looks like it does not use the mosaic overviews. Anybody have a solution? Thanks
... View more
01-11-2016
05:57 AM
|
0
|
1
|
2545
|
|
POST
|
We are using Citrix with floating desktop licenses. In general a user can connect to the server and start two ArcMap processes and use just one license. This is the way CU license should work. Sometimes we see that the same user on the same connection takes two licenses. This is a big limitation on our number of users that can use the software. We sometime have 5-7 of these in a single day so it is a big problem. The problem is that it is not always the same. The same user sometimes takes one license and some other time takes two. Sometimes the second license is taken one minute after the first one but sometimes an hour later. When we check the lmutil we see that we have two lines with the same user and machine (Citrix server) but different display string. The server have virtual name. When we use the physical name we do not see the problem. Anybody heard about such a problem? Any idea what can we do? Thanks Mody
... View more
01-10-2016
10:25 PM
|
0
|
3
|
2944
|
|
POST
|
Hi After testing and checking I found that the IGeoProcessor2.Execute does use the parallel processing and the 64bit but works Async so there is really no problem here. Thanks
... View more
01-02-2016
09:34 PM
|
0
|
0
|
859
|
|
POST
|
Hello all I have a few dynamic map services (no cache). I need to create tpk for some area in order to put it on other machine that has no network connection (no need for vector data). I could not find any tool that support that operation All the raster tools (clip, etc) does not support map service The Export Map Service tool (under server tools) needs the map service to be cached. The Manage Map Service Tile cache (under server tools) will build the cache into the server directory The Create Map Tile Package (under package) does not have area of interest The Manage Tile Cache (under Tile Cache) docs say that it cannot get an mxd with map service Tring to use the Share in ArcMap (under file menu) gives error on map service layer. The only solution I can think about is to keep the original MXD and to use it for caching. This must be done on server and not on client side since the client does not necessarily have access to all the data. What is the solution? Thanks
... View more
12-28-2015
05:39 AM
|
0
|
0
|
2765
|
|
POST
|
Hi I would try to use the Calculate Geometry to create some numeric field from some property of the geometry. Then try to use this field in the expression. I am not sure what will be the values in your case but it should be easy to find after running a test. You will have to recalc the attribute after each geometry change. You can use the Add Geometry Attributes if you want everything in one script. Have fun Mody
... View more
12-20-2015
09:42 PM
|
1
|
1
|
4038
|
|
POST
|
I have an AddIn solution in VS2012 that was working fine in 10.1 Now I open it in 10.3 machine, fix the references and rebuild. The rebuild gives no mistakes. New dll's are created but the AddIn file is not created. Anybody have an idea? What in the solution is responsible for that build? I found nothing in the post build process. Thanks Mody
... View more
12-16-2015
07:11 AM
|
0
|
1
|
3110
|
|
POST
|
I am writing ArcObjects code inside Arcmap addin that executes many gp tools (one after another). I would like to use the 64bit and the parallel processing. My understanding is that I need to use the IGeoProcessor2.ExecuteASync but wait for the tool to finish before continue to the next tool I found this example: http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//0001000007r5000000 In my case I need the button to wait until the gp is done, this is because I need to run more pure ArcObjects code after each gp tool to check the results and possibly execute different tools. What I am really looking for is just the IGeoProcessor2.Execute original tool that uses 64bit or parallel processing but works synchronized. Anybody has done this? Thanks
... View more
12-01-2015
10:42 PM
|
0
|
2
|
3746
|
|
POST
|
Hi all The widget is great. Is there any option to search an element by name or description? It can be a nice enhancement. Thanks Mody
... View more
11-25-2015
10:41 PM
|
0
|
0
|
3081
|
|
POST
|
Hi I found that using arcpy.env.scratchGDB is much better then the %scratchworkspace% that I use to use. It is not replaced by anything when the tool is published. Using SetParameter when your return value is not text might help too Thanks all
... View more
11-22-2015
09:52 PM
|
1
|
0
|
1513
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 05-06-2026 09:35 PM | |
| 1 | 05-06-2026 09:43 PM | |
| 1 | 11-25-2024 06:09 AM | |
| 1 | 01-21-2026 09:53 PM | |
| 1 | 12-15-2025 10:07 PM |
| Online Status |
Online
|
| Date Last Visited |
yesterday
|