-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unified value tags #217
Comments
you can ask questions in the community mailing list: https://groups.google.com/forum/#!forum/imposm
my2c/imho:
example mapping file for creating tables:
# osm_green table definition:
green:
columns:
- name: osm_id
type: id
- name: geometry
type: geometry
mapping:
landuse:
- park
- forest
- grass
- wood
leisure:
- park
- nature_reserve
natural:
- wood
type: polygon
# osm_blue table definition:
blue:
columns:
- name: osm_id
type: id
- name: geometry
type: geometry
mapping:
natural:
- water
waterway:
- riverbank
type: polygon and if you need a single view ( create view osm_colors as
select 'green'::text as color , * from osm_green
union all select 'blue'::text as color , * from osm_blue
; test: appx=# select color , count(*) as _cnt
appx-# from osm_colors
appx-# group by 1;
color | _cnt
-------+------
green | 2374
blue | 132
(2 rows)
appx=# \d+ osm_colors
View "public.osm_colors"
Column | Type | Collation | Nullable | Default | Storage | Description
----------+-------------------------+-----------+----------+---------+----------+-------------
color | text | | | | extended |
id | integer | | | | plain |
osm_id | bigint | | | | plain |
geometry | geometry(Geometry,4326) | | | | main |
View definition:
SELECT 'green'::text AS color,
osm_green.id,
osm_green.osm_id,
osm_green.geometry
FROM osm_green
UNION ALL
SELECT 'blue'::text AS color,
osm_blue.id,
osm_blue.osm_id,
osm_blue.geometry
FROM osm_blue;
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi
I want to import data something like this.
All values from tags like garden,park,grass and ... replaced with a word. for example: "green"
Is this possible?
The text was updated successfully, but these errors were encountered: