POST
|
Hi jkblood Blood check out the Business and Commercial GeoNet Space. There you should find a category section for Financial Services. Hopefully that helps! John
... View more
08-27-2020
05:11 AM
|
2
|
0
|
1969
|
POST
|
Currently it does not look like there is a parameter that would allow you to set that right away. It can be achieved with some additional python logic – essentially you would create a list of unique drive time values, make feature layers that only contain the points that equal each unique drive time (looping through), execute the drive time trade area tool for each grouping (looping through), and then merge them all together to create the final output. There is an option for doing this in the Network Analyst extension; where you can create service areas which are essentially the same thing as the drive time trade areas. There is a parameter in there that allows you to set the value from a table when you are adding facilities. In this case you would set the “Breaks_TravelTime” field to the one in your table and those values would be used when solved. See the help documentation, under “Breaks_[Cost]” section, about this here: https://pro.arcgis.com/en/pro-app/help/analysis/networks/service-area-analysis-layer.htm I have included a sample of how you may do this with python below. It is just an example and not necessarily optimized or full proof but is there for you to reference; works with in memory data along the way and you would need to make some changes to get it to work on your data. import arcpy, os, datetime
#set start time
startTime = datetime.datetime.now()
current_workspace = arcpy.env.workspace
## Set Variables
#-----------------------------------------------------------------------------#
input_fc=r"C:\Sample_Data\ExampleGDB.gdb\Tessellations_Points"
output_fc =r"C:\Sample_Data\ExampleGDB.gdb\Drive_Times"
drive_time_Field = "Drive_Time_Value"
lry_lst = []
drive_time_lry_lst = []
###Functions to be executed
#-----------------------------------------------------------------------------#
## Function to return a list of unique drive time values.
def unique_values(table , field):
with arcpy.da.SearchCursor(table, [field]) as cursor:
return sorted({row[0] for row in cursor})
# Function to loop through each unique drive time and make a feature layer.
def tmp_lry(in_lry,drive_time_Field,dvr_times):
for row in dvr_times:
sql="""{0} = {1}""".format(arcpy.AddFieldDelimiters(in_lry, drive_time_Field),row)
slry_name = "Layer_Time_{0}".format(row)
print(sql)
arcpy.MakeFeatureLayer_management(in_features = in_lry, out_layer=slry_name ,where_clause = sql)
lry_lst.append(slry_name)
# Function to run GenerateDriveTimeTradeArea for each feature layer.
def drv_times(layer_list,id_field):
for val in lry_lst:
netwrok_time = val.split("_")[2]
lry_name = "Drive_Time_{0}".format(netwrok_time)
print(lry_name)
arcpy.ba.GenerateDriveTimeTradeArea(val, os.path.join("memory", lry_name), "Driving Time", netwrok_time, "MINUTES", id_field, "OVERLAP", "KEEP_OVERLAP", "TOWARD_STORES", None, "TIME_ZONE_AT_LOCATION", None, "STANDARD")
drive_time_lry_lst.append(lry_name)
##Run the functions
#-----------------------------------------------------------------------------#
myValues = unique_values(input_fc ,drive_time_Field)
print (myValues)
tmp_lry(input_fc,drive_time_Field,myValues)
drv_times(lry_lst,"GRID_ID")
#Merge separate drivetimes layers to one
arcpy.Merge_management(drive_time_lry_lst, output_fc)
#Clear memory datasets
arcpy.env.Workspace = "memory"
del_list = lry_lst+drive_time_lry_lst
for itm in del_list:
arcpy.Delete_management(itm)
print("Removed {0} from in memomry workspace".format(itm))
# Set workspace back to starting workspace
arcpy.env.workspace = current_workspace
print ("done")
print(datetime.datetime.now() - startTime) I would also suggest that you post this on the ArcGIS Ideas page to request them adding the functionality to the tool in the future. This way others with the same request can vote on it if they also want to see it happen. - ArcGIS Ideas Good luck!
... View more
02-21-2020
09:23 AM
|
4
|
1
|
1588
|
POST
|
Hi Ronald, This can be done with a combination of tools in Model Builder. A basic example would be using an iterator to iterate through the different grid features (grouped by a value from the attribute table) and uses that feature to select form a different layer those features that intersect it. That selection can then be seen in the map, added to the table of contents as a feature layer, or exported to a new feature class in a geodatabase. I have included two images for two different models below as examples; one that adds a feature layer (a layer existing in memory and in the map document only) and the second that exports the selection to a new feature class in a geodatabase. Both examples take advantage of the inline variable substitution to name the output and help identify which layer intersected which grid feature. Inline variables are called with %Variable Name% so in this case an output layer name might look like “SelectedFeatures%Value%. This is just one example of how this can be done. A combination of Select By Attribute and Select By Location can accomplish similar outcomes as well. If you wanted to select one grid feature that you knew the id attribute value for you could use Select By Attribute tool to run the SQL expression on and pass that output selection to the Select Layer By Location tool as the selecting features. Additionally, you could substitute the Make Feature Layer tool for the Select By Attribute tool because it also has a SQL Expression parameter to identify specific grid feature(s). In the end, workflows such as this can be achieved with Model Builder it will just depend on the data you are working with and what type of output you want to produce. The selection methods can all be adjusted throughout the model and multiple selection tools can be added to build on a current selection or subtract form a selection just as they can be done manually in ArcMap. A few of the key tools to look at when building these tools will be as follows: - Iterate Feature Selection: http://desktop.arcgis.com/en/desktop/latest/tools/modelbuilder-toolbox/iterate-feature-selection.htm - A quick tour of using inline variable substitution: http://desktop.arcgis.com/en/desktop/latest/analyze/modelbuilder/a-quick-tour-of-using-inline-variable-substitution.htm - Make Feature Layer: http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/make-feature-layer.htm - Select Layer By Attribute: http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/select-layer-by-attribute.htm - Select Layer By Location: http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/select-layer-by-location.htm
... View more
10-15-2015
11:35 AM
|
2
|
0
|
8009
|
POST
|
The behavior being seen here is most likely related to the way the software interprets CSV and other text files. Typically when a CSV, or other text file, is added to a map, and the schema of the file cannot be reliably determined, a schema.ini file is created in the same file directory to dictate how the file should be shown. If this is the case, the software will attempt to create it for you and specify what it sees as the best fir - reading off of the first few rows to guess what type each field should be. The scema.ini file can overridden to distinctly specify how delimited text files are displayed within ArcGIS. An example of when you would want to use, or modify, the schema.ini file to override the default behavior is when ArcGIS is misinterpreting a field type. The following example shows how to do this for a field called PLOTS which should be displayed as type Text but is being interpreted as type Double in a CSV file called Trees. [Trees.CSV] Col14=PLOTS Text More information on this topic can be found here: Adding an ASCII or text file table - Overriding how text files are formatted: http://desktop.arcgis.com/en/desktop/latest/manage-data/tables/adding-an-ascii-or-text-file-table.htm#GUID-9131A09B-6C15-4654-8A72-F01C0C271392 The best recommendation in this case would be to see how each case is using the schema.ini file. Simply going off of the two images it would be best to go ahead and create or modify your own schema.ini file because the fields contain both text and numeric values. It would be easy for the software to interpret these fields as number thus not allowing the string information to be shown. Editing the schme.ini file so that these fields are set to String should allow you to continue working as needed.
... View more
10-09-2015
07:35 AM
|
2
|
0
|
1079
|
Title | Kudos | Posted |
---|---|---|
2 | 08-27-2020 05:11 AM | |
4 | 02-21-2020 09:23 AM | |
2 | 10-15-2015 11:35 AM | |
2 | 10-09-2015 07:35 AM |
Online Status |
Offline
|
Date Last Visited |
11-28-2023
06:01 PM
|