def main():
    """
    This executes functions related to Food and Agriculture from HIFLD datasets
    """

    source = {
        'food.poultry_processing_facilities':
        'https://opendata.arcgis.com/datasets/55d907e8c03649cd996a99bea1c4fe07_0.geojson',
        'food.public_refrigerated_warehouses':
        'https://opendata.arcgis.com/datasets/22c3961adfdb4a8daffdc2d6277b9633_0.geojson'
    }

    for table in source:

        if table_exists(table) == True:

            print(f'Table: "{table}" exists')

        else:

            #print(f'Creating Table: {table}')

            resultsdf = hifld_dataframe(source[table])

            #print(resultsdf)
            results = mariadb_write(table, resultsdf)

            print(results)
Beispiel #2
0
def main():

    source = {'emergency.american_red_cross_chapter_facilities': 'https://opendata.arcgis.com/datasets/432f35312f0849f697b263f3d753e5ed_0.geojson', 
    'emergency.american_red_cross_headquarters': 'https://opendata.arcgis.com/datasets/90780ba531ac42f9824c8bd1a00f219d_0.geojson', 
    'emergency.american_red_cross_regions': 'https://opendata.arcgis.com/datasets/922ca1db135540e48943a870877bef70_2.geojson', 
    'emergency.ems_stations': 'https://opendata.arcgis.com/datasets/362c9480f12e4587b6a502f9ceedccde_0.geojson', 
    'emergency.fema_recovery_offices': 'https://opendata.arcgis.com/datasets/05a88d9d954d4ec68d21794b382b2df3_1.geojson', 
    'emergency.fema_regional_offices': 'https://opendata.arcgis.com/datasets/6622aa77740944a29a31ddfd8e913317_0.geojson', 
    'emergency.fema_regions': 'https://opendata.arcgis.com/datasets/5f6207ccb91d4ae48124018ffaec04bf_2.geojson', 
    'emergency.fire_stations': 'https://opendata.arcgis.com/datasets/0ccaf0c53b794eb8ac3d3de6afdb3286_0.geojson', 
    'emergency.hurricane_evacuation_routes': 'https://opendata.arcgis.com/datasets/3331d09be1684c3d8053a0b71edb54d2_0.geojson', 
    'emergency.local_emergency_ops_centers': 'https://opendata.arcgis.com/datasets/874798faedc74358bac9bbe1867af3c7_0.geojson', 
    'emergency.national_shelter_system_facilities': 'https://opendata.arcgis.com/datasets/bcaf5fdb3db24c78afee52d4c8a02748_5.geojson', 
    'emergency.911_service_area_boundaries': 'https://opendata.arcgis.com/datasets/d47bd3b0796f48d488d63c9917d25100_0.geojson', 
    'emergency.state_emergency_ops_centers': 'https://opendata.arcgis.com/datasets/1a7559aff4844505a1c78efc46368112_0.geojson'}

    for table in source:

        if table_exists(table) == True:

            print(f'Table: "{table}" exists')

        else:

            #print(f'Creating Table: {table}')

            resultsdf = hifld_dataframe(source[table])

            #print(resultsdf)
            results = mariadb_write(table, resultsdf)

            print(results)
def main():
    """
    Hospital Data imports module from ornl_json_functions
    """

    source = {
        'health.hospitals':
        'https://opendata.arcgis.com/datasets/6ac5e325468c4cb9b905f1728d6fbf0f_0.geojson',
        'health.public_health_departments':
        'https://opendata.arcgis.com/datasets/1b919b0ff5f44d05bcb374591206f757_0.geojson',
        'health.urgent_care_facilities':
        'https://opendata.arcgis.com/datasets/335ccc7c0684453fad69d8a64bc89192_0.geojson',
        'health.va_admin_medical_facilities':
        'https://opendata.arcgis.com/datasets/f11d7d153bfb408f85bd029b2dac9298_0.geojson'
    }

    for table in source:

        if table_exists(table) == True:

            print(f'Table: "{table}" exists')

        else:

            #print(f'Creating Table: {table}')

            resultsdf = hifld_dataframe(source[table])

            #print(resultsdf)
            results = mariadb_write(table, resultsdf)

            print(results)
    """
    Pharmacy Data imports uses healthready_csv_functions module
    """

    source2 = {
        'health.pharmacies': 'http://rxopen.org/api/v1/map/download/facility'
    }

    for table in source2:

        if table_exists(table) == True:

            print(f'Table: "{table}" exists')

        else:

            #print(f'Creating Table: {table}')

            resultsdf = healthready_dataframe(source2[table])

            #print(resultsdf)
            results = mariadb_write(table, resultsdf)

            print(results)
def main():

    source = {'energy.biodiesel_plants': 'https://opendata.arcgis.com/datasets/20db0061f0bb4eaaa02942e8818c0f79_0.geojson', 
    'energy.bottom_wells': 'https://opendata.arcgis.com/datasets/de71df03a4ed4578851638e8910c0108_0.geojson', 
    'energy.control_areas': 'https://opendata.arcgis.com/datasets/02602aecc68d4e0a90bf65e818155f60_0.geojson', 
    'energy.electric_holding_company_areas': 'https://opendata.arcgis.com/datasets/42e8e0c7a3194ab0a42604e5a2cb63ef_0.geojson', 
    'energy.electric_planning_areas': 'https://opendata.arcgis.com/datasets/7d35521e3b2c48ab8048330e14a4d2d1_0.geojson', 
    'energy.electric_power_transmission_lines': 'https://opendata.arcgis.com/datasets/70512b03fe994c6393107cc9946e5c22_0.geojson', 
    'energy.electric_retail_service_territories': 'https://opendata.arcgis.com/datasets/c4fd0b01c2544a2f83440dab292f0980_0.geojson', 
    'energy.electric_substations': 'https://opendata.arcgis.com/datasets/755e8c8ae15a4c9abfceca7b2e95fb9a_0.geojson', 
    'energy.epa_frs_power_plants': 'https://opendata.arcgis.com/datasets/21698d59fa9b4110902b4fc2851426d9_12.geojson', 
    'energy.ethanol_plants': 'https://opendata.arcgis.com/datasets/489eb0a8ed7e4ebab624c8c4acca7569_0.geojson', 
    'energy.ethanol_transloading_facilities': 'https://opendata.arcgis.com/datasets/a520ff2ec6a040ffa38beca431f42d27_0.geojson', 
    'energy.ferc_regions': 'https://opendata.arcgis.com/datasets/ae9bc057efa44f23bde91a2cb8e996db_0.geojson', 
    'energy.generating_units': 'https://opendata.arcgis.com/datasets/14b5a08efaec446ba7aa0121220141fa_0.geojson', 
    'energy.hydrocarbon_gas_liquid_pipelines': 'https://opendata.arcgis.com/datasets/7e0df431f6994399ae48c6a03e29f060_0.geojson', 
    'energy.indepenent_system_operators': 'https://opendata.arcgis.com/datasets/9d1099b016e5482c900d657f06f3ac80_0.geojson', 
    'energy.lng_import_exports_and_terminals': 'https://opendata.arcgis.com/datasets/57baedf9075f42c5b966607a9caa8616_0.geojson', 
    'energy.natural_gas_compressor_stations': 'https://opendata.arcgis.com/datasets/cb4ea4a90a5e4849860d0d56058c2f75_0.geojson', 
    'energy.natural_gas_import_export': 'https://opendata.arcgis.com/datasets/c4dd08fed90744a2acb4d95be0c5b792_0.geojson',
    'energy.natural_gas_local_dist_service_territories': 'https://opendata.arcgis.com/datasets/a3d48c142f88433ab77aa755a56aa07a_0.geojson', 
    'energy.natural_gas_pipelines': 'https://opendata.arcgis.com/datasets/f44e00fce8b943f69a40a2324cf49dfd_0.geojson', 
    'energy.natural_gas_processings_and_plants': 'https://opendata.arcgis.com/datasets/ca984888f8154c63bf3a023f0a1f9ac2_0.geojson', 
    'energy.natural_gas_receipt_delivery_points': 'https://opendata.arcgis.com/datasets/6e01edc178ea4b7e9cec874e206248a2_0.geojson', 
    'energy.natural_gas_storage_facilities': 'https://opendata.arcgis.com/datasets/dfbff0ff802d4a64b13af1f81fac54cf_0.geojson', 
    'energy.nerc_regions': 'https://opendata.arcgis.com/datasets/6b2af23c67f04f4cb01d88c61aaf558a_0.geojson', 
    'energy.nerc_reliability_coordinators': 'https://opendata.arcgis.com/datasets/ee47fbb73fc04d609510f340e1c1952c_0.geojson', 
    'energy.oil_and_natural_gas_fields': 'https://opendata.arcgis.com/datasets/b7bfd5a75537493d894140bd9527337e_0.geojson', 
    'energy.oil_and_natural_gas_interconnects': 'https://opendata.arcgis.com/datasets/749f935c235f4a5eac0db20493a63e7f_0.geojson', 
    'energy.oil_and_natural_gas_platforms': 'https://opendata.arcgis.com/datasets/d6403a49d5cd428ebe67a1fa7fd69a40_0.geojson', 
    'energy.oil_and_natural_gas_wells': 'https://opendata.arcgis.com/datasets/17c5ed5a6bd44dd0a52c616a5b0cacca_0.geojson', 
    'energy.ocs_drilling_platforms': 'https://opendata.arcgis.com/datasets/eb03e987f5524504838f6a4501fe5453_0.geojson', 
    'energy.ocs_natural_gas_wells': 'https://opendata.arcgis.com/datasets/ecf85c4e074745cfae5fce7baac4ada9_1.geojson', 
    'energy.petroleum_ports': 'https://opendata.arcgis.com/datasets/16aafe11156d4ce591c6c054e94fffca_0.geojson', 
    'energy.petroleum_terminals': 'https://opendata.arcgis.com/datasets/7841aba67178425cbf33995fc914e2fe_0.geojson', 
    'energy.pol_pumping_stations': 'https://opendata.arcgis.com/datasets/eb91d583a04042e7a5aff0b72bad0ef9_0.geojson', 
    'energy.power_plants': 'https://opendata.arcgis.com/datasets/ee0263bd105d41599be22d46107341c3_0.geojson'}

    for table in source:

        if table_exists(table) == True:

            print(f'Table: "{table}" exists')

        else:

            #print(f'Creating Table: {table}')

            resultsdf = hifld_dataframe(source[table])

            #print(resultsdf)
            results = mariadb_write(table, resultsdf)

            print(results)
def main():

    source = {
        'water.aquifers':
        'https://opendata.arcgis.com/datasets/d2ce672fda1f44089af659b629d11458_0.geojson',
        'water.dam_lines':
        'https://opendata.arcgis.com/datasets/128ad6541ace4bf8b7a12a395ba9d8b9_0.geojson',
        'water.epa_frs_wastewater_treatment_plant':
        'https://opendata.arcgis.com/datasets/4b9bac25263047c19e617d7bd7b30701_0.geojson',
        'water.nhd_areas_large_scale':
        'https://opendata.arcgis.com/datasets/e12c65d5070d4239b789767dab99d9d3_8.geojson',
        'water.nhd_areas_small_scale':
        'https://opendata.arcgis.com/datasets/df32f7bcbbfd4f80b8407d3cf6346373_7.geojson',
        'water.nhd_flowlines_large_scale':
        'https://opendata.arcgis.com/datasets/acc809ddc7b245b1a10fe86159eb6556_6.geojson',
        'water.nhd_flowlines_small_scale':
        'https://hifld-geoplatform.opendata.arcgis.com/datasets/national-hydrography-dataset-nhd-flowlines-small-scale',
        'water.nhd_lines_large_scale':
        'https://opendata.arcgis.com/datasets/d753f0f1896844b59fe9b2355b12a425_3.geojson',
        'water.nhd_lines_small_scale':
        'https://opendata.arcgis.com/datasets/881cc3cc4dda4f6e8569d331ede08f81_2.geojson',
        'water.nhd_point_events':
        'https://opendata.arcgis.com/datasets/a9faf578e1e94aeeb6e5cb392d834667_1.geojson',
        'water.nhd_points':
        'https://opendata.arcgis.com/datasets/9389e2e84b2a4259ad0a0f12077eb51f_0.geojson',
        'water.nhd_waterbodies_large_scale':
        'https://opendata.arcgis.com/datasets/dd78ae237fe64b9582b84ad9869c4365_10.geojson',
        'water.nhd_waterbodies_small_scale':
        'https://opendata.arcgis.com/datasets/4f95153df421471d825a1137baabcf2f_9.geojson',
        'water.reclamation_reservoirs':
        'https://opendata.arcgis.com/datasets/414d6b8603bc418f9fc4ab509e8596ff_0.geojson',
        'water.usace_owned_operated_reservoirs':
        'https://opendata.arcgis.com/datasets/e8abf1e31e2644458a9cd62145f9048c_0.geojson',
        'water.watershed_boundary_lines':
        'https://opendata.arcgis.com/datasets/b5ecb8870aa747259359f2c92af6c742_0.geojson'
    }

    for table in source:

        if table_exists(table) == True:

            print(f'Table: "{table}" exists')

        else:

            #print(f'Creating Table: {table}')

            resultsdf = hifld_dataframe(source[table])

            #print(resultsdf)
            results = mariadb_write(table, resultsdf)

            print(results)
Beispiel #6
0
def main():

    source = {
        'transport.trails':
        'https://opendata.arcgis.com/datasets/2adfa36ed53646409e0f42f86e494730_0.geojson',
        'transport.aircraft_landing_facilities':
        'https://opendata.arcgis.com/datasets/f6c9f71016f7461ba8e260a3a60b92a7_0.geojson',
        'transport.faa_regions':
        'https://opendata.arcgis.com/datasets/33fb3a7400284b9db780307f0d18a5f2_0.geojson',
        'transport.runways':
        'https://opendata.arcgis.com/datasets/518e7315b90f4fff82d4511c7115eef2_0.geojson',
        'transport.amtrack_stations':
        'https://opendata.arcgis.com/datasets/628537f4cf774cde8aa9721212226390_0.geojson',
        'transport.fixed_guideway_transit_stations':
        'https://opendata.arcgis.com/datasets/c16416d09be2411ab7c42225c56999d5_0.geojson',
        'transport.intermodal_passenger_connectivity':
        'https://opendata.arcgis.com/datasets/a316a953272a4faf8ae74b426c88d543_0.geojson',
        'transport.national_bridge_inventory':
        'https://opendata.arcgis.com/datasets/a9b05a595ff94f3fa3888d1240545740_0.geojson',
        'transport.public_transit_routes':
        'https://opendata.arcgis.com/datasets/b1e65e78c4c647d18958c99b17622509_0.geojson'
    }

    for table in source:

        if table_exists(table) == True:

            print(f'Table: "{table}" exists')

        else:

            #print(f'Creating Table: {table}')

            resultsdf = hifld_dataframe(source[table])

            #print(resultsdf)
            results = mariadb_write(table, resultsdf)

            print(results)
def main():

    """
    This executes functions related to HIFLD datasets and processes into dataframe then writes to database
    """

    source = {'comm.am_transmission_towers': 'https://opendata.arcgis.com/datasets/8dc622e0d473417b81494c1ee587df50_0.geojson', 
    'comm.antenna_structure_registrate': 'https://opendata.arcgis.com/datasets/a3c6520e6d7942b0abaf569dd721788b_0.geojson', 
    'comm.broadband_and_educational_broadband_service_transmitters': 'https://opendata.arcgis.com/datasets/e268048c26be47efa63cb15e81a25f4b_0.geojson', 
    'comm.cellular_service_areas': 'https://opendata.arcgis.com/datasets/b01aac4aca194b78aba62404ece987bb_0.geojson', 
    'comm.cellular_towers': 'https://opendata.arcgis.com/datasets/0835ba2ed38f494196c14af8407454fb_0.geojson', 
    'comm.fm_transmission_towers': 'https://opendata.arcgis.com/datasets/fc3838297bb844daadb4bebe714bba78_0.geojson', 
    'comm.land_mobile_broadcast_towers': 'https://opendata.arcgis.com/datasets/ec4d868ea1354fc9a85fe35e7db0cffd_0.geojson',
    'comm.land_mobile_commercial_transmission_towers': 'https://opendata.arcgis.com/datasets/4ec3d6fe24124d7597da4c88dfeae678_0.geojson', 
    'comm.land_mobile_private_transmission_towers': 'https://opendata.arcgis.com/datasets/4797be545f7449b4ab7b52b9e5b52ffc_0.geojson', 
    'comm.microwave_service_towers': 'https://opendata.arcgis.com/datasets/ed7eba3a40264dfea65c282af5d8d3c9_0.geojson', 
    'comm.paging_transmission_towers': 'https://opendata.arcgis.com/datasets/98d19dce5c1b443eaaae3288229e103d_0.geojson', 
    'comm.tv_analog_station_transmitters': 'https://opendata.arcgis.com/datasets/05455bf306ed438f84a398e14cdb6d51_0.geojson', 
    'comm.tv_broadcast_contours': 'https://opendata.arcgis.com/datasets/c648514663b64864843ff6b799fb7e24_0.geojson', 
    'comm.tv_digital_station_transmitters': 'https://opendata.arcgis.com/datasets/2bfd434d9263401eadae464a9c26104f_0.geojson'}

    for table in source:

        if table_exists(table) == True:

            print(f'Table: "{table}" exists')

        else:

            #print(f'Creating Table: {table}')

            resultsdf = hifld_dataframe(source[table])

            #print(resultsdf)
            results = mariadb_write(table, resultsdf)

            print(results)