@@ -1394,6 +1394,7 @@ def get_field_measurements(
13941394
13951395 return get_ogc_data (args , output_id , service )
13961396
1397+
13971398def get_reference_table (
13981399 collection : str ,
13991400 limit : Optional [int ] = None ,
@@ -1426,29 +1427,19 @@ def get_reference_table(
14261427 f"Valid options are: { valid_code_services } ."
14271428 )
14281429
1429- req = _construct_api_requests (
1430- service = collection ,
1431- limit = limit ,
1432- skip_geometry = True ,
1433- )
1434- # Run API request and iterate through pages if needed
1435- return_list , response = _walk_pages (
1436- geopd = False , req = req
1437- )
1438-
1439- # Give ID column a more meaningful name
1440- if collection .endswith ("s" ):
1441- return_list = return_list .rename (
1442- columns = {"id" : f"{ collection [:- 1 ].replace ('-' , '_' )} _id" }
1443- )
1430+ # Give ID column the collection name with underscores
1431+ if collection .endswith ("s" ) and collection != "counties" :
1432+ output_id = f"{ collection [:- 1 ].replace ('-' , '_' )} "
1433+ elif collection == "counties" :
1434+ output_id = "county"
14441435 else :
1445- return_list = return_list . rename (
1446- columns = { "id" : f" { collection . replace ( '-' , '_' ) } _id" }
1447- )
1448-
1449- # Create metadata object from response
1450- metadata = BaseMetadata ( response )
1451- return return_list , metadata
1436+ output_id = f" { collection . replace ( '-' , '_' ) } "
1437+
1438+ return get_ogc_data (
1439+ args = {},
1440+ output_id = output_id ,
1441+ service = collection
1442+ )
14521443
14531444
14541445def get_codes (code_service : CODE_SERVICES ) -> pd .DataFrame :
0 commit comments