6

I have two shapefiles: the first containing a route defined by a single polygon (black line in the image below), the second containing a series of between 1000 and 4000 small polygons located somewhere inside the larger polygon (green and pink boxes).

enter image description here

I would like to extend each of the small polygons in the direction perpendicular to the route, so that they become long polygons that end at the edge of the outer polygon. These new polygons don't necessarily have to span the entire width of the route polygon, for example where they appear on a bend, as shown below:

enter image description here

I am using ArcGIS 10.4.1 for Desktop with an Advanced license. I've also got access to a Spatial Analyst license. Is what I want possible, and if so how do I do it? I could also use any freely available software other than ArcGIS if that would make this possible.

-----Update-----

Following the suggestion from @Hornbydd and @FelixIP to use Arc's Euclidean Allocation tool (available with a Spatial Analyst license), I now have what I was aiming to produce, as shown in the image below:

enter image description here

  • 2
    While possible, it's unlikely you'll find such a tool sitting in a shelf. This means you'll need to choose a development language (C++/C#/Python) and start coding. Given the bends in the green polygon chain, you'll need to decide how to handle line extension. – Vince Oct 1 '18 at 11:13
  • 3
    It's asking a bit much to expect the good folk of GIS SE to code this for you. In fact, we have a policy to not do so. If, however, you start the process and get stuck, then you can post the relevant portion of code, and we can try to untangle you. – Vince Oct 1 '18 at 11:24
  • 1
    Please remember to Edit the question in response to requests for clarification. – Vince Oct 1 '18 at 12:25
  • 3
    This isn't an Intro to GIS task, but if you work the problem in iterations, it can be solved. First, structure a script to iterate the polygons in a DA SearchCursor. Then add an InsertCursor to write the first FC to a new FC. Then identify the edge vertices (left and right). Then, construct a line from the edge to the outer line (past it, then intersect). Finally, add the three vertices on each side to the output polygons. – Vince Oct 1 '18 at 12:47
  • 2
    I don't know if these will help but ArcGIS has a Create Points at Corners of Polygon sample (arcgis.com/home/item.html?id=4d77199a45c340aaa59ccb9948380038) and ETGeowizards has a Perpendiculars to Polylines tool in its points group that you could apply to those points. The ET tool, however, is not one of its free tools. – johns Oct 1 '18 at 16:58
4

For the simplest approach with zero coding I think @FelixIP has nailed it! Simply use the Euclidean Allocation tool, making sure you set your outer boundary as the mask and processing extent, then choose a sensible cell size to produce a smooth raster which you can then turn back into a polygon.

Here is the output of the Allocation tool built from the inner hashed polygons but constrained (masked) by the outer black line:

Euclidean Allocation

It would be a simple matter of converting the raster back to a polygon featureclass. This approach may introduce a slight zig-zag edge to the final polygons because they are derived from a raster, if you are prepared to accept that then this problem is reduced to running two tools, Euclidean Allocation then raster to polygon.

  • 3
    To reduce the zig-zag, just buffer your boundary for the Euclidean Allocation, and then clip by the original. – Paul Oct 1 '18 at 23:25
  • This is the kind of solution that I was hoping would be possible - it's produced exactly what I wanted. – liamvharris Oct 2 '18 at 15:04
1

There are some good suggestions and partial answers buried in the comments, so I'm quoting/paraphrasing them here:

@Vince's suggestions:

While possible, it's unlikely you'll find such a tool sitting in a shelf. This means you'll need to choose a development language (C++/C#/Python) and start coding. Given the bends in the green polygon chain, you'll need to decide how to handle line extension.

This isn't an Intro to GIS task, but if you work the problem in iterations, it can be solved.

  • First, structure a script to iterate the polygons in a DA SearchCursor.
  • Then add an InsertCursor to write the first FC to a new FC. Then identify the edge vertices (left and right).
  • Then, construct a line from the edge to the outer line (past it, then intersect).

@Hornbydd's suggestions:

If you can figure out how to explode the central polygons into their sides you could use the extend line tool. But it may be easier to manipulate geometries and use the near tool alongside cursors as @Vince has suggested.


@johns' suggestions:

ArcGIS has a Create Points at Corners of Polygon sample and ETGeowizards has a Perpendiculars to Polylines tool in its points group that you could apply to those points. The ET tool, however, is not one of its free tools.

1

There may be a way to do this with arcpy, but I'm not aware of any.

So here's how I would do it:

Using ArcObjects, write a C# routine that follows these steps:

Create a new empty polygon featureclass. Open an insertion cursor on it.

Retrieve the MapTopology from the TopologyExtension, then build the full extent.

Get a polyline representing the boundary of the polygon (using ITopologicalOperator3.Boundary).

Open a search cursor on your small polygons.

Loop through each small polygon. For each polygon feature call ITopologyGraph.GetParentEdges. From those parents, find the two edges that have both a left and a right parent edge. For those edges, find the points on the boundary closest to them (using IProximityOperator).

Create a new polygon feature. Populate the new feature's geometry with a polygon formed using IPointCollection.

Add points to the new polygon. IPointCollection.Add the point on the boundary polygon, then add the points in the parentedge where the small polygon is on the parent's right. Then add points between the two points on the outer boundary, then the other edge, then the points between the two boundary points. (ICurve.GetSubcurve using points from ICurve.QueryPointandDistance)

Verify the geometry is simple (ITopologicalOperator3.IsKnownSimple = false then ITopologicalOperator.Simplify()).

Insert the polygon feature into the output featureclass.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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