Hi there,
I need some help.
For creating polygons on the same latitude, I asked it several days ago.
It's the link.
creating polygons on the same latitude
Darren Wiens gave me a phyton script.
But whenever I tried the script on my arcgis, it was shut down.
I'm wondering about whether it's problem of the script, my shapefile or my arcgis.
Because of my shitty desktop, I tried to reduced the number of copy and my shapefile is so simplified (it's below 5kb).
It's the link
And it's the script I used.
I just replaced Darren's 'polys' with 'sk'.
Solved! Go to Solution.
Make sure your data is projected.
The following Python script will copy features from a layer ("polys"), the number of times specified in "numCopies", separated by the distance "distBtw" (in the layer's linear unit)
^ the script uses the distance unit taken from the spatial reference. Once your coordinate system is defined, it should work.
Make sure your data is projected.
The following Python script will copy features from a layer ("polys"), the number of times specified in "numCopies", separated by the distance "distBtw" (in the layer's linear unit)
^ the script uses the distance unit taken from the spatial reference. Once your coordinate system is defined, it should work.
Confirmed, the script by Darren Wiens works with the recommendation that you will need to have a projected coordinate system. Since your data seems to have geographic coordinates I assigned WGS1984 and changed the settings a bit to get a result (dist between of 5 degrees, since the width is a little over 3 degrees and reduced the number of copies to 20):
fc = "sk" outsk = [] numCopies = 20 distBtw = 5 sr = arcpy.Describe(fc).spatialReference with arcpy.da.SearchCursor(fc,["SHAPE@"],spatial_reference=sr) as cursor: for row in cursor: for i in range(1,numCopies+1): array = arcpy.Array() for part in row[0]: for pnt in part: array.append(arcpy.Point(pnt.X+distBtw*i,pnt.Y)) outsk.append(arcpy.Polygon(array,sr)) arcpy.CopyFeatures_management(outsk,r'in_memory\outsk')
This yielded the following result:
... which results in the ever lasting question... why would you want this?
And yes I did read the other thread that Dan Patterson refers to..., but the question remains...
Thanks.
It worked for me too.
In 1964, there was research about north American mammal distribution by G. G. Simpson.
One of his finding is 'peninsula effect'.
Florida has less mammalian species richness than similar non-peninsula places on the same latitude.
Since he used rough grid system, he wasn't sure about the effect.
Including mammals, most of biodiversity shows latitudinal gradient.
So, I'm comparing Korean peninsula with continental regions. To control size and shape, I wanted to create Korean peninsula polygons inside of Eurasian and N. American continent.
Then, I'll figure out the specie richness in Korea is weather random event or decided by some factors such as temperature, precipitation, habitat heterogeneity, topology, anthropogenic disturbance and surrounded ocean.