POST
|
Thank you! I can't believe I didn't see that before, I kept skipping down to the code example.
... View more
11-22-2011
04:46 PM
|
0
|
0
|
146
|
POST
|
I'm currently using a widgetgroup on our Flex Viewer site. I'd like to change the icon for it from a folder to a custom icon. I'm assuming to do this I need to edit the mxml for the headercontrolwidget, but I can't quite figure out where in the mxml it specifies the icon. Any help guiding me to the location to set this would be greatly appreciated!
... View more
11-22-2011
04:02 PM
|
0
|
2
|
1676
|
POST
|
I'm trying to add popups to the results of my geoprocessing service. My xml was working fine until I started trying to add this feature, so I know this is where the problem is. I was a little unclear in the documentation if the popups should be part of the renderer. Any help would be greatly appreciated!!! <outputparams>
<param name="final_output"
geometrytype="polygon"
label="final_output"
required="true"
type="featurerecordset"
visible="true">
<popups>
<title="Economic Growth">
<fields>
<field name="value"
visible="true">
<format precision="-5">
</fields>
</popups>
<renderer type="classbreaks" attribute="value">
<defaultsymbol
color="0xFCBBA1" alpha="0.9"
type="simplefill">
<outline width="1" color="00000000"/>
</defaultsymbol>
<infos>
<symbol color="0x67000D" alpha="1.0"
type="simplefill"
min="-100.0"
max="-0.028802">
<outline color="00000000" width="1"/>
</symbol>
<symbol color="0xA50F15" alpha="1.0"
type="simplefill"
min="-0.028801"
max="-0.001304">
<outline color="00000000" width="1"/>
</symbol>
<symbol color="0xCB181D" alpha="1.0"
type="simplefill"
min="-0.001304"
max="-0.000911">
<outline color="00000000" width="1"/>
</symbol>
<symbol color="0xEF3B2C" alpha="1.0"
type="simplefill"
min="-0.000911"
max="-0.000621">
<outline color="00000000" width="1"/>
</symbol>
<symbol color="0xFB6A4A" alpha="1.0"
type="simplefill"
min="-0.000621"
max="-0.000247">
<outline color="00000000" width="1"/>
</symbol>
<symbol color="0xFC9272" alpha="1.0"
type="simplefill"
min="-0.000247"
max="-0.000120">
<outline color="00000000" width="1"/>
</symbol>
<symbol color="0xFCBBA1" alpha="1.0"
type="simplefill"
min="-0.000120"
max="-0.000050">
<outline color="00000000" width="1"/>
</symbol>
<symbol color="0xFEE0D2" alpha="1.0"
type="simplefill"
min="-0.000050"
max="-0.000010">
<outline color="00000000" width="1"/>
</symbol>
<symbol color="0xFEE0D2" alpha="1.0"
type="simplefill"
min="-0.000010"
max="0.0">
<outline color="00000000" width="1"/>
</symbol>
<symbol color="0xDEEBF7" alpha="1.0"
type="simplefill"
min="0.0"
max="0.000010">
<outline color="00000000" width="1"/>
</symbol>
<symbol color="0xDEEBF7" alpha="1.0"
type="simplefill"
min="0.000010"
max="0.000050">
<outline color="00000000" width="1"/>
</symbol>
<symbol color="0xC6DBEF" alpha="1.0"
type="simplefill"
min="0.000050"
max="0.000120">
<outline color="00000000" width="1"/>
</symbol>
<symbol color="0x9ECAE1" alpha="1.0"
type="simplefill"
min="0.000120"
max="0.000247">
<outline color="00000000" width="1"/>
</symbol>
<symbol color="0x6BAED6" alpha="1.0"
type="simplefill"
min="0.000247"
max="0.000621">
<outline color="00000000" width="1"/>
</symbol>
<symbol color="0x4292C6" alpha="1.0"
type="simplefill"
min="0.000621"
max="0.000911">
<outline color="00000000" width="1"/>
</symbol>
<symbol color="0x2171B5" alpha="1.0"
type="simplefill"
min="0.000911"
max="0.001304">
<outline color="00000000" width="1"/>
</symbol>
<symbol color="0x08519C" alpha="1.0"
type="simplefill"
min="0.001304"
max="0.028801">
<outline color="00000000" width="1"/>
</symbol>
<symbol color="0x08306B" alpha="1.0"
type="simplefill"
min="0.028801"
max="100">
<outline color="00000000" width="1"/>
</symbol>
</infos>
</renderer>
</param>
</outputparams>
... View more
11-13-2011
10:56 AM
|
0
|
0
|
609
|
POST
|
I was ultimately able to accomplish this by first making a feature layer from my shapefile and then using select layer by location.
... View more
11-09-2011
09:42 PM
|
0
|
0
|
119
|
POST
|
I figured this out, the parameter needed to be changed from optional to required in the parameter settings for the model. Now the job is able to submit and complete.
... View more
11-09-2011
09:40 PM
|
0
|
0
|
196
|
POST
|
I have a model which in the incorporates a python script. Everything in my model works perfectly when I run it in the desktop environment. When I run the model as a geoprocessing service everything works, but my results are strange. Basically my model takes user input that selects a county, calculates a field on that row. Then exports that field with all the rows as a text file. This is the input parameter for my script. My script performs matrix algebra on that row, then exports the results as a text file called product. This is the output parameter of my script. My model takes that text file, makes it into a dbf and joins it back to the original shapefile. Something is going wrong somewhere though when run as a service because the values seem to get joined back to the wrong rows, even though they get joined to the correct rows when run in the desktop environment. I'm not sure if the problem is in my script, but I was wondering if it had something to do with not using the arcgis server scratchworkspace in my script as I do in the model? from __future__ import with_statement
from numpy import *
import arcpy
import time
import sys, string, os, arcgisscripting, shutil
gp = arcgisscripting.create(9.3)
from arcpy import env
tablePath = gp.GetParameterAsText(0)
#Load durbin.txt file
durbin= loadtxt("C:\\inetpub\\wwwroot\\REIS\\assets\\durbin_edit.txt")
print durbin
print"durbin loaded"
#load all columns except the first column which is the poly ids for the counties
durbin_cut=durbin[:,1:]
print durbin_cut
print"durbin columns selected"
#Load output of model, which includes 2 columns for x and y, impossible not to include
delta= loadtxt (tablePath)
print delta
print "delta loaded"
#Select only results column, exclude x and y coordinate columns from output
delta_cut = delta[:, 2:]
print delta_cut
print "column selected"
#Multiply using matrix algebra durbin_cut by delta_cut
product= dot(durbin_cut,delta_cut)
print product
print "calculated"
#Get current time for file names
date1=time.strftime("%d%b%y%H%M%S_")
print date1
#make a text file from array with header and product
dateproduct=date1 + "_product.txt"
print dateproduct
textfilename= "C:\Users\WinSSHD_VirtualUsers\Downloads\WebGIS project\Counties00_08_web\scratch\out" + dateproduct
print textfilename
product.tofile (textfilename, sep='\n', format="%e")
print "file created"
#open text file
with open(textfilename, "r+") as f:
old = f.read() # read everything in the file
f.seek(0) # rewind
f.write("value\n" + old) # write the new line before everything
print "all done"
#Set output parameter
arcpy.SetParameterAsText(1, textfilename)
Any insight would be greatly appreciated!
... View more
11-08-2011
04:38 PM
|
0
|
0
|
262
|
POST
|
I have a model which is published as part of a geoprocessing service. The model has 2 input parameters and 1 output parameters. One of the input parameters is to use select by location to select a row (in this case a county) to perform a function on. This works fine when I use the service within ArcMap but when I set up the widget to use the service in FlexViewer I get an error which says "error submitting job" when I go use the tool. I have the paramter set up to be featureset and I've matched all the properties in the service to the xml of the config file for the widget. Is there something special I need to do when using select by location in a geoprocessing tool for the widget?
... View more
11-08-2011
02:40 PM
|
0
|
2
|
1039
|
POST
|
I actually figured this out, you just need to use Python_9.3 as the expression type instead of VB.
... View more
11-07-2011
04:56 PM
|
0
|
0
|
173
|
POST
|
I have a model which is being published as a geoprocessing service. In one step of the model I need it to calculate a field. The field calculated is called BETA_DELTA and it is calculated as [FF_BUSINES] *%output_value% *2 with %output_value% an input that is generated by the user. When I look at the geoprocessing results it looks like this is working as it fills in %output_value% with the user supplied number. I also made sure to have the user input as a string and then converted the data type using calculate value. However the final results show that nothing has ever been calculated. I've had trouble with this on my very large model so I've cut it down to one where it just needs to calculate the field beta_delta. When I look at the geoprocessing results window it appears this happens, in the calculate field message it displays [FF_BUSINES] *40 *2, which makes sense because 40 is the number I input for output_value. But still nothing is calculated when I look at the results. I'm attaching an image of my model because it might help. So my basic question is is there a special process for using calculate field in a model that will be a geoprocessing service?
... View more
11-07-2011
04:11 PM
|
0
|
1
|
369
|
POST
|
Thank you! This and the link seem to really explain not only the output problem, but an intermediate data problem I've been having with the model.
... View more
11-07-2011
01:39 PM
|
0
|
0
|
185
|
POST
|
I currently have a model which attaches a datestamp to every file it creates so as to allow different users to run it at the same time on the web and produce different files. The variable is calculated in my model and is called date so all the files are named %date%something in the model. The output is named %date%final.shp This isn't a problem when I run the model from the toolbox. However when I publish it as a geoprocessing service and try and run it I get an error that says "ERROR Invalid return value: C:\Users\WinSSHD_VirtualUsers\Downloads\WebGIS project\Counties00_08_web\scratch\%date%final.shp 2011-11-05 21:30:37 webGIS/Shock_Models.GPServerSync " I can see why it doesn't like the return value since the name isn't actually %date%final.shp. Is there a way to indicate that the name isn't constant so that I can run it as a service?
... View more
11-07-2011
05:34 AM
|
0
|
2
|
2428
|
POST
|
For an update, I'm not sure I actually fixed this problem, but when I put the entire model together I did achieve the desired result which is to calculate values on selected rows, take the data from all rows and put it into a python script as a text file, output another text file from the script, make a dbf and then join the values back to this copied shapefile and kick out a new shapefile with all the data together. I think something is still going wrong though because this only works in the desktop enviornment, once I publish it as a geoprocessing service everything says it works however when I look at the final shapefile nothing was ever calculated. Even when I remove the part where the model just selects one row and let it calculate on every row ntothing shows up as calculated in the final shapefile.
... View more
11-07-2011
05:28 AM
|
0
|
0
|
113
|
POST
|
I have a model which was working when I set it up, but is now failing and I cannot figure out why. The first step of the model is to copy the input dataset to a new dataset with the current time as part of the file name. When I run the model from within model builder this works fine. When I run it from the toolbox everything says that this happens, and a file is created with the correct name, but something does not work because I am unable to open the shapefile that is created and the model does not perform the functions that need to be preformed supposed to on the created shapefile. I've worked the model down to try and figure out where it is going wrong, it appears to be as soon as I ask it to edit something on the created shapefile. If all I ask the model to do is copy the shapefile to a new shapefile I am able to open the resulting shapefile. I'm so frustrated because everything worked fine the day I created the model and I haven't changed anything. I'm attaching the screenshots of first running the model from the toolbox and then running it from within the model. Both time everything indicates that it worked, but it did not. Is there some problem editing the shapfile that it causing it to no longer be opened. Or from attempting to edit it?
... View more
11-05-2011
04:48 PM
|
0
|
1
|
340
|
POST
|
I have a model which generates an output file with a timestamp attached to its name. This is necessary so that multiple users of our geoprocessing service do not overwrite eachother's outputs. Within my model I have a python script which performs matrix algebra on a column of values calculated within the model. The values are loaded into the python script from a txt file generated by the model with the timestamp in the file name using the numpy command loadtxt. My problem is that I cannot figure out how to tell the script what file to look for since the file is named differently every time. The file name is generated in my model using calculate value which uses python to import the current time, this variable is named date in my model. The textfile is named %date%value.txt Is there a way to reference the result of calculate value in the model in my python script? If not is there another way to load a txt file that is named a little differently every time such as a wildcard in front of value.txt?
... View more
11-01-2011
04:39 PM
|
0
|
1
|
761
|
POST
|
I was not sure whether to post this question to the geoprocessing forum or the ArcGIS Flex Viewer forum. I have a model where I need the user to be able to select one feature in the shapefile (a county of their choice) to run the model on. I don't want to create a new shapefile with this selection because I need the original shapefile with the one value calculated to be output as a table at a later point in my model. To accomplish this I used make feature layer, and did this from a variable of an expression. The expression is just an sql expression which specifies the county the user wants. The problem with this is it is just a string and currently the user would need to type the string exactly in order to make the model work. We are running this model using the Geoprocessing Widget in Flex Viewer. Ideally I would like the user to be able to click on the county of their choice on the map, or choose the correct county from a drop down and use that as the basis for the make feature layer input parameter. Is this possible? I'm open to absolutely any suggestion.
... View more
10-11-2011
06:59 PM
|
0
|
2
|
325
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|