|
POST
|
I would get a list of tables, create a loop that iterates the list like this:
for table in tables:
# Create table search cursor
cur = gp.SearchCursor(tablePath)
row = cur.Next()
while row:
outfile.write("<tr>\n")
for fieldName in fieldNames:
outfile.write("<td>" + str(row.getValue(fieldName)) + "</td>\n")
outfile.write("</tr>\n")
row = cur.Next()
del cur
Hope this helps
... View more
08-16-2010
02:21 AM
|
0
|
0
|
2056
|
|
POST
|
Did you enable messaging on your service, this will give you the error messages from the server? To do that, you'll need to stop the service and check the show messages check box in catalog. Do you have your script/toolbox saved in a location where the server can access it? For example, I place my scripts and toolboxes in a directory inside the \\computer-name\arcgisserver folder. Then I publish my script from the UNC referenced name. Another consideration, is to reference the script by UNC path name. Attached is a toolbox that contains a script that can be published to server, hopefully this will help.
... View more
08-10-2010
05:44 AM
|
0
|
0
|
1249
|
|
POST
|
The web help has multiple of published GP service examples: http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Guide_to_the_geoprocessing_service_examples I would also use gp.getparameter() or gp.getparameterastext() to get your inputs instead of sys.argv. You shouldn't have to reference the toolboxes either. In general when writing scripts I try to follow this format:
import sys
import os
import traceback
import inspect
import arcgisscripting
class ErrorHandling(object):
def trace(self):
tb = sys.exc_info()[2]
tbinfo = traceback.format_tb(tb)[0]
# script name + line number
line = tbinfo.split(", ")[1]
filename = inspect.getfile( inspect.currentframe() )
# Get Python syntax error
#
synerror = traceback.format_exc().splitlines()[-1]
return line, filename, synerror
if __name__ == '__main__':
try:
gp = arcgisscripting.create(9.3)
gp.overwriteoutput = 1
#
#!!!!! place python logic here !!!!!
#
except arcgisscripting.ExecuteError:
# Return GEOPROCESSING specific errors #
EH = ErrorHandling()
line, filename, err = EH.trace()
gp.adderror("Geoprocessing error on " + line + " of " + filename + " :")
for msg in range(0, gp.MessageCount):
if gp.GetSeverity(msg) == 2:
gp.AddReturnMessage(msg)
gp.AddError(gp.GetMessages(2))
except:
# Return any PYTHON or system specific errors #
EH = ErrorHandling()
line, filename, err = EH.trace()
gp.AddError("Python error on " + line + " of " + filename + " : with error - " + err)
finally:
del gp
Hope this helps.
... View more
08-04-2010
02:36 AM
|
0
|
0
|
1249
|
|
POST
|
Stefan, What version of ArcGIS Desktop are you using? Can you post your script? Here is some documentation about your error for 931: http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?topicname=tool_errors_and_warnings:999998-999999 For 10, http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00w100000002999999.htm To set a product at 10, see this: http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//000v0000003w000000.htm and http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//002z0000000z000000.htm Hope this helps
... View more
08-02-2010
03:24 AM
|
0
|
0
|
378
|
|
POST
|
Tom, You'll probably want to use python for this. I've attached a script (untested) that might help. I think what you are looking for is something that allows for users to just select an export directory and a file geodatabase name, but they do not have the option to change the output names. That means you want to use a derived output parameter. The parameters will still be modeled and the add to display selected, but the user will not have the option to enter in an output name. A
... View more
06-30-2010
03:08 AM
|
0
|
0
|
3657
|
|
POST
|
Hi Tom, Can you post your model? I would like to see what your model is doing so I can help figure out your problem. Also please provide a list of output parameters you want added to the TOC and what version of ArcGIS you are using. Thanks A
... View more
06-29-2010
10:07 AM
|
0
|
0
|
3657
|
|
POST
|
Hey Jessica, Here are some resources to help you out: 1). http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=2150&pid=2146&topicname=Spatial_Autocorrelation_(Morans_I)_(Spatial_Statistics) 2). http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=How Spatial Autocorrelation: Moran's I (Spatial Statistics) works The tool is used to show clustering, and returns a value between +1 and -1. A value closer to +1 means clustering, while a feature that has a Moran's value closer to -1 means it's dispersed compared to the other surrounding data. There are many factors that influence your results, like distance bands, threshold distances, the spatial relationship, etc... you need to determine which method is best for your dataset. If you want to examine clustering with counts, ex: we have 3 trees that infected in the area, you might want to look at the other analysis tools: http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_the_Mapping_Clusters_toolset Also I would take some time and do this tutorial: http://resources.esri.com/geoprocessing/index.cfm?fa=codeGalleryDetails&scriptID=16427 and watch these videos: http://www.youtube.com/esritv#p/u/7/cXXry6wE86M http://www.youtube.com/esritv#p/u/9/QJtPmnFgZbs http://www.youtube.com/esritv#p/u/8/3WtpYnlpKaU Enjoy A
... View more
06-01-2010
03:02 AM
|
0
|
0
|
2242
|
|
POST
|
You can use the Create Turn Feature Class from each of your routes. See this link: http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?id=2069&pid=2068&topicname=Create_Turn_Feature_Class_(Network_Analyst) That should help you get the turn by turn directions in a feature class. You can also read up on the whole collection of tools here: http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=An_overview_of_the_Turn_Feature_Class_toolset
... View more
06-01-2010
02:50 AM
|
0
|
0
|
576
|
|
POST
|
Try setting the license level to ArcEditor or Above. See the following: http://resources.esri.com/help/9.3/ArcGISDesktop/dotnet/2efb9e94-81b7-4088-af80-602ca92a2bb1.htm
... View more
04-30-2010
02:49 AM
|
0
|
0
|
726
|
|
POST
|
If you are going to add new feature classes to the existing replica, then you are going to have to use ArcObjects. // This method adds a feature class or table to a replica.
public void AddDatasetToReplica( IWorkspace workspace, String replicaName,
String datasetName, String parentDatabase, String parentOwner,
esriDatasetType datasetType, esriRowsType rowsType, Boolean useGeometry,
String queryDef )
{
// Find the replica.
IWorkspaceReplicas2 workspaceReplicas2 = (IWorkspaceReplicas2)workspace;
IReplica replica = workspaceReplicas2.get_ReplicaByName( replicaName );
// Create a replica dataset for the new feature class or table.
IReplicaDataset replicaDataset = new ReplicaDatasetClass();
IReplicaDatasetEdit replicaDatasetEdit = (IReplicaDatasetEdit)replicaDataset;
replicaDatasetEdit.Type = datasetType;
replicaDatasetEdit.Name = datasetName;
replicaDatasetEdit.ParentDatabase = parentDatabase;
replicaDatasetEdit.ParentOwner = parentOwner;
replicaDatasetEdit.ReplicaID = replica.ReplicaID;
// Add the dataset. Note that the pSelID parameter is not currently supported
// and should always be Nothing.
IWorkspaceReplicasAdmin2 workspaceReplicasAdmin2 = (IWorkspaceReplicasAdmin2)
workspaceReplicas2;
try
{
workspaceReplicasAdmin2.RegisterReplicaDataset( replicaDataset, rowsType,
useGeometry, queryDef, null, replica );
MessageBox.Show( "fin" );
}
catch (COMException comExc)
{
MessageBox.Show( comExc.Message );
}
}
... View more
04-27-2010
08:08 AM
|
0
|
0
|
804
|
|
POST
|
you can use Heapy http://guppy-pe.sourceforge.net/ This will help you examine memory leaks. Here is some code to get you started: from guppy import hpy h = hpy() print h.heap() You can also try this: http://bruynooghe.blogspot.com/2008/12/finding-memory-leaks-in-python.html or this: http://mg.pov.lt/blog/hunting-python-memleaks Happy Memory Leak Hunting!
... View more
04-27-2010
08:01 AM
|
0
|
0
|
483
|
|
POST
|
Hello, What you need to do is define your schema of your feature set or record set. To do this, in catalog, expand your tool, right click and select properties -> Parameter Tab -> Click on the record set or feature set parameter -> click on schema in properties -> select a table of feature class to model the parameter after. Press Apply and OK Now you should be able to interactively use a feature set/record set.
... View more
04-27-2010
07:48 AM
|
0
|
0
|
947
|
|
POST
|
Do the lines share some common IDs so they can be identified as the line features being buffered? Assuming that is true, make a feature selection based on the line's IDs. Then using an insert cursor construct a polygon feature around the line and ensure that the radius in increased 50 meters. One way to get the points is to use the Trig for Right Handed Triangles Rules (SOCATOA) you can then get the points around the line. See : http://id.mind.net/~zona/mmts/trigonometryRealms/introduction/rightTriangle/trigRightTriangle.html if you forget how to do that.
... View more
04-20-2010
04:30 AM
|
0
|
0
|
5556
|
|
POST
|
Can you post your model? From the looks of it, it cannot overwrite the output because it's probably being used by another process and it has a schema lock on it. Thanks
... View more
04-20-2010
03:06 AM
|
0
|
0
|
903
|
|
POST
|
When I have a published service and call my script via the Rest endpoint, the returned image does not have the historgram calculated, therefore the image looks totally black. Is there a way to force the statistics to be calculated via python? Thanks
... View more
04-08-2010
05:50 AM
|
0
|
0
|
570
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 07-24-2017 05:56 AM | |
| 1 | 03-28-2018 03:28 AM | |
| 1 | 07-24-2017 05:39 AM | |
| 1 | 06-01-2016 03:48 AM | |
| 1 | 01-27-2016 02:53 AM |
| Online Status |
Offline
|
| Date Last Visited |
3 weeks ago
|