POST
|
Thanks Joe. I'm literally amazed that this is still a thing. 🙂 I don't work on this stuff anymore, but I remember seeing the webmap functionality when it was first introduced and being blown away. I expected to have to knock some rough edges like this off in the early versions, but it seems like Esri have left this to wither. Bit of a shame, cos we did some cool (for us) stuff with it. 🙂
... View more
02-06-2018
07:45 AM
|
0
|
0
|
1381
|
POST
|
Hi Christopher, I'm so sorry - I just got notified of your reply. Yes, that's exactly the JSON I meant. And as for commenting out the feature symbol, it's been so long since I've done this... If you pretty format Web_Map_as_JSON, I'm pretty sure you'll see the feature symbol I'm talking about. Sorry I can't be more detailed. Just either remove that from the feature, or literally insert commenting around it in the text. Your aim is simply to get rid of its overriding effects. Frank
... View more
02-06-2018
07:43 AM
|
1
|
1
|
1381
|
POST
|
Hi Kevin, Well, that worked. 🙂 I removed the following, to see if that was the magic, but thankfully it appears to be a no-op, so no hardcoding of paths at all! arcpy.env.scratchWorkspace = r"C:\temp\pppp" Your answer has resulted in a sub-one-line change to my code so that it now works. I could swear I was outputting to scratchFolder at some point, but I guess not. I must have been caught up in the whirling hall of knives that is the actual function of the script and never noticed. I think I now understand why 'setParameterAsText()' is your only choice and won't have my brain capsizing over the fact that, hey, it's a file, not a String! And that it's the way you wire up the script to the toolbox that let's Arc know that if it sees a string, but is told it's a File, it should interpret this as a path. Or a String and a Network Analyst Class Fieldmap and interpret this as heaven knows what. I don't think this is intuitively obvious to the overthinkers out here. It's certainly not spelled out anywhere. So, one last question, if I may? Since the whole point of this is to create something I can push into source control and deploy easily, would this be better in a Python Toolbox? I believe you can encapsulate the parameter 'wirings' inside that, can't you? Making one, small, neat piece of text in source control. Thanks a lot for your excellent, very rapid response. Frank
... View more
05-29-2014
10:27 AM
|
0
|
0
|
1376
|
POST
|
Hi, I am tearing out my hair (which I can ill afford to do) over being able to retrieve a file I create via a GP service. Very simplified:- 1. Let's say I have a Python script which takes no input parameters. 2. It creates a file called 'HelloWorld.txt', which is empty. That's it. This runs fine on the desktop and I can retrieve HelloWorld.txt. Yippee. When I publish this, successfully, and run it, successfully, I cannot for the life of me get the file. I've tried a lot of stuff: 1. Writing to 'nowhere', i.e. just HelloWorld.txt = written in job scratch area, result url goes to a scratch folder which gives an HTTP 400, Invalid URL. 2. Writing to 'scratch' via arcpy.env.scratchFolder = same as above 3. Writing to the 'current workspace' via arcpy.env.workspace = empty on server, same as above 4. Etc What it _appears_ I need to do is to somehow write to the 'Output Directory' specified for the service, which has a nice accompanying 'Virtual Directory'. Am I right? How on earth do I get this location? Would doing that even cause the url to be mapped to that location? Why is this so hard? 🙂 You just publish a GP result, right? Hooray! Sorry. You can probably tell this has my mind in knots. Please, if someone could provide the Python snippet that will do this, I would be most grateful. I might even make a T Shirt out of it, grow a beard and travel the world evangelizing about it, because this should be EASY, front and center whenever someone outputs a file as a script result and wants to publish it. I'm asking for a Python snippet, rather than a URL to help docs, because "I've been everywhere, man!" and really doubt those will shed any light. DO NOT let this put you off attempting to help, however. 🙂 I'll be truly grateful for any crumbs. I just wanted it to work like the print task works. You get a nice URL that you download from and go on with your life. This seemed like it must be a five minute job. Tops. Thanks for listening! Frank
... View more
05-29-2014
08:23 AM
|
1
|
5
|
5008
|
POST
|
Hi, I can tell you what the underlying problem probably is, though we use the JS API. Looking at the JSON sent to the print service, your graphics layer has a null renderer and your graphics features are symbolized. The feature symbols are therefore overriding the renderer symbols and the map is giving them the friendly label of 'Override 1', 2, etc. If you mess with the JSON to create a renderer such as: "renderer": { "type":"simple", "label": "My Label", "symbol":{ "color":[0,0,0,128], "outline":{ "color":[0,0,0,255], "width":0.75, "type":"esriSLS", "style":"esriSLSSolid" }, "type":"esriSFS", "style":"esriSFSSolid" } } And then comment out the feature symbol (or else you'll still override), submitting the JSON to the print task will show 'My Label' in the Legend. I'm not sure what the implications of all this are, either in Flex or JS, but if this god-like insight :rolleyes: is of any help, please post. Thanks, Frank
... View more
04-24-2013
08:50 AM
|
2
|
5
|
1381
|
POST
|
I'll provide my own 'solution' here. 🙂 We're talking ArcGIS 10.1, no service pack, if it makes a difference. The problem is that publishing only takes 'half' of the symbology for a more complex case. Example: I have two GP output feature sets. One simply symbolizes all shapes with a border color, irrespective of feature contents. The other symbolizes based on a type field within each feature. Both symbologies are set directly on the ModelBuilder output parameters. When the model is run in ArcMap, the results are correctly symbolized on screen for both feature sets. It's publishing the result that is the problem. If I publish the result without changes, the first, simple map service symbolizes correctly. The second, complex case, however, takes only 'half' of the symbology. The features are correctly discriminated in terms of the type field, so the break is correct and the features are identifiable by type, but the colors are not carried over. Rather, a default set of colors seems to be applied. Meaning that I can see something is a 'plant', but it's bright red, instead of green. This is particularly problematic if the original layer that was subset to produce the output already uses bright red for another type. The solution is to re-apply the layer files to the outputs on the map before publishing the result. I know this is what the docs say to do, but I don't understand why the 'half-cooked' situation is happening. Well, I suspect a bug, but there you go. It would be wonderful if a model could fully encapsulate the treatment of its outputs. Thanks, Frank
... View more
02-26-2013
06:00 AM
|
0
|
0
|
144
|
POST
|
Hi, I have a geoprocessing service which exports its results as a map service. I use this to produce a printable map via the Export Web Map utility. The issue I'm having is the seemingly odd designation of colors for the output layer. I've symbolized the output with the exact same layer file I use for the input (output is basically a subset of input) and the colors are completely different, though consistently (as far as I can tell) completely different, i.e. the same odd palate is used each time. Does anyone have any clues? Thanks, Frank
... View more
02-19-2013
10:18 AM
|
0
|
1
|
439
|
POST
|
Hi Wayne, I went with %scratchworkspace% for the buffered area and it now works, with your tip about the 'Overwrite' setting in place. Thank you. I've published my service and all is well so far. Though now I have to dig about layer symbologies in the output results... Thanks again, Frank
... View more
10-25-2012
07:47 AM
|
0
|
0
|
420
|
POST
|
So do you want to overwrite the existing output? If so, set the overwriteOutput property on: arcpy.env.overwriteOutput = True # long day I guess, oh boy, I had this set to False! Hi Wayne, Thanks for the reply, which made me realize that I didn't specify that my model is built in ModelBuilder - of Python I know nothing. 🙂 I do want to overwrite the result, kind of, but it's the scratch folder I'm most interested in. My understanding of specifying outputs to go to %scratchfolder% is that this is guaranteed by Arc to be available wherever you deploy and also (my understanding again) allows a published geoprocessing web service to create new scratch folders for each service call, so 2 simultaneous service calls are guaranteed not to collide. I'm worried that just specifying C:\Temp (or similar) will force every service call to use that folder, leading to contentions and race conditions and lord knows what else. Like to avoid those. 🙂 As the whole 10.1 geoprocessing service publishing process is nothing short of a dream come true (though, y'know, my dreams might be a bit on the unambitious side) it's a royal PITA to have my model hiccup and not let me get on with life. I was flying there, for a while. Thanks, Frank
... View more
10-24-2012
08:43 PM
|
0
|
0
|
420
|
POST
|
This is happening on Windows 2008 R2 Enterprise SP1. I have built a model in ModelBuilder that (in summary) takes a feature set, does a whole load of spatial unions, buffers the input feature set to 2 miles and then does a final spatial join with that on another feature set. All the union results are parameters, as is the buffered shape. I have all the results outputting to %scratchfolder%\quads, %scratchfolder%\project_buffered, etc. Everything apart from the buffering runs fine. I am seeing the following when I get to the running of the buffer tool: ERROR 000210: Cannot create output C:\Users\frank_mclean\Documents\ArcGIS\scratch\project_buffered Failed to execute (Buffer). 1. The project_buffered shapefile actually seems to be created just fine. 2. I am running ArcMap as an administrator. 3. If I change the buffer output to be something like 'C:\Temp\project_buffered', the model runs fine. With the issue then, of source, that if I rerun the model, it basically won't, because 'C:\Temp\project_buffered' already exists. So, my questions are: 1. What's going on? 🙂 2. I'm going at all this to get a result so I can publish the model as a service. If I do a hack like point 3, above, will I be able to publish the service and not worry that whenever it runs it won't use an appropriate scratch area? By which I mean can I be assured of this, not just try it and see it works and then bet the farm? 🙂 Thanks, Frank
... View more
10-24-2012
12:26 PM
|
0
|
4
|
2576
|
POST
|
Hi, We have a national (US Lower 48) 30m grid raster and wish to overlay a polygon and get the raster cell values included. We are having a terrible time getting anything to work. I think we know we need to use Spatial Analyst, which is fine, but does anyone have working sample Java code which does this? Ideally a few-liner that checks out the license, etc. The raster would either live in an SDE or file geodatabase. We're just getting a variety of unhelpful error messages whatever we try, e.g. 'Unspecified Error'. On another note, providing our polygon is pretty small, should we expect reasonable performance? We will be hosting our app locally to the data, to avoid network latency. Thanks very much in advance to anyone who can help. Frank
... View more
10-13-2011
07:08 AM
|
0
|
1
|
726
|
POST
|
Hi, This sounds like it might be related to a confirmed newly created bug within ArcGIS 10 - Bug Report Number NIM071209, although my issue happens specifically when a raster is deleted, not simply loaded. I should have reported the 'resolution' to the forum - my apologies. I guess I thought this official report would show up in other searches. I'm quoting below the full 'shake-out' of the issue I received from esri support. Basically (when deleting), if your raster pathname is too long, you get a stack dump. If it's a little shorter, you get a thrown exception. If it's short enough, all is well. Lengths are in the quoted response below in the Steps to Reproduce section. Note that Tiffs don't show this issue. I suggested that an 'OS delete' of the raster might be possible as a workaround, but the intertwined nature of the various supporting files means that there is a great danger of corruption, unless you only have one raster in your workspace, when you could just delete the directory. Hope this helps. Thanks, Frank Frank, I have submitted the below bug report since the issue did not exist in ArcGIS 9.3/9.3.1 thus I have determined the pathname length issue is not by design but rather a bug. Please consider using less lengthy paths. As this issue still needs to be evaluated by our development team, I cannot provide a known length that you can count on. In the meantime, please consider staying within the 106 folderName length you have observed, but also within a total of approximately 114 characters, which includes the dataset name itself (106 folderName + \ + 8 datasetName = 115). The known limit for a GRIDs dataset name is 13 characters, thus, if you go up to 13 characters for the dataset name, account for this in the folderName such that the total folderName and datasetName is approximately 115: LINK: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009t0000000w000000 Frank, I will now close this support incident. Please use the bug report number to track the progress of the bug from this point forward, as well as to escalate the bug report if you would like to do so. The best place to get this information is from the "My Support Portal", available through a link on the Support Services website at: http://support.esri.com or you can go directly to the "Esri Customer Care Portal" here: http://Customers.esri.com Bug Report Information ---------------------- Bug Report Number: NIM071209 Synopsis: In ArcGIS 10, deleting an Esri GRID in ArcCatalog or with IDataset.Delete() will either produce an error or will crash the application when directory path is beyond a certain length. Long description: In an ArcGIS Engine 10 console application, deleting an Esri GRID raster file with IDataset.Delete() will either result in a thrown exception at IDataset.Delete() or the console application will crash after IDataset.Delete() is called. It has been observed that this occurs beyond a given length of the directory path or file name path where the GRID is stored on disk. The same is produced in ArcCatalog or with ArcMap's Catalog window, where either an error or application crash occurs when attempting to manually delete within Catalog. Note 1: Testing in ArcGIS 9.3.1 SP2 with the same GRID raster and same length in directory/file path does not produce the issue, only in version 10 of ArcGIS. Although a crash in ArcGIS 10 may also be seen when attempting to add or paste a GRID to the same folder location where the Delete causes a crash or exception, customers may be working with GRIDs that were already located in that location prior to version 10 so now they have to modify the location of these files and their source code. Note 2: Testing in ArcGIS 10 with a .tif (TIFF) instead of a GRID does not produce the issues. STEPS TO REPRODUCE: 1. Open EngineConsole950753.sln (ArcGIS Engine 10 console application) 2. Prepare to copy the attached GRID file, compati1, to the three different directory locations that will be tested in the subsequent steps. Please create those directories in Windows Explorer as needed. 3. Test/Start debugging the first directory path location with folderName length of 137: "C:\Projects\usfws\EasternShore\Vista_EasternShore\GIS_Datasets\Scenarios\Current_Landuse_Baseline\Evaluations\Baseline_Ecological_Systems" = console application will crash after calling IDataset.Delete() method. Attempting to manually delete the same in ArcCatalog or ArcMap's Catalog window will cause ArcCatalog or ArcMap to crash, as well. 4. Test/Start debugging the first directory path location with folderName length of 109: "C:\Projects\usfws\EasternShore\Vista_EasternShore\GIS_Datasets\Scenarios\Current_Landuse_Baseline\Evaluations" = IDataset.Delete() will throw the following Exception: "Exception from HRESULT: 0x8004101B" Attempting to manually delete the same in ArcCatalog or ArcMap's Catalog window will cause ArcCatalog or ArcMap to display an error message box with the following message: "Failed to delete selected object(s)" 5. Test/Start debugging the first directory path location with folderName length of 97: "C:\Projects\usfws\EasternShore\Vista_EasternShore\GIS_Datasets\Scenarios\Current_Landuse_Baseline" = IDataset.Delete() method successfully deletes the GRID file. Also, deleting the same GRID file in ArcCatalog or ArcMap's Catalog view does not produce any issues. --- Regards, Edgar B.
... View more
10-11-2011
06:23 AM
|
0
|
0
|
332
|
POST
|
Hi, I have migrated our Desktop extension from 9.3 to 10 - C# using VS2008, deployed on Windows XP Pro, SP3. I am getting the following crash, when the software tries to delete a raster file on disk using .Delete(): Problem signature: Problem Event Name: BEX Application Name: ArcMap.exe Application Version: 10.0.2.3200 Application Timestamp: 4d9bad9f Fault Module Name: RasterIO.dll Fault Module Version: 10.0.2.3200 Fault Module Timestamp: 4d9b750a Exception Offset: 00035690 Exception Code: c0000409 Exception Data: 00000000 OS Version: 6.0.6002.2.2.0.272.7 Locale ID: 1033 Additional Information 1: f3fb Additional Information 2: 76cb28eb10e2a4f22903a981f9d7609e Additional Information 3: 39e6 Additional Information 4: e6c1cee561b673e1a7d4d2f425db536e Searching the forums, it looks like a similar problem has been reported when there are spaces in the raster path - in this case there are definitely not. The odd thing is that the crash happens after a call to .CanDelete() is successful: IRasterDataset rasterDS = this.openRasterDataset();
IDataset dataset = rasterDS as IDataset;
if (dataset != null)
{
if (!dataset.CanDelete())
{
return false;//can't be deleted
}
dataset.Delete(); The crash happens during the .Delete() call. Can anyone please help? I can't trace this any further. Thanks, Frank
... View more
07-26-2011
06:51 AM
|
0
|
3
|
441
|
Title | Kudos | Posted |
---|---|---|
1 | 02-06-2018 07:43 AM | |
2 | 04-24-2013 08:50 AM | |
1 | 05-29-2014 08:23 AM |
Online Status |
Offline
|
Date Last Visited |
02-08-2021
11:45 AM
|