I am modeling a map of the U.S. and placing a set number of pins in certain states dynamically. This will be animated. There will be a text file that will handle the number of pins each state will get. What I am stuck on is how to make sure that the pins stay within the boundaries of the state borders (or, at least, close to it)

My solution was to write a script that would restrain the auto-generated pins to the width and height of each state (in blender units) How would you do this using the Python API?