René's URL Explorer Experiment


Title: plotly not plotting sf multipolygon objects · Issue #1659 · plotly/plotly.R · GitHub

Open Graph Title: plotly not plotting sf multipolygon objects · Issue #1659 · plotly/plotly.R

X Title: plotly not plotting sf multipolygon objects · Issue #1659 · plotly/plotly.R

Description: I am trying to use plotly to create interactive maps using a multipolygon sf object as the input. I am able to get a plotly map using one dataset, and when I compare to the dataset I am interested in, they appear to be of the same class,...

Open Graph Description: I am trying to use plotly to create interactive maps using a multipolygon sf object as the input. I am able to get a plotly map using one dataset, and when I compare to the dataset I am interested ...

X Description: I am trying to use plotly to create interactive maps using a multipolygon sf object as the input. I am able to get a plotly map using one dataset, and when I compare to the dataset I am interested ...

Opengraph URL: https://github.com/plotly/plotly.R/issues/1659

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"plotly not plotting sf multipolygon objects","articleBody":"I am trying to use plotly to create interactive maps using a multipolygon sf object as the input. I am able to get a plotly map using one dataset, and when I compare to the dataset I am interested in, they appear to be of the same class, however I cannot get my dataset working. When I try to plot with the data of interest I get the following error, despite the object actually being a multipolygon sf object:\r\n\r\n`Error in st_coordinates.sfc(model$geometry) : \r\n  not implemented for objects of class sfc_GEOMETRYCOLLECTION`\r\n\r\n**Environment:**\r\n- R version: 3.6.1\r\n- Platform: x86_64-pc-linux-gnu (OS: Ubuntu 18.04.3 LTS)\r\n- plotly version: plotly_4.9.0.9000 (dev version)\r\n- sf version: sf_0.8-0\r\n\r\nBelow is a reproducible example that results in the error above:\r\n\r\n```\r\nlibrary(plotly)\r\nlibrary(sf)\r\nlibrary(spData)\r\nplot_ly(world, split = ~iso_a2, color = ~pop)\r\n```\r\n\r\nBelow is a reproducible example that runs successfully:\r\n\r\n```\r\nlibrary(plotly)\r\nlibrary(sf)\r\nlibrary(spData)\r\nnc \u003c- sf::st_read(system.file(\"shape/nc.shp\", package = \"sf\"), quiet = TRUE)\r\nplot_ly(nc, split=~NAME)\r\n```\r\n\r\nWhen I examine each object, I get the following output:\r\n`class(st_geometry(world))`\r\n\r\n[1] \"sfc_MULTIPOLYGON\" \"sfc\"\r\n             \r\n`class(st_geometry(nc))`\r\n\r\n\r\n[1] \"sfc_MULTIPOLYGON\" \"sfc\" \r\n\r\nI have tried running the following, to investigate the error message and get the expected matrix of coordinates without error: \r\n\r\n```\r\nworld_coords \u003c- st_coordinates(world)\r\nhead(world_coords)\r\n```\r\n\r\n            X         Y L1 L2 L3\r\n[1,] 180.0000 -16.06713  1  1  1\r\n[2,] 180.0000 -16.55522  1  1  1\r\n[3,] 179.3641 -16.80135  1  1  1\r\n[4,] 178.7251 -17.01204  1  1  1\r\n[5,] 178.5968 -16.63915  1  1  1\r\n[6,] 179.0966 -16.43398  1  1  1\r\n\r\n```\r\nnc_coords \u003c- st_coordinates(nc)\r\nhead(nc_coords)\r\n```\r\n\r\n             X        Y L1 L2 L3\r\n[1,] -81.47276 36.23436  1  1  1\r\n[2,] -81.54084 36.27251  1  1  1\r\n[3,] -81.56198 36.27359  1  1  1\r\n[4,] -81.63306 36.34069  1  1  1\r\n[5,] -81.74107 36.39178  1  1  1\r\n[6,] -81.69828 36.47178  1  1  1\r\n\r\nIt is unclear to me what the issue is with the `world` dataset, what is different between the `world` and the `nc` dataset, and what is unique to the `nc` dataset that enables plotly plotting. I am able to plot with tmap, thus I do not believe the object itself to be the issue. Any help with this issue is greatly appreciated. \r\n\r\n`tm_shape(world) +\r\n  tm_polygons() ` ","author":{"url":"https://github.com/erstearns","@type":"Person","name":"erstearns"},"datePublished":"2019-11-17T00:19:21Z","url":"https://github.com/plotly/plotly.R/issues/1659"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:20688dc5-0e35-a468-1752-f7d759cc304f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB792:A71F9:249891:2DE564:6B00FEB5
html-safe-nonce89adf8aabbb0efca3b4ea556bfc411b758b8facc692027b66c2c09a68eff84be
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzkyOkE3MUY5OjI0OTg5MToyREU1NjQ6NkIwMEZFQjUiLCJ2aXNpdG9yX2lkIjoiNjI5MjM0MDM1Mjc0MTM0MjkwMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac67c964f917f098f5a749dc299284259f3097ac5122db4d0c6ce6891b6310515d
hovercard-subject-tagissue:523914219
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/plotly/plotly.R/1659/issue_layout
twitter:imagehttps://opengraph.githubassets.com/0f7f770d622d020df4cce3f10ddfb0e500ba48ba21b1cc7f425a956855ea5473/plotly/plotly.R/issues/1659
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/0f7f770d622d020df4cce3f10ddfb0e500ba48ba21b1cc7f425a956855ea5473/plotly/plotly.R/issues/1659
og:image:altI am trying to use plotly to create interactive maps using a multipolygon sf object as the input. I am able to get a plotly map using one dataset, and when I compare to the dataset I am interested ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameerstearns
hostnamegithub.com
expected-hostnamegithub.com
Nonecb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124
turbo-cache-controlno-preview
go-importgithub.com/plotly/plotly.R git https://github.com/plotly/plotly.R.git
octolytics-dimension-user_id5997976
octolytics-dimension-user_loginplotly
octolytics-dimension-repository_id14579179
octolytics-dimension-repository_nwoplotly/plotly.R
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id14579179
octolytics-dimension-repository_network_root_nwoplotly/plotly.R
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/plotly/plotly.R/issues/1659#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fplotly%2Fplotly.R%2Fissues%2F1659
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fplotly%2Fplotly.R%2Fissues%2F1659
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=plotly%2Fplotly.R
Reloadhttps://github.com/plotly/plotly.R/issues/1659
Reloadhttps://github.com/plotly/plotly.R/issues/1659
Reloadhttps://github.com/plotly/plotly.R/issues/1659
plotlyhttps://github.com/plotly
plotly.Rhttps://github.com/plotly/plotly.R
Codehttps://github.com/plotly/plotly.R
Issues716 (716)https://github.com/plotly/plotly.R/issues
Pull requests47 (47)https://github.com/plotly/plotly.R/pulls
Discussionshttps://github.com/plotly/plotly.R/discussions
Actionshttps://github.com/plotly/plotly.R/actions
Projectshttps://github.com/plotly/plotly.R/projects
Wikihttps://github.com/plotly/plotly.R/wiki
Security and qualityhttps://github.com/plotly/plotly.R/security
Insightshttps://github.com/plotly/plotly.R/insights
https://github.com/plotly/plotly.R
New issuehttps://github.com/login?return_to=https://github.com/plotly/plotly.R/issues/1659
New issuehttps://github.com/login?return_to=https://github.com/plotly/plotly.R/issues/1659
plotly not plotting sf multipolygon objectshttps://github.com/plotly/plotly.R/issues/1659#top
https://github.com/erstearns
erstearnshttps://github.com/erstearns
on Nov 17, 2019https://github.com/plotly/plotly.R/issues/1659#issue-523914219
https://github.com/NateMietk
NateMietkhttps://github.com/NateMietk
on Nov 20, 2019https://github.com/plotly/plotly.R/issues/1659#issuecomment-555828257
https://blog.cpsievert.me/2018/01/30/learning-improving-ggplotly-geom-sf/https://blog.cpsievert.me/2018/01/30/learning-improving-ggplotly-geom-sf/
https://github.com/NateMietk
NateMietkhttps://github.com/NateMietk
on Jan 8, 2020https://github.com/plotly/plotly.R/issues/1659#issuecomment-572234371
cpsieverthttps://github.com/cpsievert
on Feb 4, 2020https://github.com/plotly/plotly.R/issues/1659#event-3006930614
Don't assume sf geometry is always accessible via [['geometry']], fixes https://github.com/plotly/plotly.R/commit/7d2ea6dfd96f032c542b7c16d861249643690cbd
https://docs.github.com/articles/closing-issues-via-commit-messages
7d2ea6dhttps://github.com/plotly/plotly.R/commit/7d2ea6dfd96f032c542b7c16d861249643690cbd
cpsieverthttps://github.com/cpsievert
completedhttps://github.com/plotly/plotly.R/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
7d2ea6dhttps://github.com/plotly/plotly.R/commit/7d2ea6dfd96f032c542b7c16d861249643690cbd
on Feb 6, 2020https://github.com/plotly/plotly.R/issues/1659#event-3015429091
cpsieverthttps://github.com/cpsievert
on Feb 6, 2020https://github.com/plotly/plotly.R/issues/1659#event-3015429102
Merge pull request #1690 from ropensci/sf-geometryhttps://github.com/plotly/plotly.R/commit/7f7a60d2d41f0461f69b8cdf4b4c36503758251f
#1690https://github.com/plotly/plotly.R/pull/1690
https://docs.github.com/articles/closing-issues-via-commit-messages
7f7a60dhttps://github.com/plotly/plotly.R/commit/7f7a60d2d41f0461f69b8cdf4b4c36503758251f
chschanhttps://github.com/chschan
on Mar 12, 2020https://github.com/plotly/plotly.R/issues/1659#event-3121270945
[pull] master from ropensci:master (#2)https://github.com/Displayr/plotly/commit/32dde4152264fdfa964f7b3c796fb3ac91b17666
#2https://github.com/Displayr/plotly/pull/2
https://docs.github.com/articles/closing-issues-via-commit-messages
32dde41https://github.com/Displayr/plotly/commit/32dde4152264fdfa964f7b3c796fb3ac91b17666
https://github.com/SebastianKrog
SebastianKroghttps://github.com/SebastianKrog
on Jun 4, 2020https://github.com/plotly/plotly.R/issues/1659#issuecomment-638710061
https://user-images.githubusercontent.com/4109/83735061-22d1f100-a650-11ea-87a0-2901f1d46fb4.png
https://github.com/cpsievert
cpsieverthttps://github.com/cpsievert
on Jun 4, 2020https://github.com/plotly/plotly.R/issues/1659#issuecomment-638887450
chschanhttps://github.com/chschan
on Jun 26, 2022https://github.com/plotly/plotly.R/issues/1659#event-6880336083
[pull] master from ropensci:master (#2)https://github.com/Displayr/plotly/commit/504c33f5a9c92f511cfeade4708bfa5928d13dcc
#2https://github.com/Displayr/plotly/pull/2
https://docs.github.com/articles/closing-issues-via-commit-messages
504c33fhttps://github.com/Displayr/plotly/commit/504c33f5a9c92f511cfeade4708bfa5928d13dcc
chschanhttps://github.com/chschan
on Jul 4, 2022https://github.com/plotly/plotly.R/issues/1659#event-6924524277
Plotly june2022 (#18)https://github.com/Displayr/plotly/commit/55f49ee1fce06c206aed509fa1a944ac49fc5560
#18https://github.com/Displayr/plotly/pull/18
https://docs.github.com/articles/closing-issues-via-commit-messages
55f49eehttps://github.com/Displayr/plotly/commit/55f49ee1fce06c206aed509fa1a944ac49fc5560
Sign up for freehttps://github.com/signup?return_to=https://github.com/plotly/plotly.R/issues/1659
Sign in to commenthttps://github.com/login?return_to=https://github.com/plotly/plotly.R/issues/1659
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.