POST
|
Are you looking for ArcMap to only display labels if the float number is equivalent an even integer? Ex: 12.0 is labeled, but 12.3 is NOT If you're looking to not display them at all, you can use the Definition Query tab, which actually used SQL queries instead of Python. Assuming your PM field is a float or double, you can use something like this. MOD(ROUND("PM" * 10, 0), 10) = 0 The Modulus Operator in SQL doesn't handle floats, but if multiply your values by 10 and round them, you should be able to Modulus them by 10 to test for the same thing in a roundabout fashion. For Labeling only these features heres my version of the labeling function in Python: def FindLabel ( [PM] ):
if float([PM]) % 1 == 0:
return [PM] Thanks! That's exactly what I needed! It worked beautifully 🙂 Alma
... View more
04-23-2014
12:48 PM
|
0
|
0
|
570
|
POST
|
Are you familiar with modulus division? It gives you the remainder. You want to check if PM % 1 = 0. That will be true for whole numbers, such as 11 % 1 == 0. 11.5 % 1 will equal 0.5. (This is python notation). It's a little more complicated if PM is a float or double datatype, because there you'll have to check if the value is very close to 0, rather than equaling 0, but the principle is the same. If PM is text, there's an even simpler way, but I'm guessing it's numeric. So in label expressions, you want something like this (in vbscript):
Function FindLabel ( [PM] )
if [PM] mod 1 = 0 then
FindLabel = [PM]
end if
End Function Thank you for your reply, for some reason, that code still shows every tenth value. I did check if my field is a number field, it's a DOUBLE.
... View more
04-23-2014
12:30 PM
|
0
|
0
|
570
|
POST
|
Hi- I am trying to show only the "whole Number" mile markers from my data file of State post Mile Markers. The data right now has tenth displayed as well. I am not savvy in scripting but think this should be a fairly easy one? Could you be so kind to shoot me over a script? Python or VB with any explaination on how to enter it properly. My field is PM (PostMiles) Kindest Regards, Alma Gormley almag@wallacegroup.us
... View more
04-23-2014
10:24 AM
|
0
|
5
|
1005
|
POST
|
the new password is ADSRiver.2014 I couldn't get the download to work for me either and I entered the current year as a guess, it worked! Alma
... View more
04-09-2014
09:09 AM
|
0
|
0
|
489
|
POST
|
Hello- Can the polygon volume tool output a single total volume for a given elevation? Right now I have elevations ranging from 600-750 and the tool gives me multiple volumes amounts for elevation 600 (for example) and I would like the total. It's a lot of work to edit the out put table for the range of elevation I am calculating. Maybe in the 'environments' setting? Much appreciated, Alma
... View more
01-16-2014
03:03 PM
|
0
|
0
|
1101
|
POST
|
Hi- I recently started having problems with my Layer to KML export. I am able to view my KML in Google Earth however when I click on a feature (Point in this case) nothing pops up? I used to be able to see the attribute pop up table associated with the feature, but not anymore? Any idea why? and if I need to change the way I export to KML? Thanks in Advance, GIS SPECIALIST Wallace
... View more
11-14-2013
09:50 AM
|
0
|
1
|
718
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:24 AM
|