Merge branch 'master' into moderation

This commit is contained in:
Andy Allan 2018-02-28 15:55:28 +08:00
commit a20e28809f
14 changed files with 119 additions and 130 deletions

View file

@ -1,7 +1,7 @@
source "https://rubygems.org"
# Require rails
gem "rails", "5.1.4"
gem "rails", "5.1.5"
# Require things which have moved to gems in ruby 1.9
gem "bigdecimal", "~> 1.1.0", :platforms => :ruby_19

View file

@ -3,41 +3,41 @@ GEM
specs:
SystemTimer (1.2.3)
aasm (4.1.0)
actioncable (5.1.4)
actionpack (= 5.1.4)
actioncable (5.1.5)
actionpack (= 5.1.5)
nio4r (~> 2.0)
websocket-driver (~> 0.6.1)
actionmailer (5.1.4)
actionpack (= 5.1.4)
actionview (= 5.1.4)
activejob (= 5.1.4)
actionmailer (5.1.5)
actionpack (= 5.1.5)
actionview (= 5.1.5)
activejob (= 5.1.5)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (5.1.4)
actionview (= 5.1.4)
activesupport (= 5.1.4)
actionpack (5.1.5)
actionview (= 5.1.5)
activesupport (= 5.1.5)
rack (~> 2.0)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
actionpack-page_caching (1.1.0)
actionpack (>= 4.0.0, < 6)
actionview (5.1.4)
activesupport (= 5.1.4)
actionview (5.1.5)
activesupport (= 5.1.5)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activejob (5.1.4)
activesupport (= 5.1.4)
activejob (5.1.5)
activesupport (= 5.1.5)
globalid (>= 0.3.6)
activemodel (5.1.4)
activesupport (= 5.1.4)
activerecord (5.1.4)
activemodel (= 5.1.4)
activesupport (= 5.1.4)
activemodel (5.1.5)
activesupport (= 5.1.5)
activerecord (5.1.5)
activemodel (= 5.1.5)
activesupport (= 5.1.5)
arel (~> 8.0)
activesupport (5.1.4)
activesupport (5.1.5)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
@ -73,8 +73,8 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
composite_primary_keys (10.0.2)
activerecord (~> 5.1.0, >= 5.1.4)
composite_primary_keys (10.0.3)
activerecord (~> 5.1.0, >= 5.1.5)
concurrent-ruby (1.0.5)
coveralls (0.8.21)
json (>= 1.8, < 3)
@ -98,7 +98,7 @@ GEM
railties (>= 3.0.0)
faraday (0.12.2)
multipart-post (>= 1.2, < 3)
ffi (1.9.21)
ffi (1.9.23)
fspath (3.1.0)
geoip (1.6.3)
globalid (0.4.1)
@ -218,8 +218,8 @@ GEM
mime-types
mimemagic (~> 0.3.0)
parallel (1.12.1)
parser (2.4.0.2)
ast (~> 2.3)
parser (2.5.0.2)
ast (~> 2.4.0)
pg (0.21.0)
poltergeist (1.17.0)
capybara (~> 2.1)
@ -239,17 +239,17 @@ GEM
rack-test (0.8.2)
rack (>= 1.0, < 3)
rack-uri_sanitizer (0.0.2)
rails (5.1.4)
actioncable (= 5.1.4)
actionmailer (= 5.1.4)
actionpack (= 5.1.4)
actionview (= 5.1.4)
activejob (= 5.1.4)
activemodel (= 5.1.4)
activerecord (= 5.1.4)
activesupport (= 5.1.4)
rails (5.1.5)
actioncable (= 5.1.5)
actionmailer (= 5.1.5)
actionpack (= 5.1.5)
actionview (= 5.1.5)
activejob (= 5.1.5)
activemodel (= 5.1.5)
activerecord (= 5.1.5)
activesupport (= 5.1.5)
bundler (>= 1.3.0)
railties (= 5.1.4)
railties (= 5.1.5)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.2)
actionpack (~> 5.x, >= 5.0.1)
@ -263,9 +263,9 @@ GEM
rails-i18n (4.0.2)
i18n (~> 0.6)
rails (>= 4.0)
railties (5.1.4)
actionpack (= 5.1.4)
activesupport (= 5.1.4)
railties (5.1.5)
actionpack (= 5.1.5)
activesupport (= 5.1.5)
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
@ -400,7 +400,7 @@ DEPENDENCIES
r2 (~> 0.2.7)
rack-cors
rack-uri_sanitizer
rails (= 5.1.4)
rails (= 5.1.5)
rails-controller-testing
rails-i18n (~> 4.0.0)
record_tag_helper

