sf

Aggregate Weighted Linestrings for Clustered Markers in Leaflet in R

不问归期 提交于 2020-04-07 09:19:08
问题 I'm trying to plot locations and weighted connecting linestrings. When I zoom in or out the clustering of the markers adjusts fine. The shown labels of the clusters are the aggregated node_val of the markers. I would like to do similar with the linestrings, so that the plot does not show the blue lines connecting the single markers, but instead lines connecting the clusters of markers, and the new linestrings that connect the clusters of markers are customized in width dependent on the wgt

Aggregate Weighted Linestrings for Clustered Markers in Leaflet in R

99封情书 提交于 2020-04-07 09:18:47
问题 I'm trying to plot locations and weighted connecting linestrings. When I zoom in or out the clustering of the markers adjusts fine. The shown labels of the clusters are the aggregated node_val of the markers. I would like to do similar with the linestrings, so that the plot does not show the blue lines connecting the single markers, but instead lines connecting the clusters of markers, and the new linestrings that connect the clusters of markers are customized in width dependent on the wgt

How to fix degree symbol not showing correctly in R on Linux/Fedora 31

久未见 提交于 2020-03-22 04:30:13
问题 This bounty has ended . Answers to this question are eligible for a +50 reputation bounty. Bounty grace period ends in 19 hours . giocomai wants to draw more attention to this question. Any map I make with: ggplot() + geom_sf() produces the expected map, but does not show the degree sign correctly, as appears from the following picture. The answer given in this answer on SO - degree symbol incorrect in map axis labels - does not help, and I am posting a separate question as I see a different

How to fix degree symbol not showing correctly in R on Linux/Fedora 31

流过昼夜 提交于 2020-03-22 04:29:22
问题 This bounty has ended . Answers to this question are eligible for a +50 reputation bounty. Bounty grace period ends in 19 hours . giocomai wants to draw more attention to this question. Any map I make with: ggplot() + geom_sf() produces the expected map, but does not show the degree sign correctly, as appears from the following picture. The answer given in this answer on SO - degree symbol incorrect in map axis labels - does not help, and I am posting a separate question as I see a different

How to fix degree symbol not showing correctly in R on Linux/Fedora 31

蓝咒 提交于 2020-03-22 04:28:10
问题 This bounty has ended . Answers to this question are eligible for a +50 reputation bounty. Bounty grace period ends in 19 hours . giocomai wants to draw more attention to this question. Any map I make with: ggplot() + geom_sf() produces the expected map, but does not show the degree sign correctly, as appears from the following picture. The answer given in this answer on SO - degree symbol incorrect in map axis labels - does not help, and I am posting a separate question as I see a different

Split line by multiple points using sf package

僤鯓⒐⒋嵵緔 提交于 2020-03-20 03:40:12
问题 I am trying to split a large line shape by pairs of points along the line. Based on previous questions asked mainly by @mbcaradima here, here, here and here, I have put together some code which works for single points, but does not for multiple points. See reproducible example below: Libraries and data # libraries library(tidyverse) library(sf) library(rgdal) library(sp) river <- structure(list(FWK_Code = structure(1L, .Label = "1_F461", class = "factor"), FWK_Name = structure(1L, .Label =

How to keep the only intersection of the spatial features & remove everything outside of a boundary?

最后都变了- 提交于 2020-03-18 06:36:15
问题 I am trying to get rid of the spatial geometry that falls outside of the shapefile boundary I read. Is it possible to do this without manual software like Photoshop? Or me manually removing the tracts which span outside of the city's boundries. For example, I took out 14 tracts, this is there result: I have provided all of the subset of the data and the key to test it yourself. Code script is below, and the dataset is https://github.com/THsTestingGround/SO_geoSpatial_crop_Quest. I have done

Use sf polygon object as window in spatstat

六眼飞鱼酱① 提交于 2020-02-25 13:16:39
问题 Hello all potential helpers, I have a SpatialPolygonDataFrame object obtained from the tigris package and I would like to use it as a polygonal window in the creation of a ppp object. Here is what I tried: # Needed packages library(spatstat) library(sf) # Download geospatial data for Lee county in Alabama (home of the great Auburn University by the way!) county <- tigris::county_subdivisions(state = "Alabama", county = "Lee") # The polygon of Lee county is subdivided, so I convert it to a

How can I speed up spatial operations in `dplyr::mutate()`?

别说谁变了你拦得住时间么 提交于 2020-02-21 12:30:25
问题 I am working on a spatial problem using the sf package in conjunction with dplyr and purrr . I would prefer to perform spatial operations inside a mutate call, like so: simple_feature %>% mutate(geometry_area = map_dbl(geometry, ~ as.double(st_area(.x)))) I like that this approach allows me to run a series of spatial operations using %>% and mutate . I dislike that this approach seems to significantly increase the run-time of the sf functions (sometimes prohibitively) and I would appreciate

How to filter an R simple features collection using sf methods like st_intersects()?

五迷三道 提交于 2020-02-06 04:14:05
问题 SF is the R-Spatial package designed to work with tidy syntax like dyplr and pipes. I would like to do a simple spatial filter on a simple features collection object. Given a simple features collection, I would like to return all features from the collection which meet some geometric condition. In particular, I would like to find the features that intersect with another object. SF provides the function st_intersects(x,y,...) to do this, but I cannot get it to work with dplyr. I'm using R 3.5