# Algorithm to put label of bounds (bounds layer) inside of polygons (polygon layer)

I hope to put labels of bounds inside of the polygon in intersection with like you can see in the picture below.

I have checked multiple solutions as a topology or Maplex but it doesn't create the relationship between the labels of the point layer and another polygon layer...

So I think I necessary should pass through a programmation.

I thought to make this algorithm :

• Convert label to annotation
• Calculate XY of each annotation
• force each annotation to enter in the nearest corner of the polygon in intersection with

I'm not keen to follow this algorithm, I'm looking for any other suggestion.

I'm using ArcGIS 10.1, arcpy, ArcObjects

• What an interesting problem. I wonder if you could create a centroid, explode the polygon to vertices, and then calculate the angle from the exploded points to the centroid. The points could be labeled via angle field and offset?
– GISI
Mar 8 '15 at 9:55
• What about vertex to point, buffer, clip the buffers then label that with the 'inside' option - placing the buffers as invisible polygons with labels. Give the original polygon a high feature weight. This isn't an arcobjects solution though. How are you intending to place your text? As an IFeature object or as an IElement (ITextElement)? Is it going to be permanent or placed on refresh? Mar 9 '15 at 0:14
• @geosevda I'm in the same problem, do you progress in a solution? Mar 15 '15 at 1:31
• @GISI I do exacly as you mentioned, but do that to 1k points it's a hard work. Mar 15 '15 at 1:46
• unfortunately i do not i was token by an other work and let that for later... if do you make any progress make me know it plz Mar 26 '15 at 10:15

This is a non-programming workaround, but seemed to work for me with the example you gave. Cannot guarantee this will work for every polygon shape.

One option would be to create a polygon layer which is the exact inverse of your polygon layer using the Erase tool or similar. It should extend beyond your polygon layer. Mine looks like this:

Then, turn on Maplex and in the conflict resolution tab of the inverted polygon layer, set the Interior feature weight and the boundary feature weight to 1000. This will prevent labels from being placed on the inverted polygon.

Now label your points:

In my case, I had to tweak some of the label settings of the point layer. Particularly the maximum offset setting in the Label Offset:

You will need to keep this layer on, but you can set the fill and outline to no colour and you'll get your result:

• This seems like more work than just converting the labels to annotation and moving them. A better solution would be to create a polygon to cover all your existing polygons then use the erase tool to remove the existing polygons from the new polygon Feb 23 '17 at 3:03
• While I didn't explicitly state it, it was implied that an erase function would be used to create the inverted polygon. I've edited my answer to clarify.
– Fezter
Feb 23 '17 at 3:05