Skip to content

Conversation

SimonGoring
Copy link

This is in reference to issues #219 and #224. I tried to figure out a way to make the direct comparison between projections, but the epgs3857 used here is not (strictly speaking) the one unpacked by rgdal when you use +init=epsg:3857.

1.  Added `method` to the options so that users can define eother `'ngb'` or `'bilinear'` options for `raster::projectExtent` to improve plotting of categorical data. (and added to `roxygen2` documentation block)

2.  Do not re-project if CRS for the raster is equivalent to the current CRS.  I'm not sure if this is that common an issue, but just to avoid any potential (accidental) reprojection (see issue #224).
…tion strings. The `+init=epsg:3857` projection expands to:

```
"+init=epsg:3857 +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"
```
which is not directly comparable to the variable `epsg3857`:

```
"+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"
```
@bhaskarvk
Copy link
Collaborator

@jcheng5 I don't see why this shouldn't be merged ? If you approve let me know and I'll give you a PR with all checks passing.

@jcheng5
Copy link
Member

jcheng5 commented Oct 26, 2016

I guess so. In the browser the image will be drawn with bilinear or nearest neighbor depending on zoom level. But I think that's probably fine.

// We can do the actual drawing in one of three ways:
// - Call drawImage(). This is easy and fast, and results in smooth
// interpolation (bilinear?). This is what we want when we are
// reducing the image from its native size.
// - Call drawImage() with imageSmoothingEnabled=false. This is easy
// and fast and gives us nearest-neighbor interpolation, which is what
// we want when enlarging the image. However, it's unsupported on many
// browsers (including QtWebkit).
// - Do a manual nearest-neighbor interpolation. This is what we'll fall
// back to when enlarging, and imageSmoothingEnabled isn't supported.
// In theory it's slower, but still pretty fast on my machine, and the
// results look the same AFAICT.

We will need to get a CLA from @SimonGoring. Simon, if you'll please email me at [email protected] I can send you a form. If you're not familiar with CLAs, they give the copyright of your code change to the owner of the project, so that the project can be relicensed in the future if necessary.

@bhaskarvk
Copy link
Collaborator

This is such a small PR do we really need a CLA signed for this ? Other than that looks like something we should include right away.

@bhaskarvk
Copy link
Collaborator

Duplicate of #462

@bhaskarvk bhaskarvk marked this as a duplicate of #462 Nov 10, 2017
@bhaskarvk bhaskarvk closed this Nov 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants