Skip navigation
All People > Dan_Patterson > Py... blog > 2019 > July
2019

 Free basic functionality.  

 

Once again, functionality that is normally restricted to the Standard or Advanced ArcGIS Pro license. 

 

 

Previously

 - Feature Extent to Poly Features

 - Free Tools : Frequency and Statistics

 - Free Tools : Convex Hulls

 

Help topics

 - Feature Envelope to Polygon

 - Frequency

 -  Convex hull in Minimum bounding geometry

 - Feature to Point

 

Implementation

The implementation here is basically the default. Using the average or weighted average of the points making up the feature.  Soooo basically some kind of average, like you can get the points yourself using ...FeatureClassToNumPyArray… with the 'explode_to_points' option.  Voila! the points and their coordinates, ergo, the averages in some form (weighted or simple)

 

Output example

I tossed in a bounding container so you could see the points. 

  • Specify the input featureclass (polygon, polyline or multipoint),
  • the output featureclass,
  • select feature to point from the tool selection and

--------------------------------------------------------------------------------------------------------------------------------------------------------

 

 

 

The variant shown here is showing the full shape as input.  A tweak, enables you to separate out multipart shapes if you want, or more simply use the ...Multipart to Singlepart... tool if you have a crushing need to carry over the attributes... It will save you a Join and arcpy has to do something occasionally.

 

The conversion uses the numpy based Geo class that I describe in the 8 part series on geometry. 

You could add the geometry attributes to the result if needed ...Add Geometry Attributes … 

 

WARNING

I have code that checks the validity of the file paths.  If you input or output paths contain spaces or other flotsam, then the tool will not produce any results.  Why?  Too many questions where file paths are the problem.  I won't 'enable' the current practice

 

Download

You can copy the contents of the folder on my GitHub pages.  No fancy install, just create a folder, throw the stuff in, load the toolbox and give it a try.

 

Free_Tools

 

Got any geometry related or analysis tools you need implemented? let me know

 Free basic functionality.  

 

Another Free missive that uses numpy and arcpy to produce functionality that is normally restricted to the Standard or Advanced ArcGIS Pro license. 

 

 

Previously

 - Feature Extent to Poly Features

 - Free Tools : Frequency and Statistics

 

Help topics

 - Feature Envelope to Polygon

 - Frequency

 -  -Convex hull in Minimum bounding geometry

 

Spatial containers

The extent poly* features done previously, is one of the standard containers.  The convex hull is the most widely used and the easiest to implement, not because of the simplicity but because of the availability of standard algorithms.  Many packages use modules from the ... qhull … package.

 

Normally containers only make sense if you are using projected coordinates or can perform geodesic densification. 

 

Output example

Pretty well sums it up. 

  • Specify the input featureclass (polygon, polyline or multipoint),
  • the output featureclass,
  • select convex hulls from the tool selection

--------------------------------------------------------------------------------------------------------------------------------------------------------

 

 

 

The conversion uses the numpy based Geo class that I describe in the 8 part series on geometry. 

 

I could add the original attributes to the result (either within the toolset or after) or I could also 

Add Geometry Attributes ...

 

The full call to the tool, or the equivalent bits that I need.

A spatial or attribute join would be another alternative if you need attributes as well.

 

If you have a preference let me know.

The results are derived quickly and there is an optimization if the number of points making up the shape exceed about 50.  This was a qualitative estimate of the cross-over point between implementing a python solution versus a C compiled solution from qhull.

 

 

WARNING

I have code that checks the validity of the file paths.  If you input or output paths contain spaces or other flotsam, then the tool will not produce any results.  Why?  Too many questions where file paths are the problem.  I won't 'enable' the current practice

 

Download

You can copy the contents of the folder on my GitHub pages.  No fancy install, just create a folder, through the stuff in, load the toolbox and give it a try.

 

Free_Tools