1

I have some raster files of an agricultural region. There are more than 50 small fields in the agricultural region. For each field, a shapefile has been provided. As shown in the image below, each polygon represents a field. In the attribute table of the each shapefile there is the field number along with other information (shown in image).

Data

I also have some satellite raster data and none of them cover the whole agricultural region. Only a portion of the agricultural region is covered by one raster (an example is shown below).

Overlay

I need to know the shapefiles' (polygon actually) name that falls inside the raster in this image. I can turn the labels on of all shapefiles and find the shapefiles' name one by one. As there are more than 20 rasters, doing that manually will take a lot of time.

Is there any way to know the shapefiles' name that falls inside the shown raster?

I am using ArcMap 10.5.

3
  • A shapefile is a dataset. So are you saying you have 50 datasets, each with a single polygon in it? You talk about turning on labels to get the name of the dataset, this suggests you have a field in your dataset which contains the name of the dataset. Please clarify? I am asking this as your question is mixing concepts and I'm guessing what you are calling a shapefile is in fact a geometry (of type polygon) in a shapefile?
    – Hornbydd
    Commented Jul 20, 2018 at 7:55
  • some information has been added. Can you please take a look.
    – Sourav
    Commented Jul 20, 2018 at 15:45
  • Your question is much improved!
    – Hornbydd
    Commented Jul 20, 2018 at 22:14

2 Answers 2

2

Totally agree with @stev_k in that having fields in separate shapefiles is not the way to go. Do as he/she suggest, run the Merge tool to combine them into a single FeatureClass (shapefile) this will make subsequent processing simpler.

Looking at your sample screen shots your raster appears to be a multi-band raster and what you want to do is extract the extent of the data (pixels with colour).

Below is a simple model showing you the steps.

Model

Step 1 is is to extract band 1 into a rasterlayer which I call "one band" so you go from your multiband to a single band displayed in grey scale. Note the black edge this is the NODATA region of this raster.

Extracting a single band

Step 2 is run the CON tool; the where clause is any value greater than 0 is set to 1 and the false value you leave blank which means it gets set to NODATA. This creates a mask raster where pixels are 1 where there had been data and NODATA where there had been none.

Step 3 is to convert your raster into a polygon:

Mask Polygon

Step 4 is to simply run the select by location tool using your mask polygon to select field polygons in your merged field dataset.

1
  • The individual shapefile for the individual field was generated due to the limited capability of the software my colleague used. However, now it is helpful for a different purpose. I have to clip the image of each field (multiple bands and vegetation indices) then export in RGB or grayscale band and save them to the individual folder. Thus, they can be opened in simple image viewer in a smartphone.
    – Sourav
    Commented Jul 24, 2018 at 22:20
1

If all the shapefiles have the same schema I would probably merge them into a single shapefile using the Merge tool (and keep the file name as an attribute) and then run a raster analysis. And then tell whoever gave you the data that is not the right way to do it - as has been pointed out, there is no need to have a seperate shapefile for each feature - it's merely creating more work for the users of the data.

You may also need to convert your raster to vector depending on what exact query you need - for example are you looking to select all shapes which are completely within the raster, or which just touch it?

3
  • completely within the raster.
    – Sourav
    Commented Jul 20, 2018 at 18:01
  • My colleague is using a locally developed small GIS software that only targets Agricultural Engineer. The software does not come with a handful of GIS options but it offers something closely related to Agriculture! It was not possible for him to export one shapefile. A long script has been developed based on individual shapefile and it will take plenty of time to edit all of them now.
    – Sourav
    Commented Jul 24, 2018 at 16:36
  • 2
    well, you can still do it, just follow the instructions above. It's just not the recommended way to store data
    – Stev_k
    Commented Jul 24, 2018 at 16:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.