Comments (8)
Hi,
I'm very sorry for the slow response. I've been on vacation and then attending a conference, so I haven't had a chance to respond to you earlier. It looks like the wdpar is having problems with the geometry of the data. Broadly speaking, R's ability to clean invalid geometry is generally pretty good (and by this I specifically mean the lwgeom package), but it can fail to clean really invalid geometries. Unfortunately, there isn't much I can do about this.
I would recommend: (i) manually saving the data to a shapefile (see sf::st_write
), (ii) fixing it ESRI ArcMap using the repair geometry tool, and (iii) then importing the fixed data into R and running the wdpa_clean
function again. I'm sorry I don't have a better solution that doesn't involve commercial software.
Cheers,
Jeff
from wdpar.
Hello,
I ran into the same problem (see also #16 ) and solved it by changing in st_erase_overlaps
this line:
u <- sf::st_union(sf::st_set_precision(sf::st_buffer(o[ovr], 0), precision))
to
u <- sf::st_buffer(sf::st_union(sf::st_set_precision(sf::st_buffer(o[ovr], 0), precision)),dist = 0)
from wdpar.
Awesome work @antoinestevens! Thank you so much for coming up with a fix! I'll patch that into the dev version of the wdpar package now.
from wdpar.
Actually, it essentially fixed #16 but not this issue.
Modifying 2 lines below (don't ask me why) with st_make_valid
will finally fix all my problems
d <- sf::st_difference(sf::st_set_precision(g[i],precision), lwgeom::st_make_valid(sf::st_set_precision(u, precision)))
from wdpar.
Thank YOU for your awesome work (inc. your other super useful packages)
from wdpar.
Ok brilliant - I'll patch that fix in as well - thanks again!
from wdpar.
Thank you - I really appreciate it.
from wdpar.
I forgot to tag this issue in the latest commit, so I'll close this manually now.
from wdpar.
Related Issues (20)
- Feature Request: Add functionality to keep UNESCO sites and not yet implemented areas HOT 15
- HTTP error 404 in "global" query with wdpa_fetch HOT 3
- Fails to download country-level data HOT 2
- Fails package checks under noSuggests config
- Poor internet connection breaks wdpa_fetch HOT 9
- Port error HOT 10
- It takes forever to eraseoverlap for global dataset. HOT 22
- wdpa_fetch HOT 6
- I used the newest version of wdpar, still have this "side location conflict" HOT 7
- The package not run for previous download data, and do not start a new download data HOT 6
- GEOS version sensitivity HOT 7
- upcoming sf breaks wdpar HOT 6
- JOSS Review: Improve documentation on geo-processing steps and its effects on the original geometries HOT 12
- JOSS Review: Improve Statement of need / description of use-cases HOT 16
- JOSS Review - Add links to references cited in README HOT 3
- JOSS Review warning about out of date local data HOT 6
- JOSS Review: Add small POC about Performance claims HOT 7
- JOSS Review: Add statement about state of the field HOT 4
- wdpa_fetch() no longer works HOT 4
- Dissolve all MPAs in each country HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wdpar.