Closed voglerdaniel closed 2 days ago
See the urbnmapr documentation. It seems that this is based on something called fiftystater. My guess is that doesn't allow for non-states (e.g., Virgin Islands, Puerto Rico, etc.). The projection they use likely doesn't accommodate points so far away. When you do it without territories, does it work?
@atkissoncj Is this the right forum to post code when we encounter issues like this?
Yes
See the urbnmapr documentation. It seems that this is based on something called fiftystater. My guess is that doesn't allow for non-states (e.g., Virgin Islands, Puerto Rico, etc.). The projection they use likely doesn't accommodate points so far away. When you do it without territories, does it work?
Thanks! Unfortunately filtering the data down to only the 50 US states does not resolve this issue. Output ends up looking like this:
But what if you map the reduced set without the shape file? Is that still distorted?
But what if you map the reduced set without the shape file? Is that still distorted?
Not as bad, but ideally I'd like overlay it for consistency with other mappings.
And is urbnmapr really what we should be using? Aren't there known issues with urbnmapr?
Not as bad, but ideally I'd like overlay it for consistency with other mappings.
Yeah, sure, but at least it works.
And is urbnmapr really what we should be using? Aren't there known issues with urbnmapr?
Agreed, I'm looking at alternatives for this.
Another question you could ask is why we want to plot points in the first place, rather than summing flow over counties. The answer is that the county data in this file is a mess - 89% of the COUNTY_FIPS
field is empty. We'd have to map each latitude and longitude to counties if we want to generate this map at a county level.
@chayek Can you share code here (or point to the line) that will allow us to get points on a shapefile?
Create function that allows you to take in points and the shape file level the user would like and creates a good, consistent map. @voglerdaniel : note that this has been made into a feature. Feel free to remove it as a feature if another feature already exists that will do this and note the feature that will close this concern.
Is this resolved by usmap package now?
The USMap package solved part of the problem - I can now overlay points on a states shapefile. But the distortion problem still exists:
@chayek and I are working on addressing it
Is usmap the package that we'll be using? Or will we be building a different dependency?
https://stackoverflow.com/questions/58676661/geom-sf-mapping-points-shapes These steps helped me overlay points on external shape files (not urbnmpr).
Closing - this functionality will be covered by #24
I am curious whether there is a way to plot color-coded points representing facilities using urbnmapr rather than color-coding counties or census tracts.
The CWNS dataset reports total wastewater flow for each facility, along with its latitude and longitude. I'd like to use this physical location data to plot a point for each facility and color-code it based on the amount of total flow to create a heatmap. However, I'd like to overlay these points over the urbnmapr states shapefile, so that we can tell in which state each point is located.
I can plot only the points (distorted, without a shapefile - see below), but as soon as I try to overlay this on the states shapefile, my code breaks. @atkissoncj Is this the right forum to post code when we encounter issues like this?