Comments (6)
Thanks for the examples!
decode
Should this return NA_real_, or a data frame containing two NA values
My instinct tells me a data.frame with two NA values, to keep the structure consistent.
Which do you think is the better option?
I'd be happy to submit a PR for this if you'd like.
yes please :)
encode
Yes these cases need to be handled. My first thoughts are to either
- Issue an
Error
if anyNA
s are found, to force the issue back to the user - Issue a
warning
if anyNA
s are found, but exclude them from the encoding
What do you think to these options?
from googlepolylines.
So full disclaimer, I actually have never used googlePolylines, so I don't have a strong take what makes the most sense on how to handle these cases. I was just poking around this repo after seeing the cool stuff being done with mapdeck
on rstats Twitter, and seeing that you were planning on trying to migrate some of the code to Rcpp.
Having said that, for the decode example, I agree that returning a data frame is probably better. Looking at the list output, I could see wanting to rbind
all of the results together via do.call
, so a data frame with the same column headers seems wise. I'll submit a PR for that fix tomorrow.
Also, I was playing around with the decode Rcpp functions, and modifyed it so that it's not having to create a new Rcpp::DataFrame
for every input string......I currently have a ~15x speed up for decode()
with char vector input, and all the tests are passing. Still want to work with it some more, but are you interested in a performance/refactor PR as well?
from googlepolylines.
but are you interested in a performance/refactor PR as well?
absolutely! Always keen to see & learn from others.
from googlepolylines.
@ChrisMuir did you look at the encode
examples while you were writing your PR?
If not I might move them into a separate issue and make them part of the v0.7.3 milestone
from googlepolylines.
Nope, I addressed the decode()
example, and made some minor speed refactors, but did not address the encode()
examples.
from googlepolylines.
Moved the encode()
examples to a separate issue - #39
from googlepolylines.
Related Issues (20)
- error if sf is not loaded
- elevation
- sfc objects HOT 1
- encode valid range [-9999,9999]
- empty geometry causes crash HOT 1
- Refactor encode() Rcpp code HOT 11
- header-only HOT 2
- Handling NA values
- Autodetection of latitude wrong for General Transit Feeds (GTFS) HOT 1
- Decode to sf / constructing sfencoded HOT 1
- change `sfc` attribute to `sfg`
- remove Boost HOT 5
- MULTIPOINT
- remove sf from tests and suggests
- Error in rcpp_decode_polyline: basic_string
- decode always prints the input HOT 2
- Switch to C++14 under Boost 1.75.0 HOT 6
- Installation error with old g++ and CXX14 HOT 3
- Longitude off by a factor of 10? HOT 2
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 googlepolylines.