Comments (4)
I am seeing the same behaviour, where I expect PA
to emerge unscathed from the triangulation it ends up 'row-wise' in the output not 'column-wise':
tri <- pslg(P = tpts, PA = tattrs) %>%
triangulate()
> head(tattrs)
x y
1 -428675.9 1520344
2 -1197290.8 7794188
3 -1120150.7 7234575
4 -1048583.9 6613223
5 -973499.6 5945572
6 -892969.4 5242144
> head(tri$PA)
[,1] [,2]
[1,] -428675.9 -1197290.8
[2,] -1120150.7 -1048583.9
[3,] -973499.6 -892969.4
[4,] -807038.3 -716485.6
[5,] -622414.4 -526061.0
[6,] -1524302.5 -1417125.3
from rtriangle.
For what it's worth, I can untangle the attributes matrix with this function, but obviously would be a lot better to fix it at source!
untangle <- function(triPA) {
return ( matrix( c( t( triPA ) ), ncol = dim(triPA)[2] ) );
}
or with pipes
untangle <- function(triPA) {
nc <- dim(triPA)[2]
return (triPA %>%
t() %>% # transpose
c() %>% # vectorise
matrix(ncol = nc)) # column-wise repopulate the original shape
}
from rtriangle.
Sorry for the delay in looking at this. It would indeed be desirable to fix the issue. I have been very busy, but I hope to have some time next week (during my holiday) to look at it properly.
from rtriangle.
This isn't more important than your holiday (at least not for me)! I assume the issue is some kind of index inversion when you are populating the output PA matrix
from rtriangle.
Related Issues (16)
- triangulate() does not triangulate a PSLG with two holes correctly HOT 3
- Found no calls to: ‘R_registerRoutines’, ‘R_useDynamicSymbols
- Crash under Windows i386 with particular PSLG
- Array overruns HOT 1
- potential anyDuplicated speed-up for pslg HOT 4
- is.na(PB) throws warning when valid PB supplied HOT 2
- RTriangle runs out of memory HOT 1
- Add Neighbour (NB) to output HOT 1
- plotting the voronoi tessellation
- A bug/error when "MaxArea" is small. HOT 7
- Function declaration without prototype is deprecated HOT 1
- Compiled code should not call sprintf
- -Wformat-extra-args warnings
- -Wformat= warnings
- implicit declaration of function 'Free' with -DSTRICT_R_HEADERS=1
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 rtriangle.