add simple poi_polygon table ; fix #46
This commit is contained in:
parent
e5b9921593
commit
b173b2acd2
@ -9,10 +9,19 @@ RETURNS TABLE(osm_id bigint, geometry geometry, name text, name_en text, class t
|
|||||||
PARTITION BY LabelGrid(geometry, 100 * pixel_width)
|
PARTITION BY LabelGrid(geometry, 100 * pixel_width)
|
||||||
ORDER BY poi_class_rank(poi_class(subclass)) ASC, length(name) DESC
|
ORDER BY poi_class_rank(poi_class(subclass)) ASC, length(name) DESC
|
||||||
)::int AS "rank"
|
)::int AS "rank"
|
||||||
|
FROM (
|
||||||
-- etldoc: osm_poi_point -> layer_poi:z14_
|
-- etldoc: osm_poi_point -> layer_poi:z14_
|
||||||
FROM osm_poi_point
|
SELECT * FROM osm_poi_point
|
||||||
WHERE geometry && bbox
|
WHERE geometry && bbox
|
||||||
AND zoom_level >= 14
|
AND zoom_level >= 14
|
||||||
AND name <> ''
|
AND name <> ''
|
||||||
ORDER BY "rank";
|
UNION ALL
|
||||||
|
-- etldoc: osm_poi_polygon -> layer_poi:z14_
|
||||||
|
SELECT * FROM osm_poi_polygon
|
||||||
|
WHERE geometry && bbox
|
||||||
|
AND zoom_level >= 14
|
||||||
|
AND name <> ''
|
||||||
|
) as poi_union
|
||||||
|
ORDER BY "rank"
|
||||||
|
;
|
||||||
$$ LANGUAGE SQL IMMUTABLE;
|
$$ LANGUAGE SQL IMMUTABLE;
|
||||||
|
|||||||
@ -282,3 +282,289 @@ tables:
|
|||||||
- dock
|
- dock
|
||||||
aerialway:
|
aerialway:
|
||||||
- station
|
- station
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# etldoc: imposm3 -> osm_poi_polygon
|
||||||
|
poi_polygon:
|
||||||
|
type: polygon
|
||||||
|
fields:
|
||||||
|
- name: osm_id
|
||||||
|
type: id
|
||||||
|
- name: geometry
|
||||||
|
type: geometry
|
||||||
|
- name: name
|
||||||
|
key: name
|
||||||
|
type: string
|
||||||
|
- name: name_en
|
||||||
|
key: name:en
|
||||||
|
type: string
|
||||||
|
- name: subclass
|
||||||
|
type: mapping_value
|
||||||
|
mapping:
|
||||||
|
amenity:
|
||||||
|
- arts_centre
|
||||||
|
- bank
|
||||||
|
- bar
|
||||||
|
- bbq
|
||||||
|
- bicycle_rental
|
||||||
|
- biergarten
|
||||||
|
- bus_station
|
||||||
|
- cafe
|
||||||
|
- cinema
|
||||||
|
- college
|
||||||
|
- community_centre
|
||||||
|
- courthouse
|
||||||
|
- dentist
|
||||||
|
- doctors
|
||||||
|
- embassy
|
||||||
|
- fast_food
|
||||||
|
- ferry_terminal
|
||||||
|
- fire_station
|
||||||
|
- food_court
|
||||||
|
- fuel
|
||||||
|
- grave_yard
|
||||||
|
- hospital
|
||||||
|
- kindergarten
|
||||||
|
- library
|
||||||
|
- marketplace
|
||||||
|
- nightclub
|
||||||
|
- nursing_home
|
||||||
|
- pharmacy
|
||||||
|
- place_of_worship
|
||||||
|
- police
|
||||||
|
- post_box
|
||||||
|
- post_office
|
||||||
|
- prison
|
||||||
|
- pub
|
||||||
|
- public_building
|
||||||
|
- recycling
|
||||||
|
- restaurant
|
||||||
|
- school
|
||||||
|
- shelter
|
||||||
|
- swimming_pool
|
||||||
|
- taxi
|
||||||
|
- telephone
|
||||||
|
- theatre
|
||||||
|
- toilets
|
||||||
|
- townhall
|
||||||
|
- university
|
||||||
|
- veterinary
|
||||||
|
- waste_basket
|
||||||
|
leisure:
|
||||||
|
- dog_park
|
||||||
|
- garden
|
||||||
|
- golf_course
|
||||||
|
- ice_rink
|
||||||
|
- marina
|
||||||
|
- miniature_golf
|
||||||
|
- park
|
||||||
|
- pitch
|
||||||
|
- playground
|
||||||
|
- sports_centre
|
||||||
|
- stadium
|
||||||
|
- swimming_area
|
||||||
|
- swimming_pool
|
||||||
|
- water_park
|
||||||
|
landuse:
|
||||||
|
- basin
|
||||||
|
- brownfield
|
||||||
|
- cemetery
|
||||||
|
- reservoir
|
||||||
|
sport:
|
||||||
|
- american_football
|
||||||
|
- archery
|
||||||
|
- athletics
|
||||||
|
- australian_football
|
||||||
|
- badminton
|
||||||
|
- baseball
|
||||||
|
- basketball
|
||||||
|
- beachvolleyball
|
||||||
|
- billiards
|
||||||
|
- bmx
|
||||||
|
- boules
|
||||||
|
- bowls
|
||||||
|
- boxing
|
||||||
|
- canadian_football
|
||||||
|
- canoe
|
||||||
|
- chess
|
||||||
|
- climbing
|
||||||
|
- climbing_adventure
|
||||||
|
- cricket
|
||||||
|
- cricket_nets
|
||||||
|
- croquet
|
||||||
|
- curling
|
||||||
|
- cycling
|
||||||
|
- disc_golf
|
||||||
|
- diving
|
||||||
|
- dog_racing
|
||||||
|
- equestrian
|
||||||
|
- fatsal
|
||||||
|
- field_hockey
|
||||||
|
- free_flying
|
||||||
|
- gaelic_games
|
||||||
|
- golf
|
||||||
|
- gymnastics
|
||||||
|
- handball
|
||||||
|
- hockey
|
||||||
|
- horse_racing
|
||||||
|
- horseshoes
|
||||||
|
- ice_hockey
|
||||||
|
- ice_stock
|
||||||
|
- judo
|
||||||
|
- karting
|
||||||
|
- korfball
|
||||||
|
- long_jump
|
||||||
|
- model_aerodrome
|
||||||
|
- motocross
|
||||||
|
- motor
|
||||||
|
- multi
|
||||||
|
- netball
|
||||||
|
- orienteering
|
||||||
|
- paddle_tennis
|
||||||
|
- paintball
|
||||||
|
- paragliding
|
||||||
|
- pelota
|
||||||
|
- racquet
|
||||||
|
- rc_car
|
||||||
|
- rowing
|
||||||
|
- rugby
|
||||||
|
- rugby_league
|
||||||
|
- rugby_union
|
||||||
|
- running
|
||||||
|
- sailing
|
||||||
|
- scuba_diving
|
||||||
|
- shooting
|
||||||
|
- shooting_range
|
||||||
|
- skateboard
|
||||||
|
- skating
|
||||||
|
- skiing
|
||||||
|
- soccer
|
||||||
|
- surfing
|
||||||
|
- swimming
|
||||||
|
- table_soccer
|
||||||
|
- table_tennis
|
||||||
|
- team_handball
|
||||||
|
- tennis
|
||||||
|
- toboggan
|
||||||
|
- volleyball
|
||||||
|
- water_ski
|
||||||
|
- yoga
|
||||||
|
tourism:
|
||||||
|
- alpine_hut
|
||||||
|
- artwork
|
||||||
|
- attraction
|
||||||
|
- bed_and_breakfast
|
||||||
|
- camp_site
|
||||||
|
- caravan_site
|
||||||
|
- chalet
|
||||||
|
- gallery
|
||||||
|
- guest_house
|
||||||
|
- hostel
|
||||||
|
- hotel
|
||||||
|
- information
|
||||||
|
- motel
|
||||||
|
- museum
|
||||||
|
- picnic_site
|
||||||
|
- theme_park
|
||||||
|
- viewpoint
|
||||||
|
- zoo
|
||||||
|
shop:
|
||||||
|
- accessories
|
||||||
|
- alcohol
|
||||||
|
- antiques
|
||||||
|
- art
|
||||||
|
- bag
|
||||||
|
- bakery
|
||||||
|
- beauty
|
||||||
|
- bed
|
||||||
|
- beverages
|
||||||
|
- bicycle
|
||||||
|
- books
|
||||||
|
- boutique
|
||||||
|
- butcher
|
||||||
|
- camera
|
||||||
|
- car
|
||||||
|
- car_repair
|
||||||
|
- carpet
|
||||||
|
- charity
|
||||||
|
- chemist
|
||||||
|
- chocolate
|
||||||
|
- clothes
|
||||||
|
- coffee
|
||||||
|
- computer
|
||||||
|
- confectionery
|
||||||
|
- convenience
|
||||||
|
- copyshop
|
||||||
|
- cosmetics
|
||||||
|
- deli
|
||||||
|
- delicatessen
|
||||||
|
- department_store
|
||||||
|
- doityourself
|
||||||
|
- dry_cleaning
|
||||||
|
- electronics
|
||||||
|
- erotic
|
||||||
|
- fabric
|
||||||
|
- florist
|
||||||
|
- furniture
|
||||||
|
- garden_centre
|
||||||
|
- general
|
||||||
|
- gift
|
||||||
|
- greengrocer
|
||||||
|
- hairdresser
|
||||||
|
- hardware
|
||||||
|
- hearing_aids
|
||||||
|
- hifi
|
||||||
|
- ice_cream
|
||||||
|
- interior_decoration
|
||||||
|
- jewelry
|
||||||
|
- kiosk
|
||||||
|
- lamps
|
||||||
|
- laundry
|
||||||
|
- mall
|
||||||
|
- massage
|
||||||
|
- mobile_phone
|
||||||
|
- motorcycle
|
||||||
|
- music
|
||||||
|
- musical_instrument
|
||||||
|
- newsagent
|
||||||
|
- optician
|
||||||
|
- outdoor
|
||||||
|
- perfume
|
||||||
|
- perfumery
|
||||||
|
- pet
|
||||||
|
- photo
|
||||||
|
- second_hand
|
||||||
|
- shoes
|
||||||
|
- sports
|
||||||
|
- stationery
|
||||||
|
- supermarket
|
||||||
|
- tailor
|
||||||
|
- tattoo
|
||||||
|
- ticket
|
||||||
|
- tobacco
|
||||||
|
- toys
|
||||||
|
- travel_agency
|
||||||
|
- video
|
||||||
|
- video_games
|
||||||
|
- watches
|
||||||
|
- weapons
|
||||||
|
- wholesale
|
||||||
|
- wine
|
||||||
|
highway:
|
||||||
|
- bus_stop
|
||||||
|
barrier:
|
||||||
|
- bollard
|
||||||
|
- border_control
|
||||||
|
- cycle_barrier
|
||||||
|
- gate
|
||||||
|
- lift_gate
|
||||||
|
- sally_port
|
||||||
|
- stile
|
||||||
|
- toll_booth
|
||||||
|
historic:
|
||||||
|
- monument
|
||||||
|
waterway:
|
||||||
|
- dock
|
||||||
|
aerialway:
|
||||||
|
- station
|
||||||
@ -32,6 +32,7 @@ layer:
|
|||||||
srid: 900913
|
srid: 900913
|
||||||
query: (SELECT geometry, name, name_en, class, subclass, rank FROM layer_poi(!bbox!, z(!scale_denominator!), !pixel_width!)) AS t
|
query: (SELECT geometry, name, name_en, class, subclass, rank FROM layer_poi(!bbox!, z(!scale_denominator!), !pixel_width!)) AS t
|
||||||
schema:
|
schema:
|
||||||
|
- ./poi_polygon_update.sql
|
||||||
- ./class.sql
|
- ./class.sql
|
||||||
- ./layer.sql
|
- ./layer.sql
|
||||||
datasources:
|
datasources:
|
||||||
|
|||||||
5
layers/poi/poi_polygon_update.sql
Normal file
5
layers/poi/poi_polygon_update.sql
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
-- etldoc: osm_poi_polygon -> osm_poi_polygon
|
||||||
|
UPDATE osm_poi_polygon SET geometry=topoint(geometry)
|
||||||
|
WHERE ST_GeometryType(geometry) <> 'ST_Point';
|
||||||
|
|
||||||
|
ANALYZE osm_poi_polygon;
|
||||||
Loading…
x
Reference in New Issue
Block a user