Skip to content

Instantly share code, notes, and snippets.

@kimsterv
Created June 8, 2011 22:22
Show Gist options
  • Save kimsterv/1015584 to your computer and use it in GitHub Desktop.
Save kimsterv/1015584 to your computer and use it in GitHub Desktop.
imposm mapping file
# Copyright 2011 Omniscale (http://omniscale.com)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from imposm.mapping import (
Options,
Points, LineStrings, Polygons,
String, Bool, Integer, OneOfInt,
WayZOrder, ZOrder, Direction,
GeneralizedTable, UnionView,
)
# # internal configuration options
# # uncomment to make changes to the default values
# import imposm.config
#
# # import relations with missing rings
# imposm.config.import_partial_relations = False
#
# # select relation builder: union or contains
# imposm.config.relation_builder = 'contains'
#
# # log relation that take longer than x seconds
# imposm.config.imposm_multipolygon_report = 60
#
# # skip relations with more rings (0 skip nothing)
# imposm.config.imposm_multipolygon_max_ring = 0
db_conf = Options(
# db='osm',
host='localhost',
port=5432,
user='osm',
password='osm',
sslmode='allow',
prefix='osm_new_',
proj='epsg:900913',
)
class SGPolygons(Polygons):
buildings = Polygons(
name = 'buildings',
mapping = {
'building': (
'yes',
)}
)
transport_areas = Polygons(
name = 'transport_areas',
mapping = {
'railway': (
'station',
),
'aeroway': (
'aerodome',
'terminal',
'helipad',
'apron',
),
})
places = Polygons(
name = 'places',
mapping = {
'office': (
'__any__'),
'shop': (
'__any__'),
'tourism': (
'__any__'),
'historic': (
'__any__'),
'military': (
'__any__'),
'place': (
'__any__'),
})
landusages = Polygons(
name = 'landusages',
fields = (
('z_order', ZOrder([
'pedestrian',
'footway',
'playground',
'park',
'forest',
'cemetery',
'farmyard',
'farm',
'farmland',
'wood',
'meadow',
'grass',
'village_green',
'recreation_ground',
'garden',
'sports_centre',
'pitch',
'common',
'allotments',
'golf_course',
'university',
'school',
'college',
'library',
'fuel',
'parking',
'nature_reserve',
'cinema',
'theatre',
'place_of_worship',
'hospital',
'scrub',
'quarry',
'residential',
'retail',
'commercial',
'industrial',
'railway',
'land',
])),
),
mapping = {
'landuse': (
'__any__',
),
'leisure': (
'__any__',
),
'natural': (
'bay',
'beach',
'cave_entrance',
'fell',
'glacier',
'heath',
'land',
'mud',
'sand',
'scree',
'scrub',
'water',
'wetland',
'wood',
),
'amenity': (
'__any__',
),
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment