resize multiple features in shapefile

1006
6
07-08-2020 10:03 AM
AlexandreCazenave
New Contributor

Hi, 

I have a shapefile containing more than 300 polygones in it. Each polygone touch each other, creating like a grid.

I would like to rescale each features at about 0.75 of the size they currently have but keeping their center point where they are (thus, it would create some empty space between each polygone).

If I select them all, and apply the scaling tool, it is scaling down the full shapefile and therefore moving each polygone from where they were to a new position closer to the center of the shapefile.

I saw different people asking this question already, but nobody got a workable solution.

help.

Thanks

0 Kudos
6 Replies
DavidPike
MVP Frequent Contributor

If you're in projected space it should be easy to run a search cursor to grab the SHAPE@XY for each polygon and perform the next steps to use an insert cursor to create new geometries.

0 Kudos
AlexandreCazenave
New Contributor

I have no idea what you are talking about. I am sorry

My shapefile is a "fishnet" grid, geolocated in space, representing a crop field composed on different subparts in this field. Each polygon in the shapefile represent one of these subparts.

I use a model to extract the data from drone images using this shapefile, and give me the stats of pixels in each of these polygons

0 Kudos
DavidPike
MVP Frequent Contributor

Sure, what I'd suggest is getting the geometry of each of your polygons using a script. If your polygons are a square grid you could easily resize it by getting the feature centroids for each square and create a new point grid.

Then buffering them by a value ( if your length is 2km, buffer the centroid by 0.75km then use the feature envelope to polygon tool to get the rectangular extent.

If the features are not square, you would need to get the coordinate pairs which construct the polygon using a cursor (script thing). i.e. if your feature has coordinates (clockwise from top left)

{ (4, 16),

  (32, 16),

  (32, 8),

  (4, 😎 }

you would want to change them to: (25% difference between them)

{(11, 14),

 (25, 14),

 (32, 10),

 (4, 10)}

AlexandreCazenave
New Contributor

My grid is pretty squared. So the first solution could work.

When I select on of the polygon, I obviously get the centroid of it.

My problem is that when I select 2, or more polygons, I get only one centroid, and it would be between all the polygon, instead of one per polygon. How could I get the centroid of each square?

0 Kudos
DavidPike
MVP Frequent Contributor

Run it through an iterator or use the Search Cursor to return the SHAPE@XY token for each feature.

0 Kudos
AlexandreCazenave
New Contributor

I have tried to create what you said but without success.

I cannot find the SearchCursor tool.

Could you give me an example in Model Builder which would Iterate through a grid to activate Search Cursor?

And then, once, I have that, I would have to use the buffering, right?

0 Kudos