从R中的Radolan数据制作GPS Lat / Long Lookup表,将立体投影转换为R中的lat长网格

时间:2017-08-10 11:19:38

标签: r geolocation gps geospatial radolan

我正在使用此示例在R

中加载Radolan数据

ExampleRADOLAN Specification

 binary_filepath <- paste0("raa01-rw_10000-1708091950-dwd---bin")
    header_end <- regexpr("\003", readLines(binary_filepath, 1))

    rb_stream <- file(binary_filepath, "rb")
    skip_temp <- readBin(rb_stream, "raw", n = header_end, endian = "little")
    rb_data <- readBin(rb_stream, "raw", size = 1, n = 900*900*2, endian = "big")
    rb_data <- rawToBits(rb_data)

    rbi <- lapply(seq(0, 900*900-1, 1), function(x){
      sum(as.integer(rb_data[(x*16+1):(x*16+12)]) * 2**seq(0, 11, 1))
    })
    rbi <- unlist(rbi)
    rbi[1:16]
    rb <- raster(t(matrix(rbi, ncol = 900, nrow = 900)))
    rb <- flip(rb, "y")
    radolan_proj <- 
      CRS("+proj=stere +lat_0=90 +lat_ts=90 +lon_0=10 +k=0.93301270189 +x_0=0 +y_0=0 +a=6370040 +b=6370040 +to_meter=1000 +no_defs")
    extent(rb) <- extent(-523.4622, 376.5378, -4658.645, -3758.645)
    projection(rb) <- radolan_proj

RADOLAN Data是一个立体网格。 此网格中的每个点都是1 KM Apart。

 1 x 1 km-Raster

class       : RasterLayer 
dimensions  : 900, 900, 810000  (nrow, ncol, ncell)
resolution  : 1, 1  (x, y)
extent      : -523.4622, 376.5378, -4658.645, -3758.645  (xmin, xmax, ymin, ymax)
coord. ref. : +proj=stere +lat_0=90 +lat_ts=90 +lon_0=10 +k=0.93301270189 +x_0=0 +y_0=0 +a=6370040 +b=6370040 +to_meter=1000 +no_defs 
data source : in memory
names       : layer 
values      : 0, 2500  (min, max)

我希望为GPS数据制作一个Lat / Long查找表。 我怎么能把这个rb对象转换成纬度/长网格?

谢谢!

1 个答案:

答案 0 :(得分:2)

class Header extends Component { constructor(props) { super(props); this.state = { this.state.modalSendResult: false }; } _open() { this.setState({ modal: !this.state.modal }); if (!this.state.modal) { this.appendNode(); } } appendNode() { let modal = ReactDOM.findDOMNode(this.refs.modal) modalBody = ReactDOM.findDOMNode(this.refs.body); ReactDOM.render( <b>abcde</b>, modalBody ); } render() { return ( <Button onClick={this._open.bind(this)} className="btn btn-primary btn-primary-1 mr-1"> <i className="fa fa-paper-plane-o" aria-hidden="true"></i> Open </Button> <Modal ref="modal" isOpen={this.state.modal} toggle={this._open} className={'modal-primary modal_customer'}> <ModalHeader toggle={this._open}> Danh sách kết quả gửi </ModalHeader> <ModalBody className="modal-send" ref="body"> </ModalBody> </Modal> ); } } 对象是栅格。如果你想要它与非投影的地理坐标(wgs84),你只需要重新投影它:

rb

Map in wgs84

library(rgdal)
library(raster)
library(maps) # to add country limits 

# raster with Lat/Long non projected coordinates
rb_wgs84 <- projectRaster(rb, crs = "+proj=longlat +datum=WGS84 +no_defs")
# Show the raster in a plot
plot(rb_wgs84)
maps::map("world", add = TRUE)

Map data

这是你在找什么?