Comments (10)
Thanks for reporting this. I think that the problem may be that you are specifying the bbox in lat/lon coordinates, while keeping the output projection in sinusoidal. Is that the case ?
If so, could you try specifying the bbox in sinusoidal projection and see if it works ? Or also, specifying the bbox as is, and changing the output projection to lat/lon ?
If that solves the issue, I recon however that we should emphasize more that the bbox should be provided in coordinates of the output projection.
from modistsp.
thanks for quick response! I dont think it solves it though, both are specified as lat/long, options.json here as an example. Note tile coords and bbox dont intersect:
{
"sel_prod": "Vegetation Indexes_16Days_250m (M*D13Q1)",
"sensor": "Terra",
"prod_version": "6",
"start_date":"2016-08-12",
"end_date":"2016-08-12",
"bandsel": [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
"indexes_bandsel": [ 0, 0, 0, 0 ],
"quality_bandsel": [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
"start_x": 15,
"end_x": 15,
"start_y": 4,
"end_y": 4,
"user": "xxxxx",
"password": "xxxxxx",
"use_aria": false,
"download_server": "http",
"download_range": "full",
"proj": "Latlon WGS84",
"user_proj4": "+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0",
"out_res_sel": "Native",
"out_res": "native",
"full_ext": "Resized",
"resampling": "near",
"out_format": "GTiff",
"ts_format": "None",
"rts": "Yes",
"compress": {
"None": "None"
},
"nodata_change": "No",
"scale_val": "No",
"delete_hdf": "No",
"reprocess": "Yes",
"bbox": [7.9999, 46.125, 8.6249, 46.875],
"out_folder":"/home/joel/sim/test2/grid1/MODIS/NDVI",
"out_folder_mod":"/home/joel/sim/test2/grid1/MODIS/NDVI",
"MODIStspVersion": "1.3.2",
"custom_indexes": []
}
from modistsp.
Apologies, the options above don't seem to be valid for that date. Below is a reproducible example (with pwd/user/outDirPaths) the downloaded HDF will be MODIS tile H19/V4 and the processed tif will have a footprint of bbox but with no data as bbox and x/y parameters don't intersect. If I do the same in the GUI it will automatically download H18V4 which contains my bbox and therefore give valid data in the processed tif.
{
"sel_prod": "Vegetation Indexes_16Days_250m (M*D13Q1)",
"sensor": "Terra",
"prod_version": "6",
"start_date": "2008-08-12",
"end_date": "2008-08-12",
"bandsel": [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
"indexes_bandsel": [ 0, 0, 0, 0 ],
"quality_bandsel": [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
"start_x": 19,
"end_x": 19,
"start_y": 4,
"end_y": 4,
"user": "xxxx",
"password": "xxxx",
"use_aria": false,
"download_server": "http",
"download_range": "full",
"proj": "Latlon WGS84",
"user_proj4": "+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0",
"out_res_sel": "Native",
"out_res": "native",
"full_ext": "Resized",
"resampling": "near",
"out_format": "GTiff",
"ts_format": "None",
"rts": "Yes",
"compress": {
"None": "None"
},
"nodata_change": "No",
"scale_val": "No",
"delete_hdf": "No",
"reprocess": "Yes",
"bbox": [7.9999, 46.125, 8.6249, 46.875],
"out_folder":"xxxx",
"out_folder_mod":"xxxx",
"MODIStspVersion": "1.3.2",
"custom_indexes": []
}
from modistsp.
Ok. Thanks for providing the JSON: it should speed-up checking the issue. We'll try tomorrow to run MODIStsp with that json and see what's happening.
Lorenzo
from modistsp.
One quick question: the json you provided was saved from the GUI after inputting the "non intersecting" coordinates and clicking "Retrieve Tiles from Bounding box" ?
from modistsp.
Thanks again for looking into this! No, I have a template json (which I originally saved from the gui) then I use some grep/sed to set the lon/lat coords on each call to MODIStsp(). I hadn't noticed this button to be honest - and have never activated it. However, I just did an experiment: (1) loaded my template json (above) (2) clicked the "Retrieve Tiles from Bounding box" button and resaved this json. Results below of this new json, compare to template above, no difference I think, I don't see a keyword that reflects this button:
{
"sel_prod": "Vegetation Indexes_16Days_250m (M*D13Q1)",
"sensor": "Terra",
"prod_version": "6",
"start_date": "2008-08-12",
"end_date": "2008-08-12",
"bandsel": [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
"indexes_bandsel": [ 0, 0, 0, 0 ],
"quality_bandsel": [ 0, 0, 0, 0, 0, 0, 0, 0, 0 ],
"start_x": 18,
"end_x": 18,
"start_y": 4,
"end_y": 4,
"user": "xxx",
"password": "xxxx",
"use_aria": false,
"download_server": "http",
"download_range": "full",
"proj": "Latlon WGS84",
"user_proj4": "+init=epsg:4326 +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0",
"out_res_sel": "Native",
"out_res": "native",
"full_ext": "Resized",
"resampling": "near",
"out_format": "GTiff",
"ts_format": "None",
"rts": "Yes",
"compress": {
"None": "None"
},
"nodata_change": "No",
"scale_val": "No",
"delete_hdf": "No",
"reprocess": "Yes",
"bbox": [ 7.9999, 46.125, 8.6249, 46.875 ],
"out_folder": "xxxx",
"out_folder_mod": "xxxx",
"MODIStspVersion": "1.3.2",
"custom_indexes": []
}
from modistsp.
a couple of things:
-
I tried on my machine, and if I specify a non-overlapping bbox, cloick on "Retreive tiles from bounding box" and then save the JSON, the saved json has the correct tiles. The same happens if I save the file without clicking the button: I am asked if to correct the tiles, and if I press "Yes", then the tiles are correctly updated in the JSON . Could you confirm this behaviour ?
-
Besides this, what you are trying to do (modifying the bbox by rewriting only the bbox of the json) is not supported. If you want to proceed like that, you should modify both the bbox AND the start_x, end_x, etcetera. We have helper functions in MODIStsp that do that automatically before saving the json, but they are not currently exported. I could maybe "extract" them from the code base and send them to you if you want.
-
As an allternative, you could pass your extent to MODIStsp using a "spatial file" with the desired extent (e.g., a shapefile). See:
Just create a SpatialPolygons object of your extent, save it as shapefile with writeOGR and pass the filename in the call to MODIStsp:
MODIStsp(gui = FALSE, options_file = options_file, spatial_file_path = my_shape_filename )
- Notice that you are probably using an old versin. Current MODIStsp version is 1.3.3.1
Lorenzo
from modistsp.
- Yes I can confirm that works fine
- If that's no trouble would be great - be a cleaner way of updating other parameters like start/ end date compared to my sed/grep hacks.
- I'm having a gdal problem there, although its a gdal problem and separate issue (some details below mainly for my reference).
I think we can close this issue now - Thanks for all your help!
===============================================================
GDAL version in use:1.11.3
ERROR 4: `/home/joel/e.shp' not recognized as a supported file format.
gdalinfo failed - unable to open '/home/joel/e.shp'.
While my shape opens fine in QGIS and imports to R and plots fine also:
Thats how i generate the shape:
e <- as(raster::extent(rst), "SpatialPolygons")
e
class : SpatialPolygons
features : 1
extent : 9.375139, 10.12486, 46.12514, 46.87486 (xmin, xmax, ymin, ymax)
coord. ref. : NA
proj4string(e) <- "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs"
e
class : SpatialPolygons
features : 1
extent : 9.375139, 10.12486, 46.12514, 46.87486 (xmin, xmax, ymin, ymax)
coord. ref. : +proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0
shapefile(e, "~/e.shp", overwrite=T)
from modistsp.
Wild shot: try making a SpatialPolygonsDataFrame instead than a simple SpatialPolygons.
from modistsp.
I'll try to send you the "extracted" routines next week. Closing this now.
from modistsp.
Related Issues (20)
- KNDVI (expression) - MODIStsp HOT 3
- bounding box does not work HOT 1
- Error in .local(.Object, ...) when trying to use MODIStsp_extract HOT 2
- M*D17A3H server change HOT 2
- Update products HOT 5
- Problems of processing MCD19A1 and MCD19A3 HOT 1
- Timeout HOT 1
- Timeout MODIS server error when downloading HOT 4
- Problem with GUI in GitHub version 2.0.6.9000 of MODIStsp HOT 2
- Connection refused HOT 2
- How to download the NDVI-MODIS product of the version 6.1 using the package MODIStsp v.2.0.6 HOT 2
- The package doesn't work on the new Spectral Indexes I added HOT 1
- [SOLVED] MODIStsp package is showing Username and password invalid even when the same credentials are working for NASA earth data search website HOT 20
- Missing dependency for pkgdown HOT 2
- Fix image location for pkgdown HOT 7
- Call for maintainer HOT 9
- Issues related to product version update in #238 HOT 23
- Spatial packages update HOT 2
- Error: http server seems to be down! Please try again later. Aborting! HOT 1
- MOD21C3 Not Found HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from modistsp.