Jump to content

 
Photo

Selecting MAX in Arcmap

- - - - -

  • Please log in to reply
6 replies to this topic

#1
spesseh

spesseh

    Key Contributor

  • Validated Member
  • PipPipPip
  • 62 posts
  • Norway

Hi.
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)));
Andreas

Visit my Blog: http://www.gisintersect.com

#2
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,312 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

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)
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#3
spesseh

spesseh

    Key Contributor

  • Validated Member
  • PipPipPip
  • 62 posts
  • Norway

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!
Andreas

Visit my Blog: http://www.gisintersect.com

#4
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,312 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

Let us know how it goes! I often find working with rasters more straight forward and intuitive (and fun!) compared to vectors.
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter

#5
spesseh

spesseh

    Key Contributor

  • Validated Member
  • PipPipPip
  • 62 posts
  • Norway

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!
Andreas

Visit my Blog: http://www.gisintersect.com

#6
spesseh

spesseh

    Key Contributor

  • Validated Member
  • PipPipPip
  • 62 posts
  • Norway

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!

What if i resample the raster to my new raster size and choose majority resampling technique there. Could that be it?
Andreas

Visit my Blog: http://www.gisintersect.com

#7
frax

frax

    Hall of Fame

  • Associate Admin
  • PipPipPipPipPipPipPip
  • 2,312 posts
  • Gender:Male
  • Location:Stockholm, Sweden
  • Interests:music, hiking, friends, nature, photography, traveling. and maps!
  • Sweden

Rasterize the countries to a higher resolution. You also want to make the operation a zonal operation, and not a neighborhood analysis.
Hugo Ahlenius
Nordpil - custom maps and GIS
http://nordpil.com/
Twitter




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

-->