3

I am working on an alien species analysis looking at the spread of a species from the mainland to islands in an archipelago. I am doing the analysis using arcpy and I have succeeded in isolating risk zone islands based on how far the alien species can swim. Yup, the critters can swim some 2.000 meters.

With my islands isolated using repetitive buffer analysis I now need to be able to measure the minimum distance between one of the islands in the risk-zone and the mainland. So what I am looking for is something like this:

arcpy.distancebetweenlayers(risk_islands,mainland)

The closest I can get is the point distance tool. Since it only works with points I am out of luck. "Exploding" the features into points could be an option, but I would rather not have to go that way.

  • Is there some functionality I have overlooked which can support me on this task?
  • Using other libraries than arcpy might be option. Which libraries could give me a quick fix on this one?

For the record I am aware of a similar question with response (Get shortest distance between two geometries in ArcPy) about a year ago, but do not think it sufficiently answered the question.

1
  • If you could figure out how to build a line tangent to the main island perpendicular to the risk_islands and do makeRouteEventLayer then you could do a feature vertices to points on the risk islands vertices(possible in arcpy if you don't have arcinfo - curse through vertices and feature parts) you could then do locateFeaturesAlongRoute and this should give you the distances. You would have to feed a tolerance into the locate features and this would probably be available from your repetitive buffer analysis ending value.
    – Justin
    Oct 24, 2012 at 13:15

3 Answers 3

5

Use proximity analysis with the near tool.

http://help.arcgis.com/en/arcgisdesktop/10.0/help/#/Near/00080000001q000000/

arcpy.Near_analysis(risk_islands,mainland)

You could create a cursor in a script or a model to loop through the features.

2
  • Looks like the best idea so far. Trying it now, but it seems like a very slow functionality. Of course measuring the distance of up to 1500 islands to a rather large scale coastline.
    – ragnvald
    Oct 25, 2012 at 7:36
  • I am not aware of another way, using arcpy, to measure from nodes of a line/polygon. You can get to nodes in ArcObjects I believe and then a massive loop with the distance formula purplemath.com/modules/distform.htm. The other option as you stated is to explode the features to go from point to point. I would just use the built in tool that is at least supported if problems arise with the results.
    – theJones
    Oct 25, 2012 at 17:23
2

ArcGIS 10.1 has a new ArcPy Geometry function distanceTo(other geom). Returns the minimum distance between two geometries.

1
  • The documentation on this functionality with ESRI is scarce. No examples are provided.
    – ragnvald
    Oct 25, 2012 at 7:33
1

One other idea may be to use a combination of centroids (arcpy.FeatureToPoint_management) and the arcpy.PointDistance_analysis tool.

1
  • Good idea, but some of these islands are big and using their centroids would not help much in this case.
    – ragnvald
    Oct 24, 2012 at 12:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.