Hexagon Geospatial
MENU

ERDAS IMAGINE

Discuss and share topics of interest using ERDAS IMAGINE the world’s leading geospatial data authoring system.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
New Contributor
Posts: 3
Registered: ‎03-25-2018
Accepted Solution

Accuracy Issue with Subset Tool (subsets have different dimensions with same AOI)

Hey all,

 

Fairly new to ERDAS Imagine and GIS in general so I apologize in advance for not using correct terms. The basic aim of this workflow is to input a raster (single band nightlight .tif) and a shapefile of US counties and get back two rasters with exactly overlapping pixels that can be fed into MATLAB as two matrices of the same rank (i.e. if the rasters are 1000 pixels by 1000 pixels I will have 2 1000x1000 matrices in MATLAB with entry (i,j) corresponding to 1 pixel).

 

The following is my current process:

 

Step 1) Convert .shp file of US counties (attached) to raster (preferably 16 bit so that each "color" can be matched to a county) with same resolution as nightlight image (attached as 201204.tif).
 
Step 2) Subset both raster files to same AOI (just a rectangle around the lower 48 states).
 
Step 3) Now I should have two raster files that can be exported to MATLAB as matrices of the same dimensions.
 
The problem I am having is that the output rasters in step 2 always have slightly different dimensions even though I subset using the same AOI. I attached a screenshot of the metadata showing the slight differences. I have tried multiple fixes already:
1) chaging the output of vector to raster to float to match .tif
2) making sure the projections match
3) I attempted to manually input dimensions (ULX, ULY, etc.) into output box
 
None of these have resulted in a match between the two rasters.
 
I have attached the screenshot of output difference for reference and the link below has a zip file containing the .tif, shapefile, and AOI file
 
 
Any advice would be greatly appreciated. Thanks in advance.
Staff
Posts: 513
Registered: ‎02-02-2016

Re: Accuracy Issue with Subset Tool (subsets have different dimensions with same AOI)

I have attached a spatial model which will convert your Shapefile to a raster image then subset both this image and the nightlight image to the same boundary. I used an Inquire Box created from your AOI file to set the boundary for the input raster file and then used the “intersection of inputs” window rule in the Define Processing Area operator so that both output rasters have the exact same boundary.

subset_model1.png

Kind regards,

 

Stephen Bent

Hexagon Geospatial Support

New Contributor
Posts: 3
Registered: ‎03-25-2018

Re: Accuracy Issue with Subset Tool (subsets have different dimensions with same AOI)

This is amazing. Thank you very much. The only thing I'd like to change is to keep the format of the nightlight image (i.e. keep it continuos rather than 16 bit). Is that simply changing one of the parameters? 

Staff
Posts: 513
Registered: ‎02-02-2016

Re: Accuracy Issue with Subset Tool (subsets have different dimensions with same AOI)

When entering the names for the output raster files you just need to change the file type from the default of IMAGINE Image (*.img) to TIFF.

 

file_type.png

 

Regards,

 

Stephen Bent

Hexagon Geospatial Support

Technical Evangelist
Posts: 509
Registered: ‎10-01-2015

Re: Accuracy Issue with Subset Tool (subsets have different dimensions with same AOI)

[ Edited ]

Or did you mean "Float" rather than "Continuous"? If so just change that on the Raster Input operator. Or you could use a Raster Information operator to determine the DataType of the Raster Input and pass that to the Raster Output (PixelType port).

Ian Anderson
Chief Product Owner, Desktop Remote Sensing
Hexagon Geospatial
Staff
Posts: 513
Registered: ‎02-02-2016

Re: Accuracy Issue with Subset Tool (subsets have different dimensions with same AOI)

Sorry about that, obviously I had not consumed enough coffee yet. I have attached an updated model that includes the Raster Information operator to pass the Data Type of the input raster to both output raster files.

 

subset_model2.png

 

Regards,

 

Stephen Bent

Hexagon Geospatial Support

Technical Evangelist
Posts: 509
Registered: ‎10-01-2015

Re: Accuracy Issue with Subset Tool (subsets have different dimensions with same AOI)

Caffeine always helps.

 

Ian Anderson
Chief Product Owner, Desktop Remote Sensing
Hexagon Geospatial
Do you need immediate support?
If you encounter a critical issue and need immediate assistance please submit a Service Request through our Support Portal.