Read HGAC County and City Boundaries

Mapping
Texas
Harris county
Harris-Galveston Area Council polygons for the counties and cities within that group.
Author

Alan Jackson

Published

November 4, 2022

City and county boundaries from HGAC

downloaded 11/4/2022 from

https://gishub-h-gac.hub.arcgis.com/datasets/H-GAC::hgac-counties-political

Read and display

fgdb <- paste0(path, "HGAC_Counties_Political.dbf")

# Read the feature class
temp <- sf::st_read(fgdb)
Reading layer `HGAC_Counties_Political' from data source 
  `/home/ajackson/Dropbox/Rprojects/Curated_Data_Files/City_and_County_bdys/HGAC_Counties_Political.dbf' 
  using driver `ESRI Shapefile'
Simple feature collection with 13 features and 11 fields
Geometry type: POLYGON
Dimension:     XY
Bounding box:  xmin: -96.87423 ymin: 28.27974 xmax: -94.35339 ymax: 31.0581
Geodetic CRS:  WGS 84
sf::st_crs(temp) <- googlecrs
temp <- sf::st_make_valid(temp)

summary(temp)
    OBJECTID      FIPS               NAME               ALAND          
 Min.   : 1   Length:13          Length:13          Min.   :9.814e+08  
 1st Qu.: 4   Class :character   Class :character   1st Qu.:1.674e+09  
 Median : 7   Mode  :character   Mode  :character   Median :2.487e+09  
 Mean   : 7                                         Mean   :2.429e+09  
 3rd Qu.:10                                         3rd Qu.:2.831e+09  
 Max.   :13                                         Max.   :4.416e+09  
     AWATER             PALETTE         JUDGE             WEBPAGE         
 Min.   :1.162e+07   Min.   :0.000   Length:13          Length:13         
 1st Qu.:3.471e+07   1st Qu.:1.000   Class :character   Class :character  
 Median :6.153e+07   Median :2.000   Mode  :character   Mode  :character  
 Mean   :3.459e+08   Mean   :1.615                                        
 3rd Qu.:6.379e+08   3rd Qu.:2.000                                        
 Max.   :1.346e+09   Max.   :3.000                                        
      TERM              ShapeSTAre          ShapeSTLen               geometry 
 Min.   :2022-12-31   Min.   :1.443e+10   Min.   : 733314   POLYGON      :13  
 1st Qu.:2022-12-31   1st Qu.:2.428e+10   1st Qu.: 837639   epsg:4326    : 0  
 Median :2022-12-31   Median :2.714e+10   Median : 853046   +proj=long...: 0  
 Mean   :2022-12-31   Mean   :2.986e+10   Mean   : 920292                     
 3rd Qu.:2022-12-31   3rd Qu.:3.279e+10   3rd Qu.: 978016                     
 Max.   :2022-12-31   Max.   :4.954e+10   Max.   :1314232                     
tmap::tmap_options(basemaps="OpenStreetMap")
tmap::tmap_mode("view") # set mode to interactive plots

  tmap::tm_shape(temp) + 
  tmap::tm_borders(col="blue") +
  tmap::tm_fill(alpha=0.6, col="MAP_COLORS") 
# saveRDS(temp, paste0(path, "HGAC_County_bdys.Rds"))


fgdb <- paste0(path, "HGAC_City_Boundaries.dbf")

# Read the feature class
temp <- sf::st_read(fgdb)
Reading layer `HGAC_City_Boundaries' from data source 
  `/home/ajackson/Dropbox/Rprojects/Curated_Data_Files/City_and_County_bdys/HGAC_City_Boundaries.dbf' 
  using driver `ESRI Shapefile'
Simple feature collection with 175 features and 37 fields
Geometry type: MULTIPOLYGON
Dimension:     XY
Bounding box:  xmin: -96.79252 ymin: 28.68202 xmax: -94.3558 ymax: 30.86113
Geodetic CRS:  WGS 84
sf::st_crs(temp) <- googlecrs
temp <- sf::st_make_valid(temp)

summary(temp)
    OBJECTID       STATEFP            PLACEFP            PLACENS         
 Min.   :  1.0   Length:175         Length:175         Length:175        
 1st Qu.: 44.5   Class :character   Class :character   Class :character  
 Median : 88.0   Mode  :character   Mode  :character   Mode  :character  
 Mean   : 88.0                                                           
 3rd Qu.:131.5                                                           
 Max.   :175.0                                                           
                                                                         
    GEOID               NAME             CLASSFP              ALAND         
 Length:175         Length:175         Length:175         Min.   :  0.0844  
 Class :character   Class :character   Class :character   1st Qu.:  1.8372  
 Mode  :character   Mode  :character   Mode  :character   Median :  2.9012  
                                                          Mean   : 12.2006  
                                                          3rd Qu.:  9.0592  
                                                          Max.   :636.9503  
                                                          NA's   :1         
     AWATER               SQMI             PALETTE         MAYOR          
 Min.   :  0.00000   Min.   :  0.0844   Min.   :0.000   Length:175        
 1st Qu.:  0.00228   1st Qu.:  1.8799   1st Qu.:0.000   Class :character  
 Median :  0.02543   Median :  2.8754   Median :1.000   Mode  :character  
 Mean   :  1.30271   Mean   : 13.4329   Mean   :1.263                     
 3rd Qu.:  0.18858   3rd Qu.:  9.2892   3rd Qu.:2.000                     
 Max.   :121.25489   Max.   :666.2294   Max.   :4.000                     
 NA's   :1                                                                
   WEBPAGE               TERM              ShapeSTAre          ShapeSTLen     
 Length:175         Min.   :2020-05-31   Min.   :2.352e+06   Min.   :   8616  
 Class :character   1st Qu.:2022-05-31   1st Qu.:5.241e+07   1st Qu.:  41521  
 Mode  :character   Median :2022-05-31   Median :8.016e+07   Median :  71973  
                    Mean   :2022-10-31   Mean   :3.761e+08   Mean   : 183345  
                    3rd Qu.:2023-05-31   3rd Qu.:2.590e+08   3rd Qu.: 141514  
                    Max.   :2025-06-30   Max.   :1.871e+10   Max.   :8407143  
                    NA's   :40                                                
   ATLARGE1           WEBPAGE1             TERM1              ATLARGE2        
 Length:175         Length:175         Min.   :2021-06-01   Length:175        
 Class :character   Class :character   1st Qu.:2022-05-31   Class :character  
 Mode  :character   Mode  :character   Median :2022-11-30   Mode  :character  
                                       Mean   :2022-12-17                     
                                       3rd Qu.:2023-05-31                     
                                       Max.   :2024-05-31                     
                                       NA's   :50                             
   WEBPAGE2             TERM2              ATLARGE3           WEBPAGE3        
 Length:175         Min.   :2021-11-30   Length:175         Length:175        
 Class :character   1st Qu.:2022-05-31   Class :character   Class :character  
 Mode  :character   Median :2022-11-30   Mode  :character   Mode  :character  
                    Mean   :2022-12-21                                        
                    3rd Qu.:2023-05-31                                        
                    Max.   :2024-11-18                                        
                    NA's   :50                                                
     TERM3              ATLARGE4           WEBPAGE4        
 Min.   :2021-05-31   Length:175         Length:175        
 1st Qu.:2022-05-31   Class :character   Class :character  
 Median :2022-11-30   Mode  :character   Mode  :character  
 Mean   :2022-12-15                                        
 3rd Qu.:2023-05-31                                        
 Max.   :2025-05-31                                        
 NA's   :60                                                
     TERM4              ATLARGE5           WEBPAGE5        
 Min.   :2021-06-01   Length:175         Length:175        
 1st Qu.:2022-05-31   Class :character   Class :character  
 Median :2022-11-30   Mode  :character   Mode  :character  
 Mean   :2022-12-06                                        
 3rd Qu.:2023-05-31                                        
 Max.   :2024-11-18                                        
 NA's   :60                                                
     TERM5              ATLARGE6           WEBPAGE6        
 Min.   :2021-11-30   Length:175         Length:175        
 1st Qu.:2022-05-31   Class :character   Class :character  
 Median :2023-05-31   Mode  :character   Mode  :character  
 Mean   :2022-12-23                                        
 3rd Qu.:2023-05-31                                        
 Max.   :2025-05-31                                        
 NA's   :67                                                
     TERM6              ATLARGE7           WEBPAGE7        
 Min.   :2021-11-18   Length:175         Length:175        
 1st Qu.:2022-05-31   Class :character   Class :character  
 Median :2022-05-31   Mode  :character   Mode  :character  
 Mean   :2022-08-13                                        
 3rd Qu.:2022-05-31                                        
 Max.   :2024-01-08                                        
 NA's   :160                                               
     TERM7                     geometry  
 Min.   :2022-11-18   MULTIPOLYGON :175  
 1st Qu.:2023-01-05   epsg:4326    :  0  
 Median :2023-02-23   +proj=long...:  0  
 Mean   :2023-02-23                      
 3rd Qu.:2023-04-12                      
 Max.   :2023-05-31                      
 NA's   :173                             
tmap::tmap_options(basemaps="OpenStreetMap")
tmap::tmap_mode("view") # set mode to interactive plots

  tmap::tm_shape(temp) + 
  tmap::tm_borders(col="blue") +
  tmap::tm_fill(alpha=0.3, col="MAP_COLORS") 
# saveRDS(temp, paste0(path, "HGAC_City_bdys.Rds"))