gdal_translate in R changing the cell resolution of extracted subdataset from HDF The Next CEO of Stack OverflowHow to extract subdataset from HDF raster?GDAL 2.0.1/QGIS 2.14.0 on OSX won't open MODIS HDF?Recommendation for getting TIF raster from modis HDF, for processing in Rsmoothing raster layer stack using RConvert MODIS HDF file in sinusoidal projection into GeoTiff withR-Studio0.99, How to compute correlation between two rasters and serial correlationOpen HDF4 Files using GDAL on WindowsIterating and extracting subdatasets from hdf files and exporting data into MS excel using ModelBuilder?Issue with gdalUtils vs. raster in gridding data in RIssue running GDAL_Translate on Redhat PPC64
How seriously should I take size and weight limits of hand luggage?
My boss doesn't want me to have a side project
Does int main() need a declaration on C++?
How dangerous is XSS
Traveling with my 5 year old daughter (as the father) without the mother from Germany to Mexico
Is the offspring between a demon and a celestial possible? If so what is it called and is it in a book somewhere?
Man transported from Alternate World into ours by a Neutrino Detector
Is it possible to make a 9x9 table fit within the default margins?
Is there a rule of thumb for determining the amount one should accept for a settlement offer?
Another proof that dividing by 0 does not exist -- is it right?
Is it correct to say moon starry nights?
Strange use of "whether ... than ..." in official text
Salesforce opportunity stages
Are British MPs missing the point, with these 'Indicative Votes'?
Could a dragon use its wings to swim?
How can a day be of 24 hours?
Read/write a pipe-delimited file line by line with some simple text manipulation
Cannot restore registry to default in Windows 10?
Does Germany produce more waste than the US?
What difference does it make matching a word with/without a trailing whitespace?
How to implement Comparable so it is consistent with identity-equality
Can a PhD from a non-TU9 German university become a professor in a TU9 university?
How to find if SQL server backup is encrypted with TDE without restoring the backup
How exploitable/balanced is this homebrew spell: Spell Permanency?
gdal_translate in R changing the cell resolution of extracted subdataset from HDF
The Next CEO of Stack OverflowHow to extract subdataset from HDF raster?GDAL 2.0.1/QGIS 2.14.0 on OSX won't open MODIS HDF?Recommendation for getting TIF raster from modis HDF, for processing in Rsmoothing raster layer stack using RConvert MODIS HDF file in sinusoidal projection into GeoTiff withR-Studio0.99, How to compute correlation between two rasters and serial correlationOpen HDF4 Files using GDAL on WindowsIterating and extracting subdatasets from hdf files and exporting data into MS excel using ModelBuilder?Issue with gdalUtils vs. raster in gridding data in RIssue running GDAL_Translate on Redhat PPC64
I'm trying to extract subdataset from MODIS LST HDFs using following code.
library(gdalUtils)
HDF_list = list.files(path, pattern= "\.hdf$", all.files=FALSE, full.names=TRUE,recursive=FALSE)
gdal_translate(get_subdatasets(HDF_list[1])[5], dst_dataset = "sds4.tif")
But the Output raster (sds4.tif) is having different cellsize [929.378147, 907]. [926.6254331, 926.6254331] is the original cellsize of HDF file.
gdal r hdf gdalutils
bumped to the homepage by Community♦ 2 days ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
I'm trying to extract subdataset from MODIS LST HDFs using following code.
library(gdalUtils)
HDF_list = list.files(path, pattern= "\.hdf$", all.files=FALSE, full.names=TRUE,recursive=FALSE)
gdal_translate(get_subdatasets(HDF_list[1])[5], dst_dataset = "sds4.tif")
But the Output raster (sds4.tif) is having different cellsize [929.378147, 907]. [926.6254331, 926.6254331] is the original cellsize of HDF file.
gdal r hdf gdalutils
bumped to the homepage by Community♦ 2 days ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Not sure we can test this without at least one sample HDF - where are you getting them from? Can you share one?
– Spacedman
Feb 28 at 10:35
Sample File: drive.google.com/file/d/1ZQqF8IHds8uxHqevxTee4JQmZ8I3rOpU/…
– Ritesh Porwal
Feb 28 at 10:44
Use gdal_translate with the -tr parameter
– user30184
Feb 28 at 11:40
i have already used -tr parameter but didn't work.
– Ritesh Porwal
Feb 28 at 11:58
add a comment |
I'm trying to extract subdataset from MODIS LST HDFs using following code.
library(gdalUtils)
HDF_list = list.files(path, pattern= "\.hdf$", all.files=FALSE, full.names=TRUE,recursive=FALSE)
gdal_translate(get_subdatasets(HDF_list[1])[5], dst_dataset = "sds4.tif")
But the Output raster (sds4.tif) is having different cellsize [929.378147, 907]. [926.6254331, 926.6254331] is the original cellsize of HDF file.
gdal r hdf gdalutils
I'm trying to extract subdataset from MODIS LST HDFs using following code.
library(gdalUtils)
HDF_list = list.files(path, pattern= "\.hdf$", all.files=FALSE, full.names=TRUE,recursive=FALSE)
gdal_translate(get_subdatasets(HDF_list[1])[5], dst_dataset = "sds4.tif")
But the Output raster (sds4.tif) is having different cellsize [929.378147, 907]. [926.6254331, 926.6254331] is the original cellsize of HDF file.
gdal r hdf gdalutils
gdal r hdf gdalutils
asked Feb 28 at 9:31
Ritesh PorwalRitesh Porwal
487
487
bumped to the homepage by Community♦ 2 days ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 2 days ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
Not sure we can test this without at least one sample HDF - where are you getting them from? Can you share one?
– Spacedman
Feb 28 at 10:35
Sample File: drive.google.com/file/d/1ZQqF8IHds8uxHqevxTee4JQmZ8I3rOpU/…
– Ritesh Porwal
Feb 28 at 10:44
Use gdal_translate with the -tr parameter
– user30184
Feb 28 at 11:40
i have already used -tr parameter but didn't work.
– Ritesh Porwal
Feb 28 at 11:58
add a comment |
Not sure we can test this without at least one sample HDF - where are you getting them from? Can you share one?
– Spacedman
Feb 28 at 10:35
Sample File: drive.google.com/file/d/1ZQqF8IHds8uxHqevxTee4JQmZ8I3rOpU/…
– Ritesh Porwal
Feb 28 at 10:44
Use gdal_translate with the -tr parameter
– user30184
Feb 28 at 11:40
i have already used -tr parameter but didn't work.
– Ritesh Porwal
Feb 28 at 11:58
Not sure we can test this without at least one sample HDF - where are you getting them from? Can you share one?
– Spacedman
Feb 28 at 10:35
Not sure we can test this without at least one sample HDF - where are you getting them from? Can you share one?
– Spacedman
Feb 28 at 10:35
Sample File: drive.google.com/file/d/1ZQqF8IHds8uxHqevxTee4JQmZ8I3rOpU/…
– Ritesh Porwal
Feb 28 at 10:44
Sample File: drive.google.com/file/d/1ZQqF8IHds8uxHqevxTee4JQmZ8I3rOpU/…
– Ritesh Porwal
Feb 28 at 10:44
Use gdal_translate with the -tr parameter
– user30184
Feb 28 at 11:40
Use gdal_translate with the -tr parameter
– user30184
Feb 28 at 11:40
i have already used -tr parameter but didn't work.
– Ritesh Porwal
Feb 28 at 11:58
i have already used -tr parameter but didn't work.
– Ritesh Porwal
Feb 28 at 11:58
add a comment |
1 Answer
1
active
oldest
votes
The HDF metadata has:
UpperLeftPointMtrs=(7783653.638366,3335851.559300)
LowerRightMtrs=(8895604.158132,2223901.039533)
and the grids are 1200x1200. That gives a cell size of:
> (7783653.638366-8895604.158132)/1200
[1] -926.6254
> (3335851.559300 - 2223901.039533)/1200
[1] 926.6254
>
Converting band 5 of your test file gets me:
> path = "MOD11A1.A2008005.h25v06.006.2015337154719.hdf"
> gdal_translate(get_subdatasets(path)[5], dst_dataset="band5.tif")
NULL
> b5 = raster("./band5.tif")
> b5
class : RasterLayer
dimensions : 1200, 1200, 1440000 (nrow, ncol, ncell)
resolution : 926.6254, 926.6254 (x, y)
extent : 7783654, 8895604, 2223901, 3335852 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs
data source : /nobackup/rowlings/Downloads/band5.tif
names : band5
values : 0, 65535 (min, max)
a raster with exactly those resolutions. So I can't duplicate your error.
add a comment |
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "79"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f313869%2fgdal-translate-in-r-changing-the-cell-resolution-of-extracted-subdataset-from-hd%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The HDF metadata has:
UpperLeftPointMtrs=(7783653.638366,3335851.559300)
LowerRightMtrs=(8895604.158132,2223901.039533)
and the grids are 1200x1200. That gives a cell size of:
> (7783653.638366-8895604.158132)/1200
[1] -926.6254
> (3335851.559300 - 2223901.039533)/1200
[1] 926.6254
>
Converting band 5 of your test file gets me:
> path = "MOD11A1.A2008005.h25v06.006.2015337154719.hdf"
> gdal_translate(get_subdatasets(path)[5], dst_dataset="band5.tif")
NULL
> b5 = raster("./band5.tif")
> b5
class : RasterLayer
dimensions : 1200, 1200, 1440000 (nrow, ncol, ncell)
resolution : 926.6254, 926.6254 (x, y)
extent : 7783654, 8895604, 2223901, 3335852 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs
data source : /nobackup/rowlings/Downloads/band5.tif
names : band5
values : 0, 65535 (min, max)
a raster with exactly those resolutions. So I can't duplicate your error.
add a comment |
The HDF metadata has:
UpperLeftPointMtrs=(7783653.638366,3335851.559300)
LowerRightMtrs=(8895604.158132,2223901.039533)
and the grids are 1200x1200. That gives a cell size of:
> (7783653.638366-8895604.158132)/1200
[1] -926.6254
> (3335851.559300 - 2223901.039533)/1200
[1] 926.6254
>
Converting band 5 of your test file gets me:
> path = "MOD11A1.A2008005.h25v06.006.2015337154719.hdf"
> gdal_translate(get_subdatasets(path)[5], dst_dataset="band5.tif")
NULL
> b5 = raster("./band5.tif")
> b5
class : RasterLayer
dimensions : 1200, 1200, 1440000 (nrow, ncol, ncell)
resolution : 926.6254, 926.6254 (x, y)
extent : 7783654, 8895604, 2223901, 3335852 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs
data source : /nobackup/rowlings/Downloads/band5.tif
names : band5
values : 0, 65535 (min, max)
a raster with exactly those resolutions. So I can't duplicate your error.
add a comment |
The HDF metadata has:
UpperLeftPointMtrs=(7783653.638366,3335851.559300)
LowerRightMtrs=(8895604.158132,2223901.039533)
and the grids are 1200x1200. That gives a cell size of:
> (7783653.638366-8895604.158132)/1200
[1] -926.6254
> (3335851.559300 - 2223901.039533)/1200
[1] 926.6254
>
Converting band 5 of your test file gets me:
> path = "MOD11A1.A2008005.h25v06.006.2015337154719.hdf"
> gdal_translate(get_subdatasets(path)[5], dst_dataset="band5.tif")
NULL
> b5 = raster("./band5.tif")
> b5
class : RasterLayer
dimensions : 1200, 1200, 1440000 (nrow, ncol, ncell)
resolution : 926.6254, 926.6254 (x, y)
extent : 7783654, 8895604, 2223901, 3335852 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs
data source : /nobackup/rowlings/Downloads/band5.tif
names : band5
values : 0, 65535 (min, max)
a raster with exactly those resolutions. So I can't duplicate your error.
The HDF metadata has:
UpperLeftPointMtrs=(7783653.638366,3335851.559300)
LowerRightMtrs=(8895604.158132,2223901.039533)
and the grids are 1200x1200. That gives a cell size of:
> (7783653.638366-8895604.158132)/1200
[1] -926.6254
> (3335851.559300 - 2223901.039533)/1200
[1] 926.6254
>
Converting band 5 of your test file gets me:
> path = "MOD11A1.A2008005.h25v06.006.2015337154719.hdf"
> gdal_translate(get_subdatasets(path)[5], dst_dataset="band5.tif")
NULL
> b5 = raster("./band5.tif")
> b5
class : RasterLayer
dimensions : 1200, 1200, 1440000 (nrow, ncol, ncell)
resolution : 926.6254, 926.6254 (x, y)
extent : 7783654, 8895604, 2223901, 3335852 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=sinu +lon_0=0 +x_0=0 +y_0=0 +a=6371007.181 +b=6371007.181 +units=m +no_defs
data source : /nobackup/rowlings/Downloads/band5.tif
names : band5
values : 0, 65535 (min, max)
a raster with exactly those resolutions. So I can't duplicate your error.
answered Feb 28 at 12:21
SpacedmanSpacedman
24.7k23551
24.7k23551
add a comment |
add a comment |
Thanks for contributing an answer to Geographic Information Systems Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fgis.stackexchange.com%2fquestions%2f313869%2fgdal-translate-in-r-changing-the-cell-resolution-of-extracted-subdataset-from-hd%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Not sure we can test this without at least one sample HDF - where are you getting them from? Can you share one?
– Spacedman
Feb 28 at 10:35
Sample File: drive.google.com/file/d/1ZQqF8IHds8uxHqevxTee4JQmZ8I3rOpU/…
– Ritesh Porwal
Feb 28 at 10:44
Use gdal_translate with the -tr parameter
– user30184
Feb 28 at 11:40
i have already used -tr parameter but didn't work.
– Ritesh Porwal
Feb 28 at 11:58