sp

'overlay' is not an exported object from 'namespace:sp' [duplicate]

和自甴很熟 提交于 2020-03-05 07:04:51
问题 This question already has an answer here : How should I deal with “'someFunction' is not an exported object from 'namespace:somePackage'” error? (1 answer) Closed yesterday . I have some code showing this error, but, I haven't called "overlay", maybe it's a library function that is calling it Code: d.mle=likfit(P, ini.cov.pars = c(1,30), cov.model = 'matern', kappa = 0.5) d.mle Xb = c(1, size, size, 1) Yb = c(1, 1, size, size) bordas = cbind(Xb, Yb) polygon(bordas) Ap = matrix(apply(bordas, 2

汇编语言学习(栈)

☆樱花仙子☆ 提交于 2020-02-28 21:27:42
栈: 栈是什么? 存放数据的容器 栈 和一般的容器有什么区别,如何存取呢? 先进后出, 类似于 往密闭的盒子放东西 每一次只能拿出最顶部的东西,每一次只能在最顶部放入东西 放入的过程 被称为 入栈,一般用 push 表示 eg: push ax 取出的过程 被称为 出栈,一般用 pop 表示 eg: pop ax 栈如何表示栈顶: 存在标志 标识栈顶,称作栈顶标志 如何标识栈顶标志? 无论是出栈的位置还是入栈的位置, 在内存中 都 被视为 内存地址 前面说过由于 8086 的的 地址总线 与 CPU 处理能力存在出入 , 所以 内存地址 由 段地址 和 偏移地址 来表示 分为 栈顶表示 被分别存储到两个寄存器中, 段地址寄存器:SS, 偏移地址寄存器:SP SS:SP 出栈和入栈 栈顶标记该如何变化? 在内存中 栈 的地址是有高到低增长 每一次 push SP -= 2 每一次 pop SP += 2 思考一下如何 如何将10000H ~ 1000FH作为 栈 并实现 AX 与 Bx 的交换 mov ax, 1000H mov ss, ax mov sp, 10H push ax push Bx pop ax pop bx ps:内存也可以,记得交换前确定ds指向那个段地址 内存角度分析栈: 无论是 pop 还是 push,操作的都是数据 数据的来源:寄存器 内存 数据长度也有两种

Matching / Joining SpatialPoints with SpatialLines using R

扶醉桌前 提交于 2020-02-01 08:27:04
问题 Question I have a set of shapefiles for different Bus Routes (Each route has 2 Trips) for Cairo. I wanted to check if they pass by certain stations using R: Stops_Data <- readOGR("Stackoverflow Data/","Stops_Data") Trips_Data <- readOGR("Stackoverflow Data/","Trips_Data") plot(Trips_Data) points(Stops_Data, col = "red") I try to match them using over(). First, I make sure the Projections are identical. proj4string(Trips_Data) <- proj4string(Stops_Data) over(Stops_Data, Trips_Data) This only

Matching / Joining SpatialPoints with SpatialLines using R

心不动则不痛 提交于 2020-02-01 08:26:28
问题 Question I have a set of shapefiles for different Bus Routes (Each route has 2 Trips) for Cairo. I wanted to check if they pass by certain stations using R: Stops_Data <- readOGR("Stackoverflow Data/","Stops_Data") Trips_Data <- readOGR("Stackoverflow Data/","Trips_Data") plot(Trips_Data) points(Stops_Data, col = "red") I try to match them using over(). First, I make sure the Projections are identical. proj4string(Trips_Data) <- proj4string(Stops_Data) over(Stops_Data, Trips_Data) This only

Distance between all the points to the first point

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-24 23:56:10
问题 I have points on a street, and Im trying to calculate the distance between all the points and the first point in the street Here is my sf object: library(rgeos) library(rgdal) library(sf) #I actually have multiple points on a segment of 5 Km df <- data.frame(lon = c(-121.95, -121.96, -121.97, -121.98), lat = c(37.35,37.36,37.37,37.38)) coordinates(df) <- c("lon", "lat") proj4string(df) <- CRS("+init=epsg:4326") df_sf <- st_as_sf(df) %>% st_transform(3488) I tried st_distance but the distance

R - crop LIST of Least Cost Paths intersected with SpatialPolygonsDataFrame objects

心已入冬 提交于 2020-01-16 08:13:06
问题 I have a series of steps I need to complete on a LIST of SpatialLinesDataFrame (=least cost paths flowing 'downslope' created using ] gdistance ; 'LCPs' herein) objects based on their relationships with individual features within a MULTI-FEATURE SpatialPolygonsDataFrame ('polygons') object. To summarize, each LCP element in the list originates inside a single polygon feature, and may or may not pass through one or more other polygon features as it 'flows' downhill. I want to create new

Create a bivariate color gradient legend using lattice for an spplot overlaying polygons with alpha

旧时模样 提交于 2020-01-15 06:28:28
问题 I've created a map by overlaying polygons using spplot and with the alpha value of the fill set to 10/255 so that areas with more polygons overlapping have a more saturated color. The polygons are set to two different colors (blue and red) based on a binary variable in the attribute table. Thus, while the color saturation depends on the number of polygons overlapping, the color depends on the ratio of the blue and red classes of polygons. There is, of course, no easy built-in legend for this

How to add a hole to a polygon within a SpatialPolygonsDataFrame?

拈花ヽ惹草 提交于 2020-01-10 05:29:06
问题 I have a list of polygons in a SpatialPolygonsDataFrame and need to set one of them as a hole in an other. I've found in the help of set_Polypath how a hole can be defined on a newly created polygon but how to set the "hole" flag on an existing polygon? 回答1: It looks like you have to rebuild the polygon, and then replace it in the spdf. The following function automatically rebuild the polygon adding a hole: library("sp") AddHoleToPolygon <-function(poly,hole){ # invert the coordinates for

Spatial aggregation with a group by

南楼画角 提交于 2020-01-06 20:18:08
问题 I am trying to calculate grouped-by averages based on a spatial aggregation. I have two shapefiles: census tracts and wards. The wards have a value that I would like to average by a factor for each census tract. Here are the shapfiles: library(dplyr) library(rgeos) library(rgdal) # Census tracts download.file("http://www12.statcan.gc.ca/census-recensement/2011/geo/bound-limit/files-fichiers/gct_000b11a_e.zip", destfile = "gct_000a11a_e.zip") unzip("gct_000a11a_e.zip", exdir="tracts") #

Using a simple for loop on spatial data

﹥>﹥吖頭↗ 提交于 2020-01-03 15:38:01
问题 I'm sorry this is going to be a for loop 101 question. I am struggling to write a simple for loop to generate a table of distances between cities based upon longitude-latitude data locations <-read.csv("distances.csv") locations returns the following table: City Type long lat 1 Sheffield EUR -1.470085 53.38113 2 HK WRLD 114.109497 22.39643 3 Venice EUR 12.315515 45.44085 4 New York WRLD -74.005941 40.71278 My goal in this particular part of the task is to produce a table of the distances (in