User:Hbf878/MaperitiveRules

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search
//hilfreiche Befehle:
//use-ruleset location="C:\Downloads\Maperitive\Rules\Rules.mrules"
//set-setting name=map.decoration.attribution value="False"
//set-setting name=map.decoration.grid value="False"
//generate-relief-igor sun-altitude=20 intensity=2.5
//export-svg file=Filename.svg zoom=11 compatibility=Illustrator

features
	points
		place city : place=city
		place town : place=town
		place village : place=village
		place hamlet : place=hamlet
		place suburb : place=suburb
		restaurant : @isOneOf(amenity,pub,fast_food,restaurant,bar)

	points, areas
		//parking : amenity=parking
		railway station : railway=station
		park : leisure=park OR leisure=playground OR landuse=recreation_ground

	lines
		boundary_laender : boundary=administrative AND (admin_level=2 OR admin_level=4) AND NOT natural=coastline
		boundary_country : boundary=administrative AND admin_level=2 AND NOT natural=coastline

		aeroway line runway : aeroway=runway
		aeroway line taxiway : aeroway=taxiway

		railway : railway=rail AND @isFalse(railway:preserved) AND @isFalse(disused) AND NOT service=yard AND @isFalse(noexit) AND NOT railway=light_rail AND NOT service=spur
		rail_disused : (railway=disused OR railway=preserved OR (railway=rail AND @isTrue(railway:preserved))) AND NOT service=spur AND NOT disused:railway=tram AND NOT disused:railway=subway
		rail_dismantled : (railway=abandoned OR railway=dismantled OR railway=razed) AND NOT service=spur AND NOT dismantled:railway=tram
		//OR railway=dismantled OR railway=razed OR railway=abandoned  OR @isTrue(noexit) (railway=rail AND @isTrue(disused)) OR
		light_rail : railway=light_rail AND @isFalse(disused) AND @isFalse(noexit) AND NOT service=yard 
		yard_rail : (service=yard OR service=siding) AND NOT (railway=abandoned OR railway=dismantled OR railway=razed OR railway=tram)
		spur_rail : (service=spur) AND NOT (railway=abandoned OR railway=dismantled OR railway=razed)
		rail_construction : railway=construction
		subway : railway=subway OR construction=subway
	
		motorway : highway=motorway
		motorway link : highway=motorway_link
		//major road : @isOneOf(highway, trunk, trunk_link, primary, primary_link, secondary) 
		major road : @isOneOf(highway, trunk, trunk_link, primary, primary_link) 
		//minor road : @isOneOf(highway, tertiary, unclassified, residential, service, living_street) OR (highway=track AND (@isOneOf(tracktype, grade1, grade2, grade3) OR NOT tracktype))
		path : @isOneOf(highway, path, footway, pedestrian, steps) OR (highway=track AND @isOneOf(tracktype, grade4, grade5))

		water line : waterway=river  
		//waterway=stream OR 

	areas
		water : natural=water OR waterway=riverbank OR waterway=stream OR landuse=reservoir OR landuse=basin OR waterway=canal
		aeroway area : aeroway
		industrial : landuse=industrial OR landuse=commercial
		residential area : landuse=residential OR landuse=retail OR amenity=university
		hospital : amenity=hospital
		//sport : sport
		forest : landuse=forest OR natural=wood OR (natural=wetland AND landuse=meadow)
		meadow: landuse=meadow OR landuse = orchard OR landuse = grass OR landuse=village_green OR natural=grassland
		cemetery : landuse=cemetery
		//farm : landuse = farmland OR landuse = agriculture OR landuse = greenfield OR landuse = farm OR landuse=military OR landuse=brownfield 


properties
	map-background-color	: #f4f4f3
	map-background-opacity	: 1
	map-sea-color : #99B3CC

rules

// lines
	target : boundary_country
		define
			line-color : #b267b0
			line-width : 3.3
			border-style : solid
			border-color : #b267b0
			border-width : 30%
			border-opacity : 0.4
		draw : line
	
	target : boundary*
		define
			line-color : #b267b0
			line-width : 2.6
			border-style : solid
			border-color : #b267b0
			border-width : 30%
			border-opacity : 0.4
		draw : line	

	target : railway
		define
			min-zoom : 6
			max-zoom : 20
			line-style : solid
			border-style : none
			line-color : #7b7b7b
			line-width : 2.9
		//for : tunnel=yes
			//define
				//line-style : dash
		draw : line

	target : rail_disused
		define
			line-style : solid
			border-style : none
			line-color : #7b7b7b
			line-width : 2.4
			line-style : dot
		draw : line
		
	
	target : rail_construction
		define
			line-style : solid
			border-style : none
			line-color : #7b7b7b
			line-width : 1
			line-style : solid
		for : tunnel=yes
			define
				line-style : dot	
		//draw : line
	

	target : rail_dismantled
		define
			line-style : solid
			border-style : none
			line-color : #7b7b7b
			line-width : 2.4
			line-style : dot
		draw : line

	target : light_rail
		define
			line-style : solid
			border-style : none
			line-color : #7b7b7b
			line-width : 2.9
		draw : line		
		
	target : spur_rail
		define
			line-style : solid
			border-style : none
			line-color : #7b7b7b
			line-width : 1.7
		draw : line		
		
	target : subway
		define
			line-style : solid
			border-style : none
			line-color : #9c9c9c
			line-width : 1.2
		draw : line			
		
	target : yard_rail
		define
			line-style : solid
			border-style : none
			line-color : #7b7b7b
			line-width : 1.2
		draw : line			

	target : motorway
		define
			line-width : 8:2;14:3;16:5
			line-color : #ebd894
			border-style : solid
			border-color : #e9af2b
			border-width : 20%
			line-end-cap : round
			line-start-cap : round
		//for : tunnel=yes
		//	define
		//		border-style : dash
		draw : line

	target : motorway link
		define
			line-width : 8:0.7;14:1.5;16:2.5
			min-zoom : 10
			line-color : #ebd894
			border-style : solid
			border-color : #e9af2b
			border-width : 20%
			line-end-cap : round
			line-start-cap : round
		//for : tunnel=yes
		//	define
		//		border-style : dash
		draw : line
		
	target : major road
		define
			min-zoom : 8
			line-color : #fffd8b
			line-width : 10:1;13:1.5;14:2.5;15:3.5;18:5
			border-style : solid
			border-color : #fffd8b black 20%
			border-width : 20%
			line-end-cap : round
			line-start-cap : round
		draw : line	

	target : water line
		define
			min-zoom : 8
			line-color : #A5BFDD
			line-width : 14:0.5;16:2;20:8
		draw : line
		
		
/////////////////////
// landuse

	target : $featuretype(area)
		define
			line-style : none
			line-width : 1
		if : water
			define
				fill-color : #A5BFDD
		elseif : aeroway area
			define
				fill-color : #d1d0cd
		elseif : industrial
			define
				fill-color : #c2bfba
		elseif : residential area
			define
				fill-color : #c2bfba
		elseif : meadow
			define
				fill-color : #ddefdc
		elseif : hospital
			define
				fill-color : #c2bfba
		elseif : park
			define
				fill-color : #C8D8C3
		//elseif : sport
			//define
				//fill-color : #c2bfba
		elseif : cemetery
			define
				fill-color : #C8D8C3
		elseif : forest
			define
				fill-color : #C8D8C3
		//elseif : farm
			//define
				//fill-color : #f2f2f0
		//else
			//define
				//fill-color : #f2f2f0
		draw : fill