@@ -668,8 +668,7 @@ <h2>aggregate_points<a class="headerlink" href="#aggregate-points" title="Permal
668
668
< dl class ="method ">
669
669
< dt id ="arcgis.geoanalytics.summarize_data.aggregate_points ">
670
670
< code class ="descclassname "> summarize_data.</ code > < code class ="descname "> aggregate_points</ code > < span class ="sig-paren "> (</ span > < em > point_layer</ em > , < em > bin_type: str = None</ em > , < em > bin_size: float = None</ em > , < em > bin_size_unit: str = None</ em > , < em > polygon_layer=None</ em > , < em > time_step_interval: int = None</ em > , < em > time_step_interval_unit: str = None</ em > , < em > time_step_repeat_interval: int = None</ em > , < em > time_step_repeat_interval_unit: str = None</ em > , < em > time_step_reference: datetime.datetime = None</ em > , < em > summary_fields: str = None</ em > , < em > output_name: str = None</ em > , < em > gis=None</ em > < span class ="sig-paren "> )</ span > < a class ="headerlink " href ="#arcgis.geoanalytics.summarize_data.aggregate_points " title ="Permalink to this definition "> ¶</ a > </ dt >
671
- < dd > < blockquote >
672
- < div > < p > Using a layer of point features and either a layer of area features or bins defined by a specified distance, this tool determines which points fall within each area or bin and calculates statistics about all the points within each area or bin. You may optionally apply time slicing with this tool.</ p >
671
+ < dd > < p > Using a layer of point features and either a layer of area features or bins defined by a specified distance, this tool determines which points fall within each area or bin and calculates statistics about all the points within each area or bin. You may optionally apply time slicing with this tool.</ p >
673
672
< p > For example</ p >
674
673
< ul class ="simple ">
675
674
< li > Given point locations of crime incidents, count the number of crimes per county or other administrative district.</ li >
@@ -679,39 +678,104 @@ <h2>aggregate_points<a class="headerlink" href="#aggregate-points" title="Permal
679
678
< p > For example, suppose you have point features of coffee shop locations and area features of counties, and you want to summarize coffee sales by county. Assuming the coffee shops have a TOTAL_SALES attribute, you can get the sum of all TOTAL_SALES within each county, the minimum or maximum TOTAL_SALES within each county, or other statistics such as the count, range, standard deviation, and variance.</ p >
680
679
< p > This tool can also work with data that is time-enabled. If time is enabled on the input points, then the time slicing options are available. Time slicing allows you to calculate the point-in-area relationship while looking at a specific slice in time. For example, you could look at hourly intervals, which would result in outputs for each hour.</ p >
681
680
< p > For an example with time, suppose you had point features of every transaction made at various coffee shop locations and no area layer. The data has been recorded over a year and each transaction has a location and a time stamp. Assuming each transaction has a TOTAL_SALES attribute, you can get the sum of all TOTAL_SALES within the space and time of interest. If these transactions are for a single city, we could generate areas that are 1-kilometer grids and look at weekly time slices to summarize the transactions in both time and space.</ p >
682
- </ div > </ blockquote >
683
- < p > Parameters:</ p >
681
+ < table border ="1 " class ="docutils ">
682
+ < colgroup >
683
+ < col width ="27% " />
684
+ < col width ="73% " />
685
+ </ colgroup >
686
+ < tbody valign ="top ">
687
+ < tr class ="row-odd "> < td > < strong > Argument</ strong > </ td >
688
+ < td > < strong > Description</ strong > </ td >
689
+ </ tr >
690
+ < tr class ="row-even "> < td > point_layer</ td >
691
+ < td > Required Input Points layer (features).</ td >
692
+ </ tr >
693
+ < tr class ="row-odd "> < td > bin_type</ td >
694
+ < td > Optional string parameter. If polygon_layer is not defined, it is required.
695
+ Choice list:[‘Square’, ‘Hexagon’]</ td >
696
+ </ tr >
697
+ < tr class ="row-even "> < td > bin_size</ td >
698
+ < td > Bin Size (float). Optional parameter.</ td >
699
+ </ tr >
700
+ < tr class ="row-odd "> < td > bin_size_unit</ td >
701
+ < td > Bin Size Unit (str). Optional parameter.
702
+ Choice list:[‘Feet’, ‘Yards’, ‘Miles’, ‘Meters’, ‘Kilometers’, ‘NauticalMiles’]</ td >
703
+ </ tr >
704
+ < tr class ="row-even "> < td > polygon_layer</ td >
705
+ < td > Optional Input Polygons layer (features). If bin_type and bin properties are not defined, it is
706
+ required.</ td >
707
+ </ tr >
708
+ < tr class ="row-odd "> < td > time_step_interval</ td >
709
+ < td > Time Step Interval (int). Optional parameter.</ td >
710
+ </ tr >
711
+ < tr class ="row-even "> < td > time_step_interval_unit</ td >
712
+ < td > Time Step Interval Unit (str). Optional parameter.
713
+ Choice list:[‘Years’, ‘Months’, ‘Weeks’, ‘Days’, ‘Hours’, ‘Minutes’, ‘Seconds’, ‘Milliseconds’]</ td >
714
+ </ tr >
715
+ < tr class ="row-odd "> < td > time_step_repeat_interval</ td >
716
+ < td > Time Step Repeat Interval (int). Optional parameter.</ td >
717
+ </ tr >
718
+ < tr class ="row-even "> < td > time_step_repeat_interval_unit</ td >
719
+ < td > Time Step Repeat Interval Unit (str). Optional parameter.
720
+ Choice list:[‘Years’, ‘Months’, ‘Weeks’, ‘Days’, ‘Hours’, ‘Minutes’, ‘Seconds’, ‘Milliseconds’]</ td >
721
+ </ tr >
722
+ < tr class ="row-odd "> < td > time_step_reference</ td >
723
+ < td > Time Step Reference (datetime). Optional parameter.</ td >
724
+ </ tr >
725
+ < tr class ="row-even "> < td > summary_fields</ td >
726
+ < td > < p class ="first "> Summary Statistics (str). Optional parameter.</ p >
727
+ < p > The summary_fields string must enclose a Python list. Each list item must be a Python dictionary
728
+ with two keys. See the Key:Value definitions below.</ p >
729
+ < p class ="last "> See URL 1 below for full details.</ p >
730
+ </ td >
731
+ </ tr >
732
+ < tr class ="row-odd "> < td > output_name</ td >
733
+ < td > Output Features Name (str). Optional parameter.</ td >
734
+ </ tr >
735
+ < tr class ="row-even "> < td > gis</ td >
736
+ < td > Optional, the GIS on which this tool runs. If not specified, the active GIS is used.</ td >
737
+ </ tr >
738
+ </ tbody >
739
+ </ table >
740
+ < p > < em > Key:Value Dictionary Options for Argument summary_fields</ em > </ p >
741
+ < table border ="1 " class ="docutils ">
742
+ < colgroup >
743
+ < col width ="13% " />
744
+ < col width ="87% " />
745
+ </ colgroup >
746
+ < tbody valign ="top ">
747
+ < tr class ="row-odd "> < td > < strong > Key</ strong > </ td >
748
+ < td > < strong > Value</ strong > </ td >
749
+ </ tr >
750
+ < tr class ="row-even "> < td > statisticType</ td >
751
+ < td > < p class ="first "> Required string. Indicates statistic to summarize. See URL 1 below for full explanation.</ p >
752
+ < p > Choice list numeric fields:[‘Count’, ‘Sum’, ‘Mean’, ‘Min’, ‘Max’, ‘Range’, ‘Stddev’, ‘Var’]</ p >
753
+ < p class ="last "> Choice list for string fields:[‘Count’, ‘Any’]</ p >
754
+ </ td >
755
+ </ tr >
756
+ < tr class ="row-odd "> < td > onStatisticField</ td >
757
+ < td > < p class ="first "> Required string. Provides the field name to summarize.</ p >
758
+ < p class ="last "> See < a class ="reference external " href ="https://developers.arcgis.com/python/guide/working-with-feature-layers-and-features/#Querying-feature-layers "> https://developers.arcgis.com/python/guide/working-with-feature-layers-and-features/#Querying-feature-layers</ a >
759
+ for instructions to query a feature layer for field names.</ p >
760
+ </ td >
761
+ </ tr >
762
+ </ tbody >
763
+ </ table >
764
+ < p > For detailed explanation see:</ p >
765
+ < p > URL 1: < a class ="reference external " href ="http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Aggregate_Points/02r3000002rr000000/ "> http://resources.arcgis.com/en/help/arcgis-rest-api/index.html#/Aggregate_Points/02r3000002rr000000/</ a > </ p >
684
766
< blockquote >
685
- < div > < p > point_layer: Input Points (features). Required parameter.</ p >
686
- < dl class ="docutils ">
687
- < dt > bin_type: Output Bin Type (str). Optional parameter.</ dt >
688
- < dd > Choice list:[‘Square’, ‘Hexagon’]</ dd >
689
- </ dl >
690
- < p > bin_size: Bin Size (float). Optional parameter.</ p >
691
- < dl class ="docutils ">
692
- < dt > bin_size_unit: Bin Size Unit (str). Optional parameter.</ dt >
693
- < dd > Choice list:[‘Feet’, ‘Yards’, ‘Miles’, ‘Meters’, ‘Kilometers’, ‘NauticalMiles’]</ dd >
694
- </ dl >
695
- < p > polygon_layer: Input Polygons (features). Optional parameter.</ p >
696
- < p > time_step_interval: Time Step Interval (int). Optional parameter.</ p >
697
- < dl class ="docutils ">
698
- < dt > time_step_interval_unit: Time Step Interval Unit (str). Optional parameter.</ dt >
699
- < dd > Choice list:[‘Years’, ‘Months’, ‘Weeks’, ‘Days’, ‘Hours’, ‘Minutes’, ‘Seconds’, ‘Milliseconds’]</ dd >
700
- </ dl >
701
- < p > time_step_repeat_interval: Time Step Repeat Interval (int). Optional parameter.</ p >
702
- < dl class ="docutils ">
703
- < dt > time_step_repeat_interval_unit: Time Step Repeat Interval Unit (str). Optional parameter.</ dt >
704
- < dd > Choice list:[‘Years’, ‘Months’, ‘Weeks’, ‘Days’, ‘Hours’, ‘Minutes’, ‘Seconds’, ‘Milliseconds’]</ dd >
705
- </ dl >
706
- < p > time_step_reference: Time Step Reference (datetime). Optional parameter.</ p >
707
- < p > summary_fields: Summary Statistics (str). Optional parameter.</ p >
708
- < p > output_name: Output Features Name (str). Optional parameter.</ p >
709
- < p > gis: Optional, the GIS on which this tool runs. If not specified, the active GIS is used.</ p >
710
- </ div > </ blockquote >
711
- < dl class ="docutils ">
712
- < dt > Returns:</ dt >
713
- < dd > output - Output Features as Item</ dd >
714
- </ dl >
767
+ < div > < strong > Returns:</ strong > Output Features as Item</ div > </ blockquote >
768
+ < p > < em > Example</ em > </ p >
769
+ < div class ="highlight-python "> < div class ="highlight "> < pre > < span > </ span > < span class ="c1 "> # Usage Example: Using summary_fields on a layer.</ span >
770
+
771
+ < span class ="n "> agg_pts_item</ span > < span class ="o "> =</ span > < span class ="n "> aggregate_points</ span > < span class ="p "> (</ span > < span class ="n "> input_points_layer</ span > < span class ="p "> ,</ span >
772
+ < span class ="n "> bin_size</ span > < span class ="o "> =</ span > < span class ="mf "> 0.5</ span > < span class ="p "> ,</ span >
773
+ < span class ="n "> bin_type</ span > < span class ="o "> =</ span > < span class ="s1 "> 'Hexagon'</ span > < span class ="p "> ,</ span >
774
+ < span class ="n "> bin_size_unit</ span > < span class ="o "> =</ span > < span class ="s1 "> 'Miles'</ span > < span class ="p "> ,</ span >
775
+ < span class ="n "> summary_fields</ span > < span class ="o "> =</ span > < span class ="s1 "> '[{"statisticType": "Count", "onStatisticField": "fieldName1"}, {"statisticType": "Any", "onStatisticField": "fieldName2"}]'</ span >
776
+ < span class ="p "> )</ span >
777
+ </ pre > </ div >
778
+ </ div >
715
779
</ dd > </ dl >
716
780
717
781
</ div >
0 commit comments