View file

@ -117,19 +117,14 @@ function OSRMEngine() {
instText += I18n.t(template + '_without_exit', { name: name } );
}
} else if (step.maneuver.type.match(/on ramp|off ramp/)) {
if (step.destinations) {
if (namedRoad) {
instText += I18n.t(template + '_with_name_and_directions', { name: name, directions: destinations } );
} else {
instText += I18n.t(template + '_with_directions', { directions: destinations } );
}
} else {
if (namedRoad) {
instText += I18n.t(template + '_without_exit', { name: name });
} else {
instText += I18n.t(template + '_without_directions');
}
var params = {};
if (step.exits && step.maneuver.type.match(/off ramp/)) params.exit = step.exits;
if (step.destinations) params.directions = destinations;
if (namedRoad) params.directions = name;
if (Object.keys(params).length > 0) {
template = template + "_with_" + Object.keys(params).join("_");
}
instText += I18n.t(template, params);
} else {
instText += I18n.t(template + '_without_exit', { name: name });
}

View file

@ -38,7 +38,7 @@ textarea,
body { font: #{$typeheight}/#{$lineheight} "Helvetica Neue",Arial,sans-serif; }
abbr, acronym {
border-bottom: .1em dotted;
text-decoration: underline dotted;
cursor: help;
}

View file

@ -19,7 +19,6 @@ class GeocoderController < ApplicationController
if @params[:query] =~ /^\d{5}(-\d{4})?$/
@sources.push "osm_nominatim"
elsif @params[:query] =~ /^(GIR 0AA|[A-PR-UWYZ]([0-9]{1,2}|([A-HK-Y][0-9]|[A-HK-Y][0-9]([0-9]|[ABEHMNPRV-Y]))|[0-9][A-HJKS-UW])\s*[0-9][ABD-HJLNP-UW-Z]{2})$/i
@sources.push "uk_postcode"
@sources.push "osm_nominatim"
elsif @params[:query] =~ /^[A-Z]\d[A-Z]\s*\d[A-Z]\d$/i
@sources.push "ca_postcode"
@ -55,32 +54,6 @@ class GeocoderController < ApplicationController
end
end
def search_uk_postcode
# get query parameters
query = params[:query]
# create result array
@results = []
# ask npemap.org.uk to do a combined npemap + freethepostcode search
response = fetch_text("http://www.npemap.org.uk/cgi/geocoder.fcgi?format=text&postcode=#{escape_query(query)}")
# parse the response
unless response =~ /Error/
dataline = response.split(/\n/)[1]
data = dataline.split(/,/) # easting,northing,postcode,lat,long
postcode = data[2].delete("'")
zoom = POSTCODE_ZOOM - postcode.count("#")
@results.push(:lat => data[3], :lon => data[4], :zoom => zoom,
:name => postcode)
end
render :action => "results"
rescue StandardError => ex
@error = "Error contacting www.npemap.org.uk: #{ex}"
render :action => "error"
end
def search_ca_postcode
# get query parameters
query = params[:query]

View file

@ -26,6 +26,8 @@ class DiaryComment < ActiveRecord::Base
belongs_to :user
belongs_to :diary_entry
scope :visible, -> { where(:visible => true) }
validates :body, :presence => true
validates :diary_entry, :user, :associated => true

View file

@ -267,8 +267,8 @@ class User < ActiveRecord::Base
def spam_score
changeset_score = changesets.size * 50
trace_score = traces.size * 50
diary_entry_score = diary_entries.inject(0) { |acc, elem| acc + elem.body.spam_score }
diary_comment_score = diary_comments.inject(0) { |acc, elem| acc + elem.body.spam_score }
diary_entry_score = diary_entries.visible.inject(0) { |acc, elem| acc + elem.body.spam_score }
diary_comment_score = diary_comments.visible.inject(0) { |acc, elem| acc + elem.body.spam_score }
score = description.spam_score / 4.0
score += diary_entries.where("created_at > ?", 1.day.ago).count * 10

View file

@ -371,7 +371,6 @@ en:
search:
title:
latlon: 'Results from <a href="https://openstreetmap.org/">Internal</a>'
uk_postcode: 'Results from <a href="http://www.npemap.org.uk/">NPEMap / FreeThe Postcode</a>'
ca_postcode: 'Results from <a href="https://geocoder.ca/">Geocoder.CA</a>'
osm_nominatim: 'Results from <a href="https://nominatim.openstreetmap.org/">OpenStreetMap Nominatim</a>'
geonames: 'Results from <a href="http://www.geonames.org/">GeoNames</a>'
@ -1765,7 +1764,7 @@ en:
public_traces: "Public GPS traces"
your_traces: "Your GPS traces"
public_traces_from: "Public GPS traces from %{user}"
description: "Browse recent GPS track uploads"
description: "Browse recent GPS trace uploads"
tagged_with: " tagged with %{tags}"
empty_html: "Nothing here yet. <a href='%{upload_link}'>Upload a new trace</a> or learn more about GPS tracing on the <a href='https://wiki.openstreetmap.org/wiki/Beginners_Guide_1.2'>wiki page</a>."
delete:
@ -2437,13 +2436,17 @@ en:
instructions:
continue_without_exit: Continue on %{name}
slight_right_without_exit: Slight right onto %{name}
offramp_right_without_exit: Take the ramp on the right onto %{name}
offramp_right: Take the ramp on the right
offramp_right_with_exit: Take exit %{exit} on the right
offramp_right_with_exit_name: Take exit %{exit} on the right onto %{name}
offramp_right_with_exit_directions: Take exit %{exit} on the right towards %{directions}
offramp_right_with_exit_name_directions: Take exit %{exit} on the right onto %{name}, towards %{directions}
offramp_right_with_name: Take the ramp on the right onto %{name}
offramp_right_with_directions: Take the ramp on the right towards %{directions}
offramp_right_with_name_and_directions: Take the ramp on the right onto %{name}, towards %{directions}
offramp_right_without_directions: Take the ramp on the right
offramp_right_with_name_directions: Take the ramp on the right onto %{name}, towards %{directions}
onramp_right_without_exit: Turn right on the ramp onto %{name}
onramp_right_with_directions: Turn right onto the ramp towards %{directions}
onramp_right_with_name_and_directions: Turn right on the ramp onto %{name}, towards %{directions}
onramp_right_with_name_directions: Turn right on the ramp onto %{name}, towards %{directions}
onramp_right_without_directions: Turn right onto the ramp
endofroad_right_without_exit: At the end of the road turn right onto %{name}
merge_right_without_exit: Merge right onto %{name}
@ -2453,13 +2456,17 @@ en:
uturn_without_exit: U-turn along %{name}
sharp_left_without_exit: Sharp left onto %{name}
turn_left_without_exit: Turn left onto %{name}
offramp_left_without_exit: Take the ramp on the left onto %{name}
offramp_left: Take the ramp on the left
offramp_left_with_exit: Take exit %{exit} on the left
offramp_left_with_exit_name: Take exit %{exit} on the left onto %{name}
offramp_left_with_exit_directions: Take exit %{exit} on the left towards %{directions}
offramp_left_with_exit_name_directions: Take exit %{exit} on the left onto %{name}, towards %{directions}
offramp_left_with_name: Take the ramp on the left onto %{name}
offramp_left_with_directions: Take the ramp on the left towards %{directions}
offramp_left_with_name_and_directions: Take the ramp on the left onto %{name}, towards %{directions}
offramp_left_without_directions: Take the ramp on the left
offramp_left_with_name_directions: Take the ramp on the left onto %{name}, towards %{directions}
onramp_left_without_exit: Turn left on the ramp onto %{name}
onramp_left_with_directions: Turn left onto the ramp towards %{directions}
onramp_left_with_name_and_directions: Turn left on the ramp onto %{name}, towards %{directions}
onramp_left_with_name_directions: Turn left on the ramp onto %{name}, towards %{directions}
onramp_left_without_directions: Turn left onto the ramp
endofroad_left_without_exit: At the end of the road turn left onto %{name}
merge_left_without_exit: Merge left onto %{name}

File diff suppressed because one or more lines are too long

View file

@ -246,7 +246,6 @@ OpenStreetMap::Application.routes.draw do
# geocoder
match "/search" => "geocoder#search", :via => :get, :as => :search
match "/geocoder/search_latlon" => "geocoder#search_latlon", :via => :get
match "/geocoder/search_uk_postcode" => "geocoder#search_uk_postcode", :via => :get
match "/geocoder/search_ca_postcode" => "geocoder#search_ca_postcode", :via => :get
match "/geocoder/search_osm_nominatim" => "geocoder#search_osm_nominatim", :via => :get
match "/geocoder/search_geonames" => "geocoder#search_geonames", :via => :get

View file

@ -2630,6 +2630,7 @@ de:
segregated: DE:Key:segregated
self_service: DE:Key:self service
service: DE:Key:service
service:bicycle:repair: DE:Key:service:bicycle:repair
service_times: DE:Key:service times
shelter: DE:Key:shelter
shelter_type: DE:Key:shelter type
@ -2834,6 +2835,7 @@ de:
amenity=prison: DE:Tag:amenity=prison
amenity=prison_camp: DE:Tag:amenity=prison camp
amenity=pub: DE:Tag:amenity=pub
amenity=public_bath: DE:Tag:amenity=public bath
amenity=public_bookcase: DE:Tag:amenity=public bookcase
amenity=ranger_station: DE:Tag:amenity=ranger station
amenity=recycling: DE:Tag:amenity=recycling
@ -3822,6 +3824,7 @@ de:
tunnel=culvert: DE:Tag:tunnel=culvert
vending=animal_feed: DE:Tag:vending=animal feed
vending=bicycle_tube: DE:Tag:vending=bicycle tube
vending=bottle_return: DE:Tag:vending=bottle return
vending=bread: DE:Tag:vending=bread
vending=candles: DE:Tag:vending=candles
vending=chewing_gums: DE:Tag:vending=chewing gums
@ -4162,6 +4165,7 @@ en:
centre_turn_lane: Key:centre turn lane
cep: Key:cep
change: Key:change
changesets_count: Key:changesets count
charge: Key:charge
charity: Key:charity
check_date: Key:check date
@ -4564,6 +4568,7 @@ en:
inscription: Key:inscription
inscription:url: Key:inscription:url
int_name: Key:int name
int_name:ar: Key:int name:ar
int_ref: Key:int ref
int_ref:ar: Key:int ref:ar
intermittent: Key:intermittent
@ -4654,8 +4659,10 @@ en:
living_street: Key:living street
loading_gauge: Key:loading gauge
loc_name: Key:loc name
loc_name:ar: Key:loc name:ar
loc_ref: Key:loc ref
local_ref: Key:local ref
locale: Key:locale
location: Key:location
lock: Key:lock
lock_name: Key:lock name
@ -4757,6 +4764,7 @@ en:
mtb_scale: Key:mtb scale
museum: Key:museum
museum_type: Key:museum type
musical_instrument: Key:musical instrument
name: Key:name
name:ar: Key:name:ar
name:be: Key:name:be
@ -4796,6 +4804,7 @@ en:
name:ko_rm: Key:name:ko rm
name:ku: Key:name:ku
name:left: Key:name:left
name:left:ar: Key:name:left:ar
name:left:fr: Key:name:left:fr
name:lg: Key:name:lg
name:mg: Key:name:mg
@ -4812,6 +4821,7 @@ en:
name:pronunciation: Key:name:pronunciation
name:pt: Key:name:pt
name:right: Key:name:right
name:right:ar: Key:name:right:ar
name:ru: Key:name:ru
name:ru:word_stress: Key:name:ru:word stress
name:sc: Key:name:sc
@ -4831,6 +4841,7 @@ en:
name_1: Key:name 1
narrow: Key:narrow
nat_name: Key:nat name
nat_name:ar: Key:nat name:ar
nat_ref: Key:nat ref
natural: Key:natural
naturbase: Key:naturbase
@ -4876,6 +4887,7 @@ en:
official_ref: Key:official ref
offshore: Key:offshore
ois:fixme: Key:ois:fixme
old_name: Key:old name
old_name:ar: Key:old name:ar
old_name:etymology:wikidata: Key:old name:etymology:wikidata
old_railway_operator: Key:old railway operator
@ -5136,6 +5148,7 @@ en:
reference: Key:reference
reference_point: Key:reference point
reg_name: Key:reg name
reg_name:ar: Key:reg name:ar
reg_ref: Key:reg ref
regelbau: Key:regelbau
religion: Key:religion
@ -5313,6 +5326,7 @@ en:
social_facility:for: Key:social facility:for
socket: Key:socket
sorting_name: Key:sorting name
sorting_name:ar: Key:sorting name:ar
source: Key:source
source:ProRail: Key:source:ProRail
source:addr: Key:source:addr
@ -5478,6 +5492,7 @@ en:
url: Key:url
url:restrictions: Key:url:restrictions
usage: Key:usage
user_defined_other: Key:user defined other
utahagrc:parcelid: Key:utahagrc:parcelid
validate:no_name: Key:validate:no name
validate:no_ref: Key:validate:no ref
@ -5793,6 +5808,7 @@ en:
amenity=shelter: Tag:amenity=shelter
amenity=shop: Tag:amenity=shop
amenity=shower: Tag:amenity=shower
amenity=ski_rental: Tag:amenity=ski rental
amenity=ski_school: Tag:amenity=ski school
amenity=smoking_area: Tag:amenity=smoking area
amenity=social_centre: Tag:amenity=social centre
@ -5814,6 +5830,7 @@ en:
amenity=theatre: Tag:amenity=theatre
amenity=ticket_booth: Tag:amenity=ticket booth
amenity=ticket_validator: Tag:amenity=ticket validator
amenity=toilet: Tag:amenity=toilet
amenity=toilets: Tag:amenity=toilets
amenity=townhall: Tag:amenity=townhall
amenity=trolley_bay: Tag:amenity=trolley bay
@ -6097,6 +6114,7 @@ en:
craft=key_cutter: Tag:craft=key cutter
craft=locksmith: Tag:craft=locksmith
craft=metal_construction: Tag:craft=metal construction
craft=musical_instrument: Tag:craft=musical instrument
craft=oil_mill: Tag:craft=oil mill
craft=optician: Tag:craft=optician
craft=organ_builder: Tag:craft=organ builder
@ -6845,6 +6863,7 @@ en:
name=The_Church_of_Jesus_Christ_of_Latter-day_Saints: Tag:name=The Church of Jesus
Christ of Latter-day Saints
name=Walmart: Tag:name=Walmart
name=Продукты: Tag:name=Продукты
natural=anthill: Tag:natural=anthill
natural=arete: Tag:natural=arete
natural=avalanche_dam: Tag:natural=avalanche dam
@ -7162,6 +7181,7 @@ en:
operator=independent: Tag:operator=independent
operator=stadtmobil: Tag:operator=stadtmobil
operator=teilAuto: Tag:operator=teilAuto
organ: Tag:organ
parking:lane:hgv=on_street: Tag:parking:lane:hgv=on street
parking=surface: Tag:parking=surface
passenger=international: Tag:passenger=international
@ -7178,6 +7198,7 @@ en:
pipeline=marker: Tag:pipeline=marker
pipeline=substation: Tag:pipeline=substation
pipeline=valve: Tag:pipeline=valve
piste:type=connection: Tag:piste:type=connection
piste:type=downhill: Tag:piste:type=downhill
piste:type=nordic: Tag:piste:type=nordic
place=allotments: Tag:place=allotments
@ -7861,6 +7882,7 @@ en:
shop=photography: Tag:shop=photography
shop=piercing: Tag:shop=piercing
shop=pottery: Tag:shop=pottery
shop=printer_ink: Tag:shop=printer ink
shop=printing: Tag:shop=printing
shop=pyrotechnics: Tag:shop=pyrotechnics
shop=pépinière: Tag:shop=pépinière
@ -7969,6 +7991,7 @@ en:
source:geometry=NSW_LPI_Base_Map: Tag:source:geometry=NSW LPI Base Map
source:geometry=NSW_LPI_Imagery: Tag:source:geometry=NSW LPI Imagery
source:maxspeed=implicit: Tag:source:maxspeed=implicit
source:name=LPI_NSW_Base_Map: Tag:source:name=LPI NSW Base Map
source:name=NSW_LPI_Base_Map: Tag:source:name=NSW LPI Base Map
source=ACT2016: Tag:source=ACT2016
source=ACTMapiRoads: Tag:source=ACTMapiRoads
@ -7981,6 +8004,7 @@ en:
1:25000 map (2007)
source=Isle_of_Man_Government_aerial_imagery_(2001): Tag:source=Isle of Man Government
aerial imagery (2001)
source=LPI_NSW_Base_Map: Tag:source=LPI NSW Base Map
source=LPI_NSW_Imagery: Tag:source=LPI NSW Imagery
source=NAIP: Tag:source=NAIP
source=NSW_LPI_Base_Map: Tag:source=NSW LPI Base Map
@ -8068,6 +8092,7 @@ en:
sport=paragliding: Tag:sport=paragliding
sport=pelota: Tag:sport=pelota
sport=racquet: Tag:sport=racquet
sport=rc_car: Tag:sport=rc car
sport=roller_skating: Tag:sport=roller skating
sport=rowing: Tag:sport=rowing
sport=rugby: Tag:sport=rugby
@ -8413,6 +8438,7 @@ es:
leaf_type: ES:Key:leaf type
leisure: ES:Key:leisure
local_ref: ES:Key:local ref
locale: ES:Key:locale
man_made: ES:Key:man made
manufacturer: ES:Key:manufacturer
mapillary: ES:Key:mapillary
@ -8437,6 +8463,7 @@ es:
operator:type: ES:Key:operator:type
organic: ES:Key:organic
origin: ES:Key:origin
osmc:symbol: ES:Key:osmc:symbol
overtaking: ES:Key:overtaking
owner: ES:Key:owner
parking: ES:Key:parking
@ -8541,6 +8568,7 @@ es:
amenity=crematorium: ES:Tag:amenity=crematorium
amenity=crypt: ES:Tag:amenity=crypt
amenity=dentist: ES:Tag:amenity=dentist
amenity=device_charging_station: ES:Tag:amenity=device charging station
amenity=doctors: ES:Tag:amenity=doctors
amenity=drinking_water: ES:Tag:amenity=drinking water
amenity=driving_school: ES:Tag:amenity=driving school
@ -8746,6 +8774,7 @@ es:
landuse=construction: ES:Tag:landuse=construction
landuse=depot: ES:Tag:landuse=depot
landuse=farmland: ES:Tag:landuse=farmland
landuse=farmyard: ES:Tag:landuse=farmyard
landuse=forest: ES:Tag:landuse=forest
landuse=garages: ES:Tag:landuse=garages
landuse=grass: ES:Tag:landuse=grass
@ -8883,6 +8912,7 @@ es:
place=hamlet: ES:Tag:place=hamlet
place=island: ES:Tag:place=island
place=islet: ES:Tag:place=islet
place=isolated_dwelling: ES:Tag:place=isolated dwelling
place=neighbourhood: ES:Tag:place=neighbourhood
place=plot: ES:Tag:place=plot
place=square: ES:Tag:place=square
@ -9028,6 +9058,7 @@ et:
fa:
key:
highway: Fa:Key:highway
level: Fa:Key:level
name: FA:Key:name
tag:
amenity=fountain: Fa:Tag:amenity=fountain
@ -9174,6 +9205,7 @@ fr:
capacity:disabled: FR:Key:capacity:disabled
class:bicycle:commute: FR:Key:class:bicycle:commute
clothes: FR:Key:clothes
club: FR:Key:club
collection_times: FR:Key:collection times
color: FR:Key:color
colour: FR:Key:colour
@ -9466,6 +9498,7 @@ fr:
amenity=dentist: FR:Tag:amenity=dentist
amenity=doctors: FR:Tag:amenity=doctors
amenity=drinking_water: FR:Tag:amenity=drinking water
amenity=driving_school: FR:Tag:amenity=driving school
amenity=embassy: FR:Tag:amenity=embassy
amenity=fast_food: FR:Tag:amenity=fast food
amenity=fire_station: FR:Tag:amenity=fire station
@ -9546,6 +9579,7 @@ fr:
building=sty: FR:Tag:building=sty
building=terrace: FR:Tag:building=terrace
building=warehouse: FR:Tag:building=warehouse
club=sport: FR:Tag:club=sport
construction=yes: FR:Tag:construction=yes
craft=beekeeper: FR:Tag:craft=beekeeper
craft=brewery: FR:Tag:craft=brewery
@ -9673,6 +9707,7 @@ fr:
leaf_cycle=deciduous: FR:Tag:leaf cycle=deciduous
leisure=dog_park: FR:Tag:leisure=dog park
leisure=fishing: FR:Tag:leisure=fishing
leisure=fitness_centre: FR:Tag:leisure=fitness centre
leisure=garden: FR:Tag:leisure=garden
leisure=golf_course: FR:Tag:leisure=golf course
leisure=hackerspace: FR:Tag:leisure=hackerspace
@ -9811,6 +9846,7 @@ fr:
shop=boutique: FR:Tag:shop=boutique
shop=butcher: FR:Tag:shop=butcher
shop=car: FR:Tag:shop=car
shop=car_parts: FR:Tag:shop=car parts
shop=car_repair: FR:Tag:shop=car repair
shop=carpet: FR:Tag:shop=carpet
shop=charity: FR:Tag:shop=charity
@ -10404,6 +10440,7 @@ ja:
distance: JA:Key:distance
disused: JA:Key:disused
'disused:': 'JA:Key:disused:'
dog: JA:Key:dog
donation:compensation: JA:Key:donation:compensation
drink: JA:Key:drink
drinking_water: JA:Key:drinking water
@ -10425,6 +10462,7 @@ ja:
exit_to: JA:Key:exit to
expressway: JA:Key:expressway
facebook: JA:Key:facebook
fair_trade: JA:Key:fair trade
fax: JA:Key:fax
fee: JA:Key:fee
fence_type: JA:Key:fence type
@ -10612,6 +10650,7 @@ ja:
old_ref: JA:Key:old ref
oneway: JA:Key:oneway
oneway:bicycle: JA:Key:oneway:bicycle
openfire: JA:Key:openfire
opening_date: JA:Key:opening date
opening_hours: JA:Key:opening hours
operator: JA:Key:operator
@ -10689,6 +10728,7 @@ ja:
seamark:type: JA:Key:seamark:type
second_hand: JA:Key:second hand
segregated: JA:Key:segregated
self_service: JA:Key:self service
service: JA:Key:service
service_times: JA:Key:service times
shelter: JA:Key:shelter
@ -10719,6 +10759,7 @@ ja:
source:ref: JA:Key:source:ref
source_ref: JA:Key:source ref
species: JA:Key:species
speech_output: JA:Key:speech output
sport: JA:Key:sport
stars: JA:Key:stars
start_date: JA:Key:start date
@ -12351,6 +12392,7 @@ pl:
amenity=drinking_water: Pl:Tag:amenity=drinking water
amenity=driving_school: Pl:Tag:amenity=driving school
amenity=events_venue: Pl:Tag:amenity=events venue
amenity=fast_food: Pl:Tag:amenity=fast food
amenity=ferry_terminal: Pl:Tag:amenity=ferry terminal
amenity=fire_station: Pl:Tag:amenity=fire station
amenity=food_court: Pl:Tag:amenity=food court
@ -12866,6 +12908,7 @@ pl:
traffic_sign=city_limit: Pl:Tag:traffic sign=city limit
tunnel=culvert: Pl:Tag:tunnel=culvert
type=public_transport: Pl:Tag:type=public transport
vending=bottle_return: Pl:Tag:vending=bottle return
vending=candles: Pl:Tag:vending=candles
wall=noise_barrier: Pl:Tag:wall=noise barrier
water=lake: Pl:Tag:water=lake
@ -13061,6 +13104,7 @@ pt:
voltage: Pt:Key:voltage
water: Pt:Key:water
waterway: Pt:Key:waterway
wetland: Pt:Key:wetland
wheelchair: Pt:Key:wheelchair
wikidata: Pt:Key:wikidata
wikipedia: Pt:Key:wikipedia
@ -15079,6 +15123,7 @@ ru:
military=airfield: RU:Tag:military=airfield
military=bunker: RU:Tag:military=bunker
military=naval_base: RU:Tag:military=naval base
name=Продукты: RU:Tag:name=Продукты
natural=arete: RU:Tag:natural=arete
natural=bare_rock: RU:Tag:natural=bare rock
natural=beach: RU:Tag:natural=beach

View file

@ -19,7 +19,7 @@ class Country
def self.load_countries
countries = {}
xml = REXML::Document.new(File.read("config/countries.xml"))
xml = REXML::Document.new(File.read(Rails.root.join("config", "countries.xml")))
xml.elements.each("geonames/country") do |ele|
code = ele.get_text("countryCode").to_s

View file

@ -13,10 +13,6 @@ class GeocoderControllerTest < ActionController::TestCase
{ :path => "/geocoder/search_latlon", :method => :get },
{ :controller => "geocoder", :action => "search_latlon" }
)
assert_routing(
{ :path => "/geocoder/search_uk_postcode", :method => :get },
{ :controller => "geocoder", :action => "search_uk_postcode" }
)
assert_routing(
{ :path => "/geocoder/search_ca_postcode", :method => :get },
{ :controller => "geocoder", :action => "search_ca_postcode" }
@ -263,7 +259,7 @@ class GeocoderControllerTest < ActionController::TestCase
"CR2 6XH",
"DN55 1PT"
].each do |code|
search_check code, %w[uk_postcode osm_nominatim]
search_check code, %w[osm_nominatim]
end
end
@ -298,24 +294,6 @@ class GeocoderControllerTest < ActionController::TestCase
results_check_error "Longitude 180.23 out of range"
end
##
# Test the UK postcode search
def test_search_uk_postcode
with_http_stubs "npemap" do
get :search_uk_postcode, :xhr => true,
:params => { :query => "CV4 7AL", :zoom => 10,
:minlon => -0.559, :minlat => 51.217,
:maxlon => 0.836, :maxlat => 51.766 }
results_check :name => "CV4 7AL", :lat => 52.381748701968, :lon => -1.56176420939232
get :search_uk_postcode, :xhr => true,
:params => { :query => "XX9 9XX", :zoom => 10,
:minlon => -0.559, :minlat => 51.217,
:maxlon => 0.836, :maxlat => 51.766 }
results_check
end
end
##
# Test the Canadian postcode search
def test_search_ca_postcode

View file

@ -1,10 +0,0 @@
/cgi/geocoder.fcgi?format=text&postcode=CV4%207AL:
code: 200
body: |
# Easting,Northing,Matched Postcode,Latitude,Longitude
429926,276058,'CV4 7AL',52.381748701968,-1.56176420939232
/cgi/geocoder.fcgi?format=text&postcode=XX9%209XX:
code: 200
body: |
Error: Postcode area 'XX' not found, postcode probably invalid