Hello Michelle,You should first prepare your census and address feature classes (this can be done without Python):Remove water bodies from census with EraseAdd a field representing the radius of the buffer to census, and calculate it based on the population density fieldJoin the radius field to the address fc with a Spatial Join.Then create your SearchCursor like this:addresses = r"c:\data.gdb\addresses" census = r"c:\data.gdb\census" fields = ["ADDRESS_ID", "RADIUS"] with arcpy.da.SearchCursor(addresses, fields) as cursor: for row in cursor: then for each row (= each point):Create an variable containing the ADDRESS_ID (ID = row[0]), i.e. the first field in your cursor, i.e. ADDRESS_ID)Buffer the point using radius as distanceSelect the underlying census polygon using Make Feature Layer + Select by LocationClip the buffer with the selected census polygon. The output is going to be the constraining feature class for the Create Random Points toolCreate a random point in this zone with Create Random PointsAdd an ID field to the random point (same format as your ADDRESS_ID field from the address fc)Calculate the field, assign it the ID variableClear the census selection.You could either append each point to an empty point feature class you create before starting the cursor, or merge all points together when the cursor is done.In order to make your script run faster, you should use whenever possible geometry objects instead of feature classes as inputs and outputs of the tool.If you want to start learning Python, there is a free tutorial (3 hours) here. There are other trainings (not always free) and plenty of examples in the Online Help. Converting a ModelBuilder to a Python script sometimes help figuring out the correct syntax.Good luck and don't hesitate to come back to me if you have questions,Geraldine
addresses = r"c:\data.gdb\addresses" census = r"c:\data.gdb\census" fields = ["ADDRESS_ID", "RADIUS"] with arcpy.da.SearchCursor(addresses, fields) as cursor: for row in cursor:
Hi Michelle,Shortly put you could use a SearchCursor that iterates over your point adresses and first creates for each point a custom buffer zone with a radius linked to the population density, limited to the underlying census polygon and excluding water bodies; then creates a random point within this zone using Create Random Points. And merge all points together when your cursor is done.I could provide you with details if you want but this is going to be very slow, it requires ArcInfo/ArcGIS Advanced and will maybe not be easy to do if you're not familiar with Python. I would suggest you to geocode your addresses to a least accurate level (e.g. street instead of address or city instead of street). Could this be an option for you?Geraldine
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.