POST
|
this should work... try: import arcpy from arcpy import env env.workspace = r"C:\EsriPress\GISTPython\Data\City of Oleander.gdb\Well_Data" env.overwriteOutput = True fcName = "BC_South_3H_Path" def wellBuffDist(drillLenght): if drillLenght < 3000: BuffDist = 75 elif drillLenght >= 3000 and drillLenght < 4000: BuffDist = 175 else: BuffDist = 300 return str(BuffDist) + " feet" wellCursor = arcpy.da.SearchCursor(fcName,["Shape_Length"]) for row in wellCursor: drillLength = row[0] wBuffDist = wellBuffDist(row[0]) arcpy.Buffer_analysis(in_features=fcName, out_feature_class="C:/EsriPress/GISTPython/MyExercises/Scratch/Temporary Storage.gdb/SelectionBuffer", buffer_distance_or_field=wBuffDist, line_side="FULL", line_end_type="ROUND", dissolve_option="NONE", dissolve_field="#") print "great job!" except: print "do over"
... View more
01-15-2015
10:01 AM
|
0
|
3
|
599
|
POST
|
Try printing the data from the numpy array before you use it for building the shapefile; verifying that the data is in fact in the numpy array before you use it to build the shapefile. Problem could possibly be how the datarray and dtype map out to one another. print npyarr['LONGITUDE'] print npyarr['LATITUDE']
... View more
12-17-2014
05:50 AM
|
0
|
0
|
858
|
POST
|
It sounds like you know the formula and the you have the data... What is preventing you from from putting your formula into the Field calculator? Perhaps it's that your intersection points are separate rows in your table and you need to marry them together to do the calculation? if this is the case you can run a summary statistics tool on your points to get the min value and and max value from your elevation field ,grouping them (Case) on your station line identifier. from there it should be easy to just run the field calculator on your two fields.
... View more
12-04-2014
05:48 AM
|
0
|
2
|
1820
|
POST
|
It would be helpful if you could pinpoint the problem or supply the error message... Although line 20 looks suspect. especially the "l", it only appears in line 09 that i can see, and would use the last found raster name in that set to parse for all 46 names in your array.. The way it is written it would seem that it would continually overwrite your output file for each of the 46 iterations it may also be that you need to change your input rasters from: Raster(tile1 );Raster(tile2 ) to [Raster(tile1 ), Raster(tile2 )]
... View more
12-03-2014
06:05 AM
|
0
|
0
|
667
|
POST
|
ok, i didn't realize you were wanting to publish to the rest service. I copied your code from above and it displayed the output as it should...
... View more
11-26-2014
08:12 AM
|
0
|
0
|
1314
|
POST
|
when you define the path to the .sde file in your python script, is it the full path to the file? as in "c:\\working\\myDBConn.sde" or is it "Database Connections\\myOtherDBConn.sde"
... View more
11-26-2014
05:48 AM
|
0
|
2
|
1263
|
POST
|
if you just want to add the results to the toolbox messages. just add: arcpy.AddMessage("your list results") if you want to add the results to a text file. do it like this: with open(r"c:\yourdirectory\yourfile.txt", "w") as f: f.write("your list results") I don't think you necessarily need to define an output parameter (param3), unless your intention is to add it to arcmap on completion.
... View more
11-26-2014
05:41 AM
|
0
|
2
|
1314
|
POST
|
maybe try changing the update statement to this. def updateParameters(self, parameters): if not parameters[1].altered: str_file = datetime.datetime.strftime(dparser.parse(os.path.basename(parameters[0].valueAsText), fuzzy=True),'%Y%m%d') if str_file[:4].isdigit(): arcpy.AddMessage(int(str_file[:4])) parameters[1].value(int(str_file[:4])) return
... View more
11-21-2014
05:45 AM
|
0
|
2
|
632
|
POST
|
you could use the python csv library to create the file. 13.1. csv — CSV File Reading and Writing — Python 2.7.8 documentation using a search cursor to format your data appropriately.
... View more
11-10-2014
02:03 PM
|
2
|
1
|
1648
|
POST
|
I suspect the issue is with the SearchCursor not being disposed of on completion of it's duties. if you aren't preceding the search cursor with a "with" like this: with arcpy.da.SearchCursor(fc, fields) as cursor : then you'll need to be sure to do del on the variable assigned to the cursor. like this cursor = arcpy.da.SearchCursor(fc, fields) for row in cursor: ... del cursor you can also try in the same script simultaneously to get the count using arcpy.GetCount_management(fc) to see if the issue is with the cursor or with the connection. here's a link to the getcount_management help page: ArcGIS Desktop
... View more
11-06-2014
05:52 AM
|
0
|
0
|
439
|
POST
|
you might need to register the database connection on the server. Here's a link in case you are unfamiliar with this setup. ArcGIS Help (10.2, 10.2.1, and 10.2.2)
... View more
11-03-2014
05:51 AM
|
0
|
1
|
522
|
POST
|
the updateRow needs to be sent a tupple even if it's only one variable being sent. change the updaterow to this and it should work cursor.updateRow((MyValue,))
... View more
10-29-2014
01:59 PM
|
0
|
3
|
575
|
POST
|
does Database Connections\\GISMO.sde exist on on the server ? It may be helpful to see the error message also.
... View more
10-24-2014
05:50 AM
|
0
|
1
|
1063
|
POST
|
you should be able to edit the service to update the service maxrecordcount. But I've never had a problem publisihing it with the desired number; Typically I set it at 5000.
... View more
10-22-2014
01:58 PM
|
0
|
0
|
416
|
POST
|
the summary statistics tool may be the easiest for you to implement. ArcGIS Help 10.1
... View more
10-22-2014
05:43 AM
|
0
|
1
|
405
|
Title | Kudos | Posted |
---|---|---|
1 | 10-15-2014 06:05 AM | |
2 | 02-17-2012 07:16 AM | |
2 | 11-10-2014 02:03 PM | |
1 | 10-09-2014 12:39 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|