If you want to use FGDB (apparently no supprt for MAX or MIN SQL statments = lame), here's a way to do it via Python using a reverse sorted dictionary:
Right on Sean, if you read my earlier post, that's exactly what is suggested.You are getting multiple max area buildings for a single parcel because the Area fields you have, several of them are exactly the same in terms of area calculated (i've noticed that several features are duplicates, and overlap each other)
import arcgisscripting gp = arcgisscripting.create(9.3) fc = r"\\snarf\am\workspace\csny490\Buildings.gdb\BldgsToCompare" parcelDict = {} oidFieldName = gp.describe(fc).oidfieldname searchRows = gp.searchcursor(fc) searchRow = searchRows.next() while searchRow: taxLotValue = searchRow.MAPLOTUNIT buildingAreaValue = searchRow.BLDG_AREA oidValue = searchRow.getvalue(oidFieldName) if taxLotValue in parcelDict: parcelDict[taxLotValue].append([buildingAreaValue,oidValue]) else: parcelDict[taxLotValue] = [[buildingAreaValue,oidValue]] searchRow = searchRows.next() del searchRow, searchRows sqlString = "" for parcel in parcelDict: parcelDict[parcel].sort(reverse=True) sqlString = sqlString + str(parcelDict[parcel][0][1]) + "," gp.MakeFeatureLayer_management(fc, "fl", oidFieldName + " in (" + sqlString[:-1] + ")", "", "")
It appears I have this somewhat figured this out... I needed to be working in a Personal Geodatabase rather than a File Geodatabase.But now, in many of the parcels, more than one building is being chosen. Any reason why?
Shape_Area in (select max(Shape_Area) from BldgsToCompare_D group by TAX_ACCT)
Shape_Area in (select max(Shape_Area) from BldgFP group by PIN)
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.