DS4PS / cpp-529-spr-2021

Course shell for CPP 529 Community Analytics
http://ds4ps.org/cpp-529-spr-2021/
2 stars 0 forks source link

Final Dashboard - Selected City Map phx_dorling.geojson #19

Closed AhmedRashwanASU closed 3 years ago

AhmedRashwanASU commented 3 years ago

Is the Below JSON file is only for Phoenix Map? If YES then where can I get my Selected City Map URL?


github.url <- "https://github.com/DS4PS/cpp-529-fall-2020/raw/main/data/phx_dorling.geojson"

phx <- geojson_read( x=github.url,  what="sp" )

# reproject the map 
phx2 <- spTransform( phx, CRS("+init=epsg:3395") )

# convert the sp map format to 
# an sf (simple features) format:
# ggmap requires the sf format
phx.sf <- st_as_sf( phx2 )

# separate out the data frame from the map
d <- as.data.frame( phx.sf )
AntJam-Howell commented 3 years ago

Hi Ahmed,

You can create the dorling map for you city based on the work we did in Lab

  1. Please find the Lab 4 solutions to check out (link https://www.dropbox.com/s/lblrpwrigea8ljh/lab-04-solutions.rmd?dl=1). You need to read in the census data and spatial features, and then transform the shapefile into the dorling.

Let me know if that helps.

Best,

On Thu, Apr 22, 2021 at 3:52 PM AhmedRashwanASU @.***> wrote:

Is the Below JSON file is only for Phoenix Map? If YES then where can I get my Selected City Map URL?

github.url <- "https://github.com/DS4PS/cpp-529-fall-2020/raw/main/data/phx_dorling.geojson"

phx <- geojson_read( x=github.url, what="sp" )

reproject the map

phx2 <- spTransform( phx, CRS("+init=epsg:3395") )

convert the sp map format to

an sf (simple features) format:

ggmap requires the sf format

phx.sf <- st_as_sf( phx2 )

separate out the data frame from the map

d <- as.data.frame( phx.sf )

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/DS4PS/cpp-529-spr-2021/issues/19, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMK2Y7Z7LVNED65RT4EBM33TKCSDLANCNFSM43NQCCRQ .

-- Anthony Howell Asst. Prof. in Public Policy School of Public Affairs Arizona State University Faculty Profile https://sustainability.asu.edu/person/anthony-howell/ (CV https://www.dropbox.com/s/b1pxccpwxm6fats/Howell.CV.pdf?dl=0)

JayCastro commented 3 years ago

when i try this i cant get the groups

AhmedRashwanASU commented 3 years ago

Hi Profs , @Anthony-Howell-PhD @lecy

I Have created my Dorling for the selected city, I store it in my local disk as below code, however, the map isn't showing as below, not sure what I'm missing.


# DATA STEPS 

# load Dorling cartogram from github
# map already contains census data and groups from clustering 

library( geojsonio )
library( sp )

WAHS <- geojson_read( "msp_dorling.geojson", what="sp" )

plot( WAHS )

# reproject the map 
WAHS2 <- spTransform( WAHS, CRS("+init=epsg:3395") )

# convert the sp map format to 
# an sf (simple features) format:
# ggmap requires the sf format
WAHS2.sf <- st_as_sf( WAHS2 )

# separate out the data frame from the map
d <- as.data.frame( WAHS2.sf )

However, the map isn't showing as below screen,

image

AntJam-Howell commented 3 years ago

Hi Jay, Can you please email me your rmd file and the .geojson file of your selected location? I will take a look. Best,

On Fri, Apr 23, 2021 at 4:23 PM JayCastro @.***> wrote:

when i try this i cant get the groups

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/DS4PS/cpp-529-spr-2021/issues/19#issuecomment-825989844, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMK2Y74QHZBHWIHN5DFBFR3TKH6OHANCNFSM43NQCCRQ .

-- Anthony Howell Asst. Prof. in Public Policy School of Public Affairs Arizona State University Faculty Profile https://sustainability.asu.edu/person/anthony-howell/ (CV https://www.dropbox.com/s/b1pxccpwxm6fats/Howell.CV.pdf?dl=0)

AntJam-Howell commented 3 years ago

Hi Ahmed, Can you please email me your rmd file and the .geojson file of your selected location? I will take a look. Best,

On Fri, Apr 23, 2021 at 5:40 PM AhmedRashwanASU @.***> wrote:

Hi Profs , @Anthony-Howell-PhD https://github.com/Anthony-Howell-PhD @lecy https://github.com/lecy

I Have created my Dorling for the selected city, I store it in my local disk as below code, however, the map isn't showing as below, not sure what I'm missing.

DATA STEPS

load Dorling cartogram from github

map already contains census data and groups from clustering

library( geojsonio ) library( sp )

WAHS <- geojson_read( "msp_dorling.geojson", what="sp" )

plot( WAHS )

reproject the map

WAHS2 <- spTransform( WAHS, CRS("+init=epsg:3395") )

convert the sp map format to

an sf (simple features) format:

ggmap requires the sf format

WAHS2.sf <- st_as_sf( WAHS2 )

separate out the data frame from the map

d <- as.data.frame( WAHS2.sf )

However, the map isn't showing as below screen,

[image: image] https://user-images.githubusercontent.com/77247268/115941585-041e5800-a4b7-11eb-9a25-75400e8cdeab.png

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DS4PS/cpp-529-spr-2021/issues/19#issuecomment-826006011, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMK2Y76JFIPBYFWV2XPJCLTTKIHQPANCNFSM43NQCCRQ .

-- Anthony Howell Asst. Prof. in Public Policy School of Public Affairs Arizona State University Faculty Profile https://sustainability.asu.edu/person/anthony-howell/ (CV https://www.dropbox.com/s/b1pxccpwxm6fats/Howell.CV.pdf?dl=0)