obtaining Geotiff file from JPG file

조회 수: 2 (최근 30일)
Andrei Silviu
Andrei Silviu 2013년 4월 16일
답변: prabhat kumar sharma 2025년 1월 10일
Hi!!! i'm using this lines of code: basename='domaine'; imagefile=[basename '.jpeg']; RGB=imread(imagefile); worldfile=getworldfilename(imagefile); R=worldfileread(worldfile,'geographic', size(RGB)); filename=[basename '.tif']; geotiffwrite(filename, RGB, R)
and i'm getting this error:
Error using internal.map.checkfilename>checkDiskfilename (line 173) Function WORLDFILEREAD was unable to find file 'domaine.jpegw'.
How can i fix it? thanks in advance

답변 (1개)

prabhat kumar sharma
prabhat kumar sharma 2025년 1월 10일
Hello Andrei,
The error you're encountering indicates that the worldfileread function is unable to find the associated world file (.jpegw) for your image (domaine.jpeg). A world file is a plain text file that provides georeferencing information for raster images. It typically has the same name as the image file but with an additional "w" at the end of the extension (e.g., domaine.jpegw).
To fix it:
  1. Create a World File: Manually create domaine.jpegw with the necessary georeferencing parameters (6 lines of text).
  2. Ensure Correct Naming: Place domaine.jpegw in the same directory as domaine.jpeg.
Once the world file is correctly set up, your code should work without errors.

카테고리

Help CenterFile Exchange에서 Import, Export, and Conversion에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by