Skip to content
This repository has been archived by the owner on May 1, 2021. It is now read-only.

SpatialPointsDataFrame support? #1

Open
rdinter opened this issue Dec 19, 2016 · 4 comments
Open

SpatialPointsDataFrame support? #1

rdinter opened this issue Dec 19, 2016 · 4 comments
Assignees

Comments

@rdinter
Copy link
Contributor

rdinter commented Dec 19, 2016

Is there a method here that can plot a SpatialPointsDataFrame over the state or county map and have the Alaska and Hawaii points adjusted? Possibly a function to take all points within the bounding box of Alaska/Hawaii and adjust to the bounding box of the accompanying shapefiles?

@hrbrmstr hrbrmstr self-assigned this Dec 19, 2016
@hrbrmstr
Copy link
Owner

Aye. I need to work out a bit more of the details for the point transformations for the elided states. Using the core transformation steps doesn't quite get the points where they need to be (though I never poked at it too hard).

@rdinter
Copy link
Contributor Author

rdinter commented Jan 5, 2017

I might be amiss here, but do you have the original shapefile and the transformed shapefile as well? I think I'd be able to create a function with the original shapefile available to the transformed. There's probably an issue with different projections, but at least this would be a temporary first step...

@ghost
Copy link

ghost commented Jan 5, 2017

The steps were outlined in a blog post last year (the transformations were the same, though I seem to have misplaced the generation script #sigh). When I helped someone last year with this some elided points did not get placed on the targets in HI and AK. Lemme try to regen it and provide the transform function (will try to get to it by the weekend).

@rdinter
Copy link
Contributor Author

rdinter commented Jan 25, 2017

Found the blog post! And if the shapefiles for albersusa came from that particular post/repository, then it shouldn't be too difficult to add in an elide_points function here.

The maptools::elide() function implicitly uses a bounding box whenever it rotates or scales a polygon. So to rotate, scale, and shift points then we need the original bounding box used for Alaska and Hawaii to get the identical transformation and explicitly call this bounding box with the function. So long as the shapefiles are coming from that post and it's outlined methods, then I've got the bounding boxes.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants