是否有R函数来合并多个asc文件?

时间:2019-07-01 04:51:33

标签: r

我试图在r中合并几个积雪长期数据的asc文件

The code-
 List<String> _locations = ['A', 'B', 'C', 'D']; // Option 2
  String _selectedLocation;
  @override
  Widget build(BuildContext context) {
    return SizedBox(
        height: MediaQuery.of(context).size.height * 0.55,
        child: Scaffold(
      body:Center(
        child: new Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Text("Select a Country",style: TextStyle(fontWeight: FontWeight.bold),),
         DropdownButton(
          hint: Text('Please choose a Country'),
          value: _selectedLocation,
          onChanged: (newValue) {
            setState(() {
              _selectedLocation = newValue;
            });
          },
          items: _locations.map((location) {
            return DropdownMenuItem(
              child: new Text(location),
              value: location,
            );
          }).toList(),
        ),
              new Column(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                children: <Widget>[
                  Text("Select a State",style: TextStyle(fontWeight: FontWeight.bold),),

                  DropdownButton(
                    hint: Text('Please choose a State'),
                    value: _selectedLocation,
                    onChanged: (newValue) {
                      setState(() {
                        _selectedLocation = newValue;
                      });
                    },
                    items: _locations.map((location) {
                      return DropdownMenuItem(
                        child: new Text(location),
                        value: location,
                      );
                    }).toList(),
                  ),
                ],
              ),
              new Column(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                children: <Widget>[
                  new RaisedButton(
                    padding: const EdgeInsets.all(8.0),
                    textColor: Colors.white,
                    color: Colors.blue,
          //          onPressed: ,
                    child: new Text("OK"),
                  ),
                ],
              )
 ],
)
    )
        )
    ); 

但是此脚本给出了

  

“ compareRaster(x,范围= FALSE,rowcol = FALSE,orig = TRUE,错误:     不同的出身”

所有栅格的长度相同。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

此问题的答案为https://www.r-bloggers.com/merge-asc-grids-with-r/ 您必须使用如下循环来设置公差:

for(i in 2:length(r)){  
 x<-merge(x=r[[1]],y=r[[i]],tolerance=5000,overlap=T)  
 r[[1]]<-x  
 }