4

When I load OpenStreetMap data to PostGIS using osm2pgsql the resulting tables look like this:

+----------+--------------------+--------+---------+
| Schema   | Name               | Type   | Owner   |
|----------+--------------------+--------+---------|
| public   | planet_osm_line    | table  | user    |
| public   | planet_osm_nodes   | table  | user    |
| public   | planet_osm_point   | table  | user    |
| public   | planet_osm_polygon | table  | user    |
| public   | planet_osm_rels    | table  | user    |
| public   | planet_osm_roads   | table  | user    |
| public   | planet_osm_ways    | table  | user    |
| public   | spatial_ref_sys    | table  | user    |
+----------+--------------------+--------+---------+

I do not like that the table names start with planet. Is it possible to define how the tables should be named?

1

1 Answer 1

4

You can change the planet part by anything you want using the command line argument --prefix The following command will create tables such as abc_osm_line

osm2pgsql.exe source.osm.pbf --prefix abc [...other parameters as needed..]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.