2013-07-04 2 views
0

전국적인 래스터를 플로팅해야합니다. 나는 cellize = 300 시도하고 64 비트 시스템을 사용합니다. Memory.limit()는 8148입니다. 코드를 실행할 때 여전히 "오류 : 크기 3.6Gb의 벡터를 할당 할 수 없습니다."라는 메시지가 나타납니다. 때로는 Windows가 작동을 멈추는 경우가 있습니다 ... 심지어 더 나쁜 ...거대한 데이터 세트를 다루시겠습니까?

이렇게 큰 데이터 세트를 처리 할 수있는 다른 방법이 있습니까? Btw, 저는 ArcGIS에 익숙합니다. 감사!!!

{

x.min <- -6328997.74765339; x.max <- 2182662.25234661 # Extent of easting coordinates 
    y.min <- 310413.438361092; y.max <- 5448183.43836109 # Extent of northing coordinates 
    n <- 2351  
    center <- read.csv ("J:\\...,header=T) 
    attach(center) 
    center <- as.matrix (center) # XY corrdinates #  
    emp <- read.csv ("J:\\...,header=T, sep=",") 
    attach(emp) 

    n.rows <- 17126 
    cellsize <- 300 
    n.cols <- 28373 

    x.max <- x.min + n.cols * cellsize   # Assures square cells are used# 
    y.0 <- seq(y.max-cellsize/2, y.min+cellsize/2, length.out=n.rows) 
    x.0 <- seq(x.min+cellsize/2, x.max-cellsize/2, length.out=n.cols) 

system.time(
    { 
    i <- order(emp, decreasing=TRUE) 
    emp <- emp[i] 
    center <- center[i, , drop=FALSE] 

    owner <- matrix(0, n.rows, n.cols) 
    gravity.max <- matrix(0, n.rows, n.cols) 

    for (i in 1:n) { 
     r <- emp[i]/outer((y.0 - center[i,2])^2, (x.0 - center[i,1])^2, "+") 
     update <- which(r >= gravity.max) 
     gravity.max[update] <- r[update] 
     owner[update] <- i 
    } 
    }) 

답변

1

당신은 raster package을 시도 할 수 있습니다.

래스터는 큰 래스터에서 작동 할 수 있습니다. R에서 공간 분석을 수행하는 많은 사람들이 사용합니다

처음으로 비 네트 Introduction to the raster package을 읽으면 패키지에 익숙해지면 많은 시간을 절약 할 수 있습니다.

관련 문제