geoimread
GEOIMREAD reads a sub region of a geotiff or geojp2 image.
% Syntax
A = geoimread(filename)
A = geoimread(filename,xlim,ylim)
A = geoimread(filename,latlim,lonlim)
A = geoimread(...,buffer)
[A,x,y,I] = geoimread(...)
geoimread(...)
% Description
A = geoimread(filename) returns the full image given by a filename. This
syntax is equivalent to A = geotiffread(filename).
A = geoimread(filename,xlim,ylim) limits the region of the geotiff file to
the limits given by xlim and ylim, which are map units (usually meters) relative
to the data projection. For example, if the geotiff is projected in Texas Centric
Mapping System/Lambert Conformal coordinates, xlim and ylim will have units of
meters relative to the origin (100 W, 18 N). xlim and ylim can be multimensional,
in which case the limits of the map will be taken as the limits of the limits of
the distribution of all points in xlim, ylim.
A = geoimread(filename,latlim,lonlim) if no values in xlim, ylim exceed
normal values of latitudes and longitudes, geoimread assumes you've entered
limits in geographic coordinates of degrees latitude and longitude. The first
input is latitude, the second input is longitude.
A = geoimread(...,buffer) adds a buffer in map units (usually meters or feet) to the
limits of the region of interest. This may be useful if you want to load an image
surrounding scattered lat/lon data. If you'd like an extra 2 kilometers of image around
your data, enter 2000 as the buffer. If buffer is a two-element vector, the first
element is applied to the left and right extents of the image, and the second element
is applied to the top and bottom extents of the image.
[A,x,y,I] = geoimread(...) also returns pixel center coordinates (x,y) of the
output image and a geotiff info structure I. I is a useful input for projfwd and projinv.
geoimread(...) without any outputs shows the output image A without loading
any data into the workspace.
% Examples:
% Show a whole geotiff:
geoimread('boston.tif');
% Compare results from above to a subset geotiff:
mapx = [765884 766035 766963]; % units are feet
mapy = [2959218 2957723 2958972];
geoimread('boston.tif',mapx,mapy)
% Or if you have coordinates in lat/lon and you want a 500 foot buffer:
lat = [42.3675288 42.3634246 42.3668397];
lon = [-71.0940009 -71.0934685 -71.0900125];
geoimread('boston.tif',lat,lon,500);
Citation pour cette source
Aslak Grinsted (2024). geoimread (https://www.mathworks.com/matlabcentral/fileexchange/46904-geoimread), MATLAB Central File Exchange. Extrait(e) le .
Compatibilité avec les versions de MATLAB
Plateformes compatibles
Windows macOS LinuxCatégories
- Mathematics and Optimization > Mapping Toolbox > Data Import and Export >
- Radar > Mapping Toolbox > Data Import and Export >
- Image Processing and Computer Vision > Image Processing Toolbox > Image Filtering and Enhancement > ROI-Based Processing >
Tags
Remerciements
A inspiré : How to drape Landsat images over Bedmap2 topography, landsat, geotiffinterp, RAMP Radarsat Antarctic Mapping Project, L8read Landsat 8 Level 1 tiff reader, Calculate the Sum of the nightlights data from TIFF images, IBCSO International Bathymetric Chart of the Southern Ocean
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Découvrir Live Editor
Créez des scripts avec du code, des résultats et du texte formaté dans un même document exécutable.
html/
Version | Publié le | Notes de version | |
---|---|---|---|
1.5.0.0 | Added some workarounds to make some of the functionality work without mapping toolbox. |
||
1.4.0.0 | Further improvements from Chad Greene: Added html example |
||
1.3.0.0 | Renamed and added Misc improvements from Chad Greene:
|
||
1.2.0.0 | changed description to better reflect the geo jpg2000 features. |
||
1.1.0.0 | added ability to read geojp2 files |
||
1.0.0.0 |