i.sentinel.mask: adapt for non-SQlite vector databases
This PR adaps i.sentinel.mask such that it works in a mapset with a non-SQlite vector database connection. SQlite allows some simplifications of commands that are not possible in other systems (tested here with PostgreSQL):
- when running
v.db.addtableto also add new columns, the datatype of the column must be indicated - running
v.db.droptableonly works if the table exists in the database, it will otherwise throw an error. Because of this, a check is now implemented beforehand - running
v.to.dbalready creates an appropriate column so it is not necessary to create the column withv.db.addcolumnbeforehand.
Update: Please ignore for now, more adaptions to i.sentinel.mask are to come (performance improvement)
Hi, @griembauer
When you are looking for speed improvements, maybe you could have a look at #138 for a significant speed improvement of cloud shaddow detection in cases where one has a significant amount clouds that slow vector processing. Basically, the idea is to keep things in raster all the way and use r.region (which takes seconds) + r.stats instead of v.transform + v.overlap which both can take minutes... With few clouds, the vector approach may still be faster though. Since you need the mask as raster dataset further down the processing chain, staying in the raster world is probably an advantage for the next processing steps too...
Unfortunately, I have not found the time to implement that myself. So pleasee feel free to pick from there, if relevant for you...
Hi @ninsbl, Thanks a lot for the link, I wasn't aware of this PR honestly, but of course it makes much more sense to take it from there! (indeed staying in the raster world as long as possible is probably the best way to go)
Please see: #1002
Is this PR still needed then?