|
POST
|
stupids finally over parser: Python Code block
import numpy
def rand_num(a_field):
return numpy.random.randint(1,1000)
the rest rand_num(!randnum!) where !randnum! is the field to place the random numbers. I think you were mixing up the script example with the field calculator example and I just didn't catch it or better still provide a minimum and maximum value
import numpy
def rand_num(min_val, max_val):
return numpy.random.randint(min_val,max_val)
with rand_num(1,1000) calling the function
... View more
02-25-2011
11:52 AM
|
0
|
0
|
4278
|
|
POST
|
Rich I will look into it some more, try the code block that uses numpy's random in the interim
... View more
02-25-2011
11:28 AM
|
0
|
0
|
4278
|
|
POST
|
instead of randomValue[!Rand2!] try randomValue(!Rand2!)
... View more
02-25-2011
11:03 AM
|
0
|
0
|
4278
|
|
POST
|
so it isn't returning a python list, however, looking at the help files and your example I noted 'INTEGER 1, 1000' was your case and in the help files at http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//001w0000000w000000.htm it was 'normal 0.0 10.0' the only difference between them, excluding the distribution type, was that you had a pesky "," after the 1 in yours and the help files seems to suggest that a space delimited string is used. Barring that, try the help file example to rule out further issues.
... View more
02-25-2011
09:55 AM
|
0
|
0
|
4278
|
|
POST
|
i wouldn't say it is all doom-and-gloom, see http://docs.python.org/release/3.0.1/library/2to3.html#to3-reference which will provide most code change requirements.
... View more
02-25-2011
07:54 AM
|
0
|
0
|
1563
|
|
POST
|
if getoutput returns a list, then this line randomValue = float(result.getOutput(0)) should be randomValue = float(result.getOutput[0])
... View more
02-25-2011
07:21 AM
|
0
|
0
|
4278
|
|
POST
|
to avoid integer division, one of the inputs must be cast as a float and the simplest way to do that in your case is to divide by 10.0 not 10
... View more
02-23-2011
11:51 PM
|
0
|
0
|
2533
|
|
POST
|
square buffer around you existing points...versions exist, but you don't indicate what version of Arcmap you are using
... View more
02-23-2011
01:26 PM
|
0
|
0
|
1306
|
|
POST
|
depending upon your definition of miles and feet 2 miles = 10560 feet 2 miles = 3218 meters so I wild guess is that you projected to a projection which uses meters and not feet. Check to be sure
... View more
02-23-2011
05:59 AM
|
0
|
0
|
831
|
|
POST
|
did you play around with python's round and/or int methods?
... View more
02-23-2011
02:20 AM
|
0
|
0
|
2533
|
|
POST
|
Project your data. I suspect that they are in decimal degrees (aka a geographic coordinate system GCS....)
... View more
02-22-2011
12:46 PM
|
0
|
0
|
831
|
|
POST
|
off hand, SpatialReference is case sensitive """ *******************************************************************************************
NAME: DescribeProjection
Source Name: DescribeProjection.py
Version: ArcGIS 10.0
Author: Ashley Mott
Usage: DescribeProjection <input_data>, <input_coordinate_system>
Required Arguments: A set of input feature classes or feature layers
Description: Returns the coordinate system and/or projection of a dataset.
Date Created: 02/22/2011
********************************************************************************************** """
import arcpy
# Get the feature class to describe
#
featureClass = arcpy.GetParameterAsText(0)
desc = arcpy.Describe(featureClass)
# Create a Describe Object from the prj file.
#
#desc = arcpy.Describe(prjFile) # does nothing
# Print some SpatialReference object properties
SR = desc.SpatialReference #case sensitive
print "SR: ", str(SR)
#haven't checked the rest
print "Name: " + SR.name
print "Type: " + SR.type
print "FalseOriginAndUnits: " + desc.falseOriginAndUnits
... View more
02-22-2011
08:02 AM
|
0
|
0
|
2170
|
|
POST
|
you will have to reclassify the floating point slope values into integer classes (ie 5-10 deg slope = class 1 etc etc) so that you have the required integer grid to convert to polygons. check the help files for more details.
... View more
02-20-2011
09:51 AM
|
0
|
0
|
747
|
|
POST
|
Of course... http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//009z000000ts000000.htm assuming you are familiar with interpolation techniques, their practice and limitations particularly with reference to climate data
... View more
02-20-2011
06:02 AM
|
0
|
0
|
308
|
|
POST
|
It is possible, see the section on Save Settings and Load Settings in the help file http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//003q0000001m000000.htm
... View more
02-20-2011
02:10 AM
|
1
|
4
|
4115
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 08-05-2019 05:21 PM | |
| 1 | 09-02-2016 08:05 AM | |
| 1 | 01-15-2018 01:10 PM | |
| 1 | 09-17-2018 12:48 AM | |
| 1 | 02-20-2020 02:55 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:22 AM
|