Selecting MAX in Arcmap
#1
Posted 18 January 2009 - 06:57 AM
I have created a vector fishnet with some 70.000 cells (1 degree x 1 degree).
This fishnet i intersected with a country polygon layer. Then i calculated the area of the polygons.
What i want is to select the part of the cell represented by the largest area country.
Example: If one cell is split between Congo and Uganda, and the first has 400 km2, and the second 200 km2 i want to select the largest and remove the smallest. The reason i do this is that i want to establish state ownership of all the cells in the fishnet.
So far i have done this in Access, but this is too time consuming having to convert dbf to xlsx and the back into the Arcgis.
The code i used in Access is posted below.
How can i do this in ArcGis?
SELECT * INTO MAX_GRID
FROM GRID_1973_Calculatearea1 AS a
WHERE ((([a].[F_AREA]) In (select max(F_AREA) from GRID_1973_Calculatearea1 b where a.POLY_ID = b.POLY_ID)));
#2
Posted 19 January 2009 - 03:18 AM
#3
Posted 21 January 2009 - 04:43 PM
You could do this fairly easily in raster - with a majority filter - is that an option? (you would have your 1 deg fishnet, and rasterize the country polys to a higher resolution e.g. 0.25 deg or something, and then run a majority filter on it)
Thank you for the reply Hugo, i will definatly give it a go!
#4
Posted 22 January 2009 - 02:22 AM
#5
Posted 22 January 2009 - 04:10 PM
Let us know how it goes! I often find working with rasters more straight forward and intuitive (and fun!) compared to vectors.
I am working on this now. As i see from the Tool Majority Filter in Spatial Analysis i can make it calculate the majority of its 8 neighbours. I am a bit unsure how this could make me find the biggest share of a 1x1 degree raster.
I would need something like a summary of the rasters inside another raster with a bigger cell size, and one that generalize this to be only the largest coverage inside this 1x1 degree raster.
Maybe i am missing something, but i couldnt really make this majority filter do my thing.
Anyway, really happy for your help!
#6
Posted 22 January 2009 - 04:12 PM
What if i resample the raster to my new raster size and choose majority resampling technique there. Could that be it?I am working on this now. As i see from the Tool Majority Filter in Spatial Analysis i can make it calculate the majority of its 8 neighbours. I am a bit unsure how this could make me find the biggest share of a 1x1 degree raster.
I would need something like a summary of the rasters inside another raster with a bigger cell size, and one that generalize this to be only the largest coverage inside this 1x1 degree raster.
Maybe i am missing something, but i couldnt really make this majority filter do my thing.
Anyway, really happy for your help!
#7
Posted 23 January 2009 - 02:44 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users


Sign In
Create Account

Norway
Back to top
Sweden









