-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Workaround to convert geoJSON to topoJSON #193
Comments
Hey @tonycmac , appreciate the issue. Right now, geojsonio is broadly inactive; I took over maintenance of the package to keep it (and its dependencies) on CRAN, but I don't currently have the time (or, frankly, the familiarity with package internals) for feature development. So, I'm going to leave this issue open in case anyone skimming issues has a good solution for you. I'm personally not aware of any implementations in R for dealing with TopoJSON yet. And if I am able to find anything, I'll make sure I let you know. |
This is a real pity. Power BI requires shapefiles in topoJSON format and it would be great if it was possible to convert in R. I would have thought it was one of the core functions of geojson, so it's a shame the original makers abandoned it. |
Hi all, I had a brief look at this, given my current line of study (JS for R) ... I assume @oduilln is using
I assume this topo is correct .. seems to have "arcs" in the output file .. Which brings me to the idea that Having a look at the source code there, it either calls Following on from using
which gives the max memory to use, the
There doesn't seem to be an option (although i've spent little time looking at the source code) to tag on the end of the
where I leave
ConclusionIf this is correct - please advise! - then either
|
I created this .. ateucher/rmapshaper#128 |
I had a look at the issue with Was this the main isssue here, or somethin else? |
Honestly, no idea; I think that was done in ~2019, way before I had anything to do with this package. I can try to investigate once I've got a bit more time, or if you want to make a PR I'd be happy to look it over @Shaunson26 |
Sweet.. Can do.. |
Hey folks ( @tonycmac , @oduilln and anyone else watching) -- @Shaunson26 contributed a PR which may have fixed this issue. Can someone install the newest development version (via |
Via email, Carina Hoyer confirms that this works (though is perhaps inefficient; I welcome issues/PRs to fix that!). I'm going to close this out; if there are related issues with writing topoJSON, please feel free to open a new issue. |
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex: https://reprex.tidyverse.org) and link to this issue. |
New to writing issues so apologies if this isn't done correctly but I'm curious if there's any known workarounds to converting geoJSON to topoJSON.
I know that issue 168 made geojsonio::topojson_write() defunct in April 2020 but wondering if there's any programmatic ways to do these conversions.
I've been using mapshaper to manually convert to topoJSON for now and it works but would love to have an R solution to this.
I was naively hopeful that perhaps the github/dev version of geojsonio had fixed this issue but it appears (after installing it) that the issue remains.
Additional info if useful:
My specific use case is utilizing the Government of Canada boundary files and using the Economic regions SHP file. I'm able to read in and use the file using sf::st_read() but attempting to convert it to topoJSON produces the defunct error message. Reviewing the documentation for geojsonio::topojson_write(), it indicates it's just a wrapper for geojsonio::geojson_write() and geojsonio::geo2topo() so I tried doing so and was able to convert successfully to geonJSON but geo2topo() fails.
Created on 2022-12-16 with reprex v2.0.2
Session info
The text was updated successfully, but these errors were encountered: