PostgresOSM.get_table_name_for_subregion¶
-
PostgresOSM.
get_table_name_for_subregion
(subregion_name, table_named_as_subregion=False)¶ Get the default table name for a specific geographic region.
- Parameters
subregion_name (str) – name of a geographic region, which acts as a table name
table_named_as_subregion (bool) – whether to use subregion name as table name, defaults to
False
- Returns
default table name for storing the subregion data into the database
- Return type
str
Examples:
>>> from pydriosm.ios import PostgresOSM >>> osmdb_test = PostgresOSM(database_name='osmdb_test') Password (postgres@localhost:5432): *** Connecting postgres:***@localhost:5432/osmdb_test ... Successfully. >>> region_name = 'London' >>> tbl_name = osmdb_test.get_table_name_for_subregion(region_name) >>> print(tbl_name) London >>> use_region_name = True >>> tbl_name = osmdb_test.get_table_name_for_subregion(region_name, use_region_name) >>> print(tbl_name) Greater London
Note
In the examples above, the default data source is ‘Geofabrik’. Changing it to ‘BBBike’, the function may possibly produce a different output for the same input, as a geographic region that is included in one data source may not always be available from the other.