|
POST
|
Put this in the code block: def my_function(numerator, denominator):
if denominator == 0:
return -99
else:
return numerator/denominator ...and this in the expression below the code block: my_function(!CHSCH04!,!TOSCH04!) Make sure you've changed to the Python parser.
... View more
01-15-2016
02:41 PM
|
1
|
6
|
3549
|
|
POST
|
Should have mentioned you need to use the Python parser with this example, although to be fair you did tag Python . Field names should be enclosed in exclamation marks.
... View more
01-15-2016
11:54 AM
|
0
|
8
|
3549
|
|
POST
|
Hmmmm, does your method label the polygon or polygon vertices, as requested?
... View more
01-15-2016
11:14 AM
|
0
|
1
|
4131
|
|
POST
|
Oh, sure, yes I missed that part: def my_function(numerator, denominator):
if denominator == 0:
return -99
else:
return numerator/denominator
... View more
01-15-2016
10:41 AM
|
1
|
10
|
3549
|
|
POST
|
Something like: Codeblock: def my_function(numerator, denominator):
if denominator == 0:
denominator = -99
return numerator/denominator Expression: my_function( !YOUR_NUMERATOR_FIELD!, !YOUR_DENOMINATOR_FIELD! )
... View more
01-15-2016
10:34 AM
|
1
|
12
|
3549
|
|
POST
|
The scale bar and data should automatically adjust themselves to match the data frame (project on-the-fly), so as long as the data is correctly defined and the data frame is using a "reasonable" coordinate system (e.g. not azimuthal or something), the scale bar should be correct. Please try adding some known correct data if you haven't already. Otherwise, a screenshot may help.
... View more
01-15-2016
10:12 AM
|
1
|
0
|
1024
|
|
POST
|
Are you sure that you've correctly defined the coordinate system for the layer you know is miles across? If not, it may appear much smaller (or larger) than you think. Does it match with other known correct layers?
... View more
01-15-2016
09:54 AM
|
0
|
2
|
1024
|
|
POST
|
Do you have multiple data frames, and if so, is the one for your scale bar activated?
... View more
01-15-2016
09:47 AM
|
1
|
4
|
3206
|
|
POST
|
Please elaborate: "The scale bar won't work on my map"
... View more
01-15-2016
09:39 AM
|
0
|
7
|
3206
|
|
POST
|
Can you provide a picture of what you hope to accomplish? There are (almost) an infinite number of solutions to this problem the way I see it.
... View more
01-14-2016
08:57 PM
|
0
|
0
|
3455
|
|
POST
|
>>> a = "RATTLER4C-34HZ"
... for i in range(len(a)):
... if a.isdigit():
... b = [a[:i],a
... break
... print b
...
['RATTLER', '4C-34HZ']
... View more
01-14-2016
03:33 PM
|
1
|
6
|
5061
|
|
POST
|
Since you're defining the event layer CRS in the Display XY dialog, the data frame has no bearing on the matter, but be my guest and start fresh. This topic was just getting lost in irrelevant details.
... View more
01-14-2016
03:07 PM
|
0
|
1
|
1841
|
|
POST
|
This works for me: 1.) Add your Excel to ArcMap 2.) Display XY Data... 3.) X Field = Longitude, Y Field = Latitude, Coordinate System = GCS_WGS_1984 (or NAD83 if you prefer) That is it. It does not matter one iota whether your data frame is defined beforehand or not.
... View more
01-14-2016
02:56 PM
|
0
|
3
|
1841
|
|
POST
|
Here's a Python implementation that should be mostly portable to JavaScript: >>> h = 1000 # x coord of ellipse centre
... k = 100 # y coord of ellipse centre
... a = 5 # unrotated x axis
... b = 10 # unrotated y axis
... ang = math.radians(45) # rotation, counter-clockwise, from north
... points = []
... for i in range(360): # one point per degree, change if you wish
... t = math.radians(i) # ellipse math
... x = a*math.cos(t) # ellipse math
... y = b*math.sin(t) # ellipse math
... rot_x = h+(x*math.cos(ang))-(y*math.sin(ang)) # rotate/transpose ellipse
... rot_y = k+(y*math.cos(ang))+(x*math.sin(ang)) # rotate/transpose ellipse
... points.append(arcpy.PointGeometry(arcpy.Point(rot_x,rot_y))) # save points to list
... arcpy.CopyFeatures_management(points,r'in_memory\points') # save points to disk Helpful links: The Most Marvelous Theorem in Mathematics Parametric Equation of an Ellipse - Math Open Reference
... View more
01-14-2016
02:32 PM
|
1
|
0
|
5708
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-25-2015 01:51 PM | |
| 1 | 08-30-2013 02:22 PM | |
| 1 | 04-12-2011 11:19 AM | |
| 1 | 09-17-2021 09:43 AM | |
| 1 | 04-04-2012 12:05 PM |
| Online Status |
Offline
|
| Date Last Visited |
07-15-2023
12:11 AM
|