Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

Tagged with
0 votes
1 answer
59 views

Selectively load parts of a map

Suppose I have the following shapefile: library(sf) library(leaflet) library(leafgl) library(colourvalues) library(leaflet.extras) nc <- st_read(system.file("gpkg/nc.gpkg", package=&...
stats_noob's user avatar
  • 5,705
2 votes
1 answer
252 views

sf::st_combine makes MULTIPOLYGONs with holes

I have some polygons in a data.frame called walktime. > class(walktime) [1] "sf" "data.frame" I want to combine the polygons to one. As I understand this is possible ...
Volker Holzendorf's user avatar
0 votes
1 answer
119 views

Does the order of locations change when making a voronoi map with leaft and sf?

I am making a voronoi map in R using the packages leaflet and sf as follows: library(leaflet) library(sf) library(rnaturalearth) library(rnaturalearthdata) long <- c(4.35556 , 5.83745, 4.63683 ...
WJH's user avatar
  • 571
0 votes
1 answer
460 views

Constructing polygon using latitude-longitude coordinates in R

I am trying to construct a polygon using four latitude-longitude coordinates. However, the polygon does not get constructed as desired. The polygon lining is constructed way far than the lat-long ...
laplaceable's user avatar
0 votes
0 answers
41 views

Adding names on map using tmap/tmaptools [duplicate]

I have made a map using the cited packages and code. However, I would like to add names or country codes on top of each country like in picture two. Is this possible? library(sf) library(tmap) library(...
sard's user avatar
  • 51
0 votes
1 answer
354 views

Getting spatial polygon intersections, excluding borders

I am trying to find which City Council districts represent which zip codes in NYC by using the sf library and leaflet. I have spatial polygons for both council districts and zip codes. My problem is ...
phillipwong's user avatar
5 votes
1 answer
445 views

Import data from a leaflet map as an sf object in R

I want to import data as an sf object in R from a leaflet map. The map is this site: https://erickgn.github.io/mapafc/ I also have the HTML from the map as following:https://raw.githubusercontent.com/...
Maria Mittelbach's user avatar
0 votes
1 answer
470 views

Separate long/lat columns for multilinestrings and plotting in colours

I am new to plotting in R/leaflet. I am plotting a shapefile with multilinestrings into R with leaflet. Is there a way I can extract from the geometry column separate columns for lat and long ...
lenlen's user avatar
  • 69
1 vote
0 answers
147 views

Highlight a section of a line between two points (Leaflet/R)

Given a line and two points along that line, how can I highlight the section of the line between the two points? The code below provides an example of a line (tr) and two points (sg) that fall on it, ...
munchausend's user avatar
2 votes
0 answers
315 views

R leaflet fitBounds() conflicts with leafletProxy?

I am having some trouble with an app which reacts completely random when I launch it. The goal of this app is to display a map and zoom on a polygon. I have 4 random behaviours for this app everytime ...
gdevaux's user avatar
  • 2,485
0 votes
1 answer
489 views

How to find correct projection of the shapefile data for leaflet map in r?

I am new to geo spatial data & trying to create choropleth map using leaflet & shapefile. I have tried to plot the data on leaflet map but getting an error: Error: Must supply x/y attributes ...
ViSa's user avatar
  • 1,729
0 votes
0 answers
284 views

Turning Leaflet Feature into SF Feature

Edit: I am using leaflet.extras and the addDrawToolbar() function to my leaflet map. Within shiny, I am reading the outputs of a users input using shape = input$[mapID]_draw_new_feature. I'd like to ...
SharpSharpLes's user avatar
1 vote
1 answer
586 views

Is there a way to transform a png icon to a sf multipolygon in R?

I would like to merge a layer of this ship icon to my shapefile. I would like to transform in a multipolygon sf... There is a way?
Rodrigo Cardoso's user avatar
0 votes
0 answers
75 views

Saving what is displayed in a leaflet popup

When I plot an address in leaflet, I can display the value in my dataset that corresponds to the row that the polygon is found on. But how can I save this value? Example: I plot an address in leaflet ...
Rtry999's user avatar
2 votes
2 answers
364 views

Rotating and translating a polygon

I've come across a problem when I was trying to apply rotations and translations to a rectangle and then visualize both on leaflet. I am trying to rotate my rectangle 180° and then translate it ...
Moein's user avatar
  • 111

15 30 50 per page