Multiplying Attributes

520
2
02-24-2017 01:14 PM
GeoffAbma
New Contributor

I would just like to multiply 2 attributes together.

I need some help because I'm apparently doing something wrong.

//First, I am defining an attribute which is linked to the initial shape's area attribute from the imported Shapefile:

attr SHAPE_Area = ""

//Then I am setting the maximum coverage permitted in the zoning by-law:

attr maxCoverage = 0.65

//And I simply want to generate the maximum building footprint area by multiplying these two attributes together, like this:

attr buildingFootprint = maxCoverage * SHAPE_Area

I am just not sure what the correct syntax is to do this.  I am getting this error:

No such function: float *(a:float,b:str)
Unused function:buildingFootprint

Any help would be appreciated.

Cheers!#

0 Kudos
2 Replies
LR
by
Regular Contributor

You're defining SHAPE_Area as text. Either define it as float (SHAPE_Area = 0) or cast it as float later (attr buildingFootprint = maxCoverage *float(SHAPE_Area)).

GeoffAbma
New Contributor

Thanks for this.  I finally realized that I was defining it as text instead of float myself late last night.  Made all the difference in the world! 

0 Kudos