2023-05-13 20:57:58 +01:00
|
|
|
"""Planet tables."""
|
|
|
|
|
2021-07-22 13:47:38 +01:00
|
|
|
from geoalchemy2 import Geometry
|
2023-05-13 20:57:58 +01:00
|
|
|
from sqlalchemy import Column, Float, Integer, MetaData, String, Table
|
|
|
|
from sqlalchemy.dialects import postgresql
|
2021-07-22 13:47:38 +01:00
|
|
|
|
|
|
|
metadata = MetaData()
|
|
|
|
|
2023-05-13 20:57:58 +01:00
|
|
|
point = Table(
|
|
|
|
"planet_osm_point",
|
|
|
|
metadata,
|
2021-07-22 13:47:38 +01:00
|
|
|
Column("osm_id", Integer),
|
|
|
|
Column("name", String),
|
|
|
|
Column("tags", postgresql.HSTORE),
|
|
|
|
Column("way", Geometry("GEOMETRY", srid=4326, spatial_index=True), nullable=False),
|
|
|
|
)
|
|
|
|
|
2023-05-13 20:57:58 +01:00
|
|
|
line = Table(
|
|
|
|
"planet_osm_line",
|
|
|
|
metadata,
|
2021-07-22 13:47:38 +01:00
|
|
|
Column("osm_id", Integer),
|
|
|
|
Column("name", String),
|
|
|
|
Column("tags", postgresql.HSTORE),
|
|
|
|
Column("way", Geometry("GEOMETRY", srid=4326, spatial_index=True), nullable=False),
|
|
|
|
)
|
|
|
|
|
2023-05-13 20:57:58 +01:00
|
|
|
polygon = Table(
|
|
|
|
"planet_osm_polygon",
|
|
|
|
metadata,
|
2021-07-22 13:47:38 +01:00
|
|
|
Column("osm_id", Integer),
|
|
|
|
Column("name", String),
|
|
|
|
Column("tags", postgresql.HSTORE),
|
|
|
|
Column("way", Geometry("GEOMETRY", srid=4326, spatial_index=True), nullable=False),
|
|
|
|
Column("way_area", Float),
|
|
|
|
)
|