Skip to content

publish_layer creates 'ghost points' in AGOL #278

@Nova-Scotia

Description

@Nova-Scotia

I'm attempting to create a hosted feature layer from a sf-point object in R. I've just updated all my libraries to the most recent versions. Here's an example of my workflow:

library(tidyverse)
library(sf)
library(arcgisbinding)
library(arcgislayers)
library(arcgis) 

arc.check_product()

# Refresh your token
auth_binding() |>
  set_arc_token()

test_df <- tibble(letter = c("A", "B"),
                  lat = c(45, 46),
                  lon = c(-89, -90))

test_pts <- st_as_sf(test_df, coords = c("lon", "lat"), 
                     crs = "+proj=longlat +datum=WGS84 +no_defs") |> 
  st_transform(3857)

# Ensure locations are accurate
ggplot(test_pts) +
  geom_sf()

res <- publish_layer(test_pts, "test_pts2")

When I publish this, I can see it in my main folder:

Image

There are data points in the table:

Image

But when I try to see the points on the map, they are not visible - even though visibility is set to the min and max values. The map can see where the points are - it navigates to the correct bounding box - but it cannot draw the points:

Image

Sometimes I get a little warning about the points not drawing:

Image

Any idea what's going on here - can you reproduce?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions