Displaying 5 results from an estimated 5 matches for "byid".
Did you mean:
bid
2012 Apr 07
1
rgeos - gBuffer, width by z-value
...eometry (points) to specified width based on the z value from attribute table. Here is example:
point <- data.frame(x=c(10,20), y=c(10, 10), z = c(2,7))
point_shp <- SpatialPointsDataFrame(point[,1:2],point)
plot(point_shp, xlim = c(0,30), ylim = c(0,20))
plot(gBuffer(point_shp, width = 5, byid=TRUE, capStyle="ROUND"), add = TRUE, col = "red")
plot(gBuffer(point_shp, width = point_shp@data$z, byid=TRUE, capStyle="ROUND"), add = TRUE, col = "green")
'gBuffer' function ''take into account'' always only first line/cell from ta...
2020 Oct 20
1
sp:gIntersection warning message about projection
...e=16 +datum=WGS84 +units=m +no_defs
variables : 2
names : x, y
value : 560615.564407584, 4698904.71208346
Please observe that both files have identical projections.
p1 <- gIntersection(buff, pln)
Warning message:
In RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, drop_lower_td,
unaryUnion_if_byid_false, :
spgeom1 and spgeom2 have different proj4 strings
This warning is baffling since both files have same projection:
crs(buff)
CRS arguments:
+proj=utm +zone=16 +datum=WGS84 +units=m +no_defs
crs(pln)
CRS arguments:
+proj=utm +zone=16 +datum=WGS84...
2011 Oct 25
0
Installing rgeos on Mac OS X 10.4 (was Re: "package 'stringr' does not have a name space"
...Terminal type:
locate geos-config
# I got a crash based on a missing definition of
GEOSUnaryUnion_r, so...
# To get rgeos to install,
# delete from rgeos_topology.c this bit (line 33):
================================
#ifdef HAVEUNARYUNION
SEXP rgeos_unaryunion(SEXP env, SEXP obj, SEXP id, SEXP byid ) {
return( rgeos_topologyfunc(env, obj, id, byid,
&GEOSUnaryUnion_r) );
}
#endif
================================
# And this from line 35 of init.c
================================
#ifdef HAVEUNARYUNION
{"rgeos_unaryunion", (DL_FUNC) &rgeos_unaryunion, 4},
#endif
====...
2011 Jul 09
1
SpatialPolygonsDataFrame holes problem
I have obtained shapefiles for Indian states from here:
http://www.maptell.com/index.php?option=com_remository&Itemid=159&func=fileinfo&filecatid=115&parent=category
Problem: I want to extract centroid coordinates for each State, but there is some coding problem with the shapefiles that prevents this.
#Code:
#After extracting the shapefiles from the india_state.zip file, then:
2012 Mar 25
2
avoiding for loops
...se. Here's what I have so far:
df1 <- data.frame(group=c("red", "red", "red", "blue", "blue",
"blue"), id=c("A", "B", "C", "D", "E", "F"))
groups <- levels(df1$group)
byid <- lapply(groups, "==", df1$group)
groupIDX <- lapply(byid, which)
> groupIDX
[[1]]
[1] 4 5 6
[[2]]
[1] 1 2 3
This gives me a list of the indices for each group. I want to subset
df1 based on this list.
If I want just one group I can do this:
> df1[groupIDX[[1]],]$id
[1...