|
POST
|
The arcgis server account name must match the arcgis server account on the other server (username and password). How are you connecting to your SDE geodatabase, are you using Windows or Database Authentication? If you are using Windows Authentication, make sure the arcgis server account has read privileges to the feature classes (i.e. right-click on the feature class > Manage > Privileges. Also, can you send a screen shot of the error you are receiving?
... View more
02-19-2013
10:30 AM
|
0
|
0
|
1707
|
|
POST
|
Hi Jason, Your code is returning the correct results. Take a look at the 'datasetName' property explanation here. Returns the name of the layer's dataset the way it appears in the workspace, not in the TOC. The 'name' property differs: Provides the ability to set or get the name of a layer the way it would appear in the ArcMap table of contents. So, if you were to change the name of the layer in the table of contents, you can still find the original feature class/shapefile name by using the 'datasetName' property.
... View more
02-19-2013
01:37 AM
|
0
|
0
|
1643
|
|
POST
|
Hi Josh, Add the arcgis server account to the database and then see if you can register the database.
... View more
02-13-2013
01:26 AM
|
0
|
0
|
1707
|
|
POST
|
Hi Jim, I've encountered some problems with setting the 'open' parameter to false. The dijit/TitlePane would still open. Instead, I've had to use '0'. Ex: Did not work: <div id="titlePane" data-dojo-type="dijit.TitlePane" data-dojo-props="title:'Measurement', open:'false'"> Worked: <div id="titlePane" data-dojo-type="dijit.TitlePane" data-dojo-props="title:'Measurement', open:0">
... View more
02-12-2013
11:13 AM
|
1
|
0
|
2818
|
|
POST
|
Hi George, The Raster to Polygon tool will work as Joshua pointed out, but each cell will be converted to a polygon. I would recommend using the Create Fishnet tool. For the Template Extent parameter, specify the raster. Then specify: Cell Size Width: 0 Cell Size Height: 0 Number of Rows: 1 Number of Columns: 1 And POLYGON for the output type. Also, if you have the 3D Analyst extension you could use the Raster Domain tool.
... View more
02-12-2013
10:28 AM
|
1
|
0
|
3648
|
|
POST
|
Hi Dez, You have your quotation before the 'r'. Try the following instead: arcpy.CreateTopology_management(r"T:\GIS105vector\topology\PrinceAlbert.mdb\NewDevelopment","Topology","#")
... View more
02-12-2013
10:20 AM
|
0
|
0
|
569
|
|
POST
|
If the feature class is registered as versioned, you will need to reconcile the child versions and then perform a compress. If you are running ArcGIS for Desktop 10.1 you can make a connection as an administrator > right-click on the database connection > Administration > Administer Geodatabase > Reconcile Order tab. Right-click on each version > Reconcile. After each version is reconciled and no locks exist within the geodatabase, right-click on the database connection > Administration > Compress Geodatabase. After the geodatabase is compressed, you can execute the 'sdelayer -o alter' command and the extent will recalculate. You can also script the above using the Versioning toolset for the Data Management tools.
... View more
02-12-2013
10:17 AM
|
0
|
0
|
4964
|
|
POST
|
Create a new txt file and place the following command within the file: sc \\<server> stop "ArcGIS Server" Save the txt file and rename it to .bat. Then, try executing the os.system command in python to run the batch file. Ex: import os
os.system(r"C:\temp\test.bat")
... View more
02-12-2013
03:13 AM
|
0
|
0
|
1622
|
|
POST
|
I would recommend creating a feature class. The great thing about feature classes is that a Shape_Length field is automatically added to the feature class. Therefore, you don't have to add additional code to add a field to the IN_MEMORY layer and then calculate the length. Here is an example where it starts an edit session, inserts the line's endpoint into a shapefile called 'Point_Test', and updates a field within the shapefile called 'Distance'.
import arcpy
import pythonaddins
class ToolClass2(object):
"""Implementation for Tool_addin.tool (Tool)"""
def __init__(self):
self.enabled = True
self.cursor = 3
self.shape = "Line"
def onLine(self, line_geometry):
arcpy.env.workspace = r"C:\temp\python\test.gdb"
edit = arcpy.da.Editor(r"C:\temp\python")
arcpy.CopyFeatures_management(line_geometry, "line_test")
rows = arcpy.SearchCursor("line_test")
for row in rows:
geom = row.shape
X = geom.lastPoint.X
Y = geom.lastPoint.Y
length = row.Shape_Length
del row, rows
row_value = (length, (X, Y))
cursor = arcpy.da.InsertCursor(r"C:\temp\python\point_test.shp", ("Distance", "SHAPE@XY"))
cursor.insertRow(row_value)
del cursor
arcpy.Delete_management("line_test")
edit.stopOperation()
edit.stopEditing(True)
... View more
02-12-2013
02:33 AM
|
0
|
0
|
3210
|
|
POST
|
What is the error you are receiving? Also, are you executing the script on the same server that ArcGIS for Server is running?
... View more
02-12-2013
02:01 AM
|
0
|
0
|
1622
|
|
POST
|
Tony, The point geometry would be a little more difficult. You would need to some how code it so that your second click would only create the point, and not the first. The reason you're getting this error is because you're setting the workspace to a shapefile. The workspace will need to be a folder or geodatabase. You will then need to update your arcpy.da.InsertCursor to just the shapefile name rather than 'env.workspace'.
... View more
02-11-2013
06:58 AM
|
0
|
0
|
3210
|
|
POST
|
You can take the code and easily add it to an add-in. Ex: import arcpy
import pythonaddins
class ToolClass2(object):
"""Implementation for Tool_addin.tool (Tool)"""
def __init__(self):
self.enabled = True
self.cursor = 3
self.shape = "Line"
def onLine(self, line_geometry):
arcpy.env.workspace = r"C:\temp\python\test.gdb"
arcpy.CopyFeatures_management(line_geometry, "line_test")
rows = arcpy.SearchCursor("line_test")
for row in rows:
length = row.Shape_Length
print length
del row, rows
arcpy.FeatureVerticesToPoints_management("line_test", "point_test", "END")
arcpy.AddField_management("point_test", "Length", "DOUBLE")
rows = arcpy.UpdateCursor("point_test")
for row in rows:
row.Length = length
rows.updateRow(row)
del row, rows
arcpy.Delete_management("line_test") In order to implement an edit session, take a look at adding the arcpy.da.Editor class.
... View more
02-11-2013
03:17 AM
|
0
|
0
|
3210
|
|
POST
|
Hi Tony, Here is an example on how to do this: import arcpy from arcpy import env env.workspace = r"C:\temp\python\test.gdb" env.overwriteOutput = 1 input = arcpy.GetParameterAsText(0) # Create empty Point and Array objects point = arcpy.Point() array = arcpy.Array() # A list that will hold each the Polyline object featureList = [] rows = arcpy.SearchCursor(input) for row in rows: geom = row.Shape point.X = geom.centroid.X point.Y = geom.centroid.Y # Add each point to the array array.add(point) # Create the polyline polyline = arcpy.Polyline(array) # Clear the array for future use array.removeAll() featureList.append(polyline) del row, rows # Copy the polyline to file geodatabase to create a Shape_Length field arcpy.CopyFeatures_management(featureList, "line_test") rows = arcpy.SearchCursor("line_test") for row in rows: # Create a variable to store the length length = row.Shape_Length arcpy.AddMessage(length) del row, rows # Convert the line's end point to a point arcpy.FeatureVerticesToPoints_management("line_test", "point_test", "END") # Add a field to store the length from the point1 to point2 arcpy.AddField_management("point_test", "Length", "DOUBLE") rows = arcpy.UpdateCursor("point_test") for row in rows: row.Length = length rows.updateRow(row) del row, rows arcpy.Delete_management("line_test") Once the script is created, you can add it to a toolbox. After it's added, right-click on the script > Properties > Parameters tab. Create a parameter and set it to Feature Set for the Data Type. Within the Parameter Properties, import a feature class or shapefile for the schema. You can then double click on the script, enter two points on the map and then run the tool.
... View more
02-08-2013
10:50 AM
|
0
|
0
|
3210
|
|
POST
|
See the following link below about debugging script tools: http://resources.arcgis.com/en/help/main/10.1/index.html#//00150000000m000000
... View more
02-08-2013
04:25 AM
|
0
|
0
|
1419
|
|
POST
|
Hi Martin, In ArcMap, go to the Geoprocessing menu > Geoprocessing Options. Under Script Tool Editor/Debugger set the Editor to the IDLE or PYTHONWIN executable. Ex: C:\Python27\ArcGIS10.1\Lib\site-packages\pythonwin\Pythonwin.exe
... View more
02-08-2013
02:14 AM
|
0
|
0
|
1419
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 4 weeks ago | |
| 4 | 05-07-2020 05:14 PM | |
| 1 | 03-25-2026 04:16 AM | |
| 1 | 03-16-2026 01:00 PM | |
| 1 | 12-22-2025 10:39 AM |
| Online Status |
Online
|
| Date Last Visited |
8 hours ago
|