10-16-2018 12:33 PM
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:
Solved! Go to Solution.
10-19-2018 07:56 AM
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.
Kind regards,
Stephen Bent
Hexagon Geospatial Support
10-19-2018 08:30 AM
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?
10-19-2018 08:47 AM
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.
Regards,
Stephen Bent
Hexagon Geospatial Support
10-19-2018 08:53 AM - edited 10-19-2018 08:57 AM
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).
10-19-2018 12:49 PM
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.
Regards,
Stephen Bent
Hexagon Geospatial Support
10-19-2018 01:05 PM
Caffeine always helps.