active_road 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/.rspec +1 -0
- data/.travis.yml +7 -2
- data/Gemfile +8 -2
- data/Guardfile +2 -6
- data/README.md +69 -9
- data/Rakefile +8 -7
- data/active_road.gemspec +19 -15
- data/app/models/active_road/access_link.rb +4 -4
- data/app/models/active_road/access_point.rb +5 -9
- data/app/models/active_road/boundary.rb +41 -0
- data/app/models/active_road/junction.rb +4 -18
- data/app/models/active_road/junction_conditionnal_cost.rb +2 -0
- data/app/models/active_road/junctions_physical_road.rb +5 -0
- data/app/models/active_road/logical_road.rb +5 -4
- data/app/models/active_road/osm_pbf_importer.rb +293 -0
- data/app/models/active_road/osm_pbf_importer_level_db.rb +784 -0
- data/app/models/active_road/path.rb +40 -9
- data/app/models/active_road/physical_road.rb +22 -27
- data/app/models/active_road/physical_road_conditionnal_cost.rb +3 -1
- data/app/models/active_road/request_conditionnal_cost_linker.rb +59 -0
- data/app/models/active_road/street_number.rb +60 -57
- data/app/models/active_road/terra_importer.rb +161 -0
- data/db/migrate/20120419093427_add_kind_to_physical_roads.rb +2 -2
- data/db/migrate/20140206091734_create_boundaries.rb +16 -0
- data/db/migrate/20140210132933_add_attributes_to_physical_road.rb +9 -0
- data/db/migrate/20140219095521_add_boundary_id_to_logical_road.rb +5 -0
- data/db/migrate/20140228072448_add_boundary_id_to_physical_road.rb +5 -0
- data/db/migrate/20140304141150_add_marker_to_physical_road.rb +5 -0
- data/db/migrate/20140310083550_add_tags_to_street_number.rb +5 -0
- data/db/migrate/20140317153437_add_index_to_conditionnal_costs.rb +6 -0
- data/db/migrate/20140602160047_add_physical_road_index_to_junctions_physical_road.rb +5 -0
- data/lib/active_road.rb +8 -2
- data/lib/active_road/engine.rb +4 -1
- data/lib/active_road/shortest_path/finder.rb +37 -46
- data/lib/active_road/simulation_tool.rb +73 -0
- data/lib/active_road/version.rb +1 -1
- data/lib/tasks/activeroad_tasks.rake +88 -4
- data/script/benchmark_import_kyotocabinet.rb +148 -0
- data/script/benchmark_shortest_path.rb +22 -0
- data/script/count_tag_in_osm_data.rb +114 -0
- data/script/import-tiger-numbers +3 -3
- data/spec/dummy/db/schema.rb +2 -1
- data/spec/dummy/db/structure.sql +100 -11
- data/spec/factories/boundary.rb +8 -0
- data/spec/factories/junction.rb +1 -1
- data/spec/factories/physical_road.rb +1 -2
- data/spec/fixtures/test.osm +120 -0
- data/spec/fixtures/test.osm.bz2 +0 -0
- data/spec/fixtures/test.osm.pbf +0 -0
- data/spec/lib/active_road/shortest_path/finder_spec.rb +143 -90
- data/spec/lib/active_road/shortest_path/performance_finder_spec.rb +59 -0
- data/spec/models/active_road/access_point_spec.rb +9 -18
- data/spec/models/active_road/junction_conditionnal_cost_spec.rb +4 -4
- data/spec/models/active_road/junction_spec.rb +34 -11
- data/spec/models/active_road/logical_road_spec.rb +20 -19
- data/spec/models/active_road/osm_pbf_importer_level_db_spec.rb +410 -0
- data/spec/models/active_road/path_spec.rb +1 -1
- data/spec/models/active_road/physical_road_conditionnal_cost_spec.rb +4 -4
- data/spec/models/active_road/physical_road_spec.rb +14 -3
- data/spec/models/active_road/request_conditionnal_cost_linker_spec.rb +65 -0
- data/spec/models/active_road/shared_examples/osm_pbf_importer_spec.rb +148 -0
- data/spec/models/active_road/street_number_spec.rb +58 -58
- data/spec/models/active_road/terra_importer_spec.rb +140 -0
- data/spec/spec_helper.rb +14 -9
- data/spec/support/geometry_support.rb +36 -0
- data/spec/support/profile.rb +19 -0
- data/tmp/performance/.gitignore +0 -0
- data/travis/before_install.sh +5 -9
- data/travis/before_script.sh +7 -7
- metadata +118 -121
- data/app/models/active_road/physical_road_filter.rb +0 -41
- data/app/models/active_road/terra_import.rb +0 -148
- data/spec/models/active_road/physical_road_filter_spec.rb +0 -85
- data/spec/models/active_road/terra_import_spec.rb +0 -113
- data/spec/support/georuby_ext.rb +0 -15
@@ -0,0 +1,22 @@
|
|
1
|
+
#!/usr/bin/env/ruby
|
2
|
+
require 'ruby-prof'
|
3
|
+
|
4
|
+
# Se placer dans le contexte de l'application rails
|
5
|
+
# cd spec/dummy
|
6
|
+
# bundle exec rails runner ../../script/benchmark_shortest_path.rb
|
7
|
+
|
8
|
+
departure = GeoRuby::SimpleFeatures::Point.from_x_y(7.699781, 48.587853)
|
9
|
+
arrival = GeoRuby::SimpleFeatures::Point.from_x_y(7.738061, 48.587853)
|
10
|
+
sp = ActiveRoad::ShortestPath::Finder.new(departure, arrival, 4)
|
11
|
+
|
12
|
+
# Profile the code
|
13
|
+
RubyProf.start
|
14
|
+
start = Time.now
|
15
|
+
sp.geometry
|
16
|
+
puts "request executed in #{(Time.now - start)} seconds"
|
17
|
+
result = RubyProf.stop
|
18
|
+
|
19
|
+
open("tmp/profile/callgrind.profile", "w") do |f|
|
20
|
+
printer = ::RubyProf::CallTreePrinter.new(result)
|
21
|
+
printer.print(f, :min_percent => 1)
|
22
|
+
end
|
@@ -0,0 +1,114 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
require "pbf_parser"
|
3
|
+
|
4
|
+
class CountTagInOsmData
|
5
|
+
|
6
|
+
def initialize(pbf_file, select_tags)
|
7
|
+
@pbf_file = pbf_file
|
8
|
+
@select_tags = eval(select_tags)
|
9
|
+
end
|
10
|
+
|
11
|
+
def has_select_tags?(tags)
|
12
|
+
tags.each do |key, value|
|
13
|
+
if (@select_tags.keys.include?(key) && @select_tags[key] == '*') || (@select_tags.keys.include?(key) && @select_tags[key] == value)
|
14
|
+
return true
|
15
|
+
end
|
16
|
+
end
|
17
|
+
return false
|
18
|
+
end
|
19
|
+
|
20
|
+
def has_select_attributes?(node)
|
21
|
+
@select_tags.each do |key, value|
|
22
|
+
if (node.key?(key) && @select_tags[key] == '*') || (node.key?(key) && node[key] == value)
|
23
|
+
return true
|
24
|
+
end
|
25
|
+
end
|
26
|
+
return false
|
27
|
+
end
|
28
|
+
|
29
|
+
def count_in_nodes
|
30
|
+
p "Begin to count nodes with specific tags"
|
31
|
+
start = Time.now
|
32
|
+
nodes_parser = ::PbfParser.new(@pbf_file)
|
33
|
+
nodes_counter = 0
|
34
|
+
puts @select_tags.inspect
|
35
|
+
|
36
|
+
# Process the file until it finds any node
|
37
|
+
nodes_parser.next until nodes_parser.nodes.any?
|
38
|
+
|
39
|
+
until nodes_parser.nodes.empty?
|
40
|
+
nodes_parser.nodes.each do |node|
|
41
|
+
if (node.key?(:tags) && has_select_tags?(node[:tags])) || has_select_attributes?(node)
|
42
|
+
nodes_counter += 1
|
43
|
+
end
|
44
|
+
end
|
45
|
+
# When there's no more fileblocks to parse, #next returns false
|
46
|
+
# This avoids an infinit loop when the last fileblock still contains ways
|
47
|
+
break unless nodes_parser.next
|
48
|
+
end
|
49
|
+
p "Finish to count #{nodes_counter} nodes with specific tags in #{(Time.now - start)} seconds"
|
50
|
+
end
|
51
|
+
|
52
|
+
def count_in_ways
|
53
|
+
puts "Begin to count ways with specific tags"
|
54
|
+
start = Time.now
|
55
|
+
ways_parser = ::PbfParser.new(@pbf_file)
|
56
|
+
ways_counter = 0
|
57
|
+
puts @select_tags.inspect
|
58
|
+
|
59
|
+
# Process the file until it finds any way.
|
60
|
+
ways_parser.next until ways_parser.ways.any?
|
61
|
+
|
62
|
+
# Once it found at least one way, iterate to find the remaining ways.
|
63
|
+
until ways_parser.ways.empty?
|
64
|
+
ways_parser.ways.each do |way|
|
65
|
+
if ( way.key?(:tags) && has_select_tags?(way[:tags]) ) || has_select_attributes?(way)
|
66
|
+
ways_counter += 1
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
# When there's no more fileblocks to parse, #next returns false
|
71
|
+
# This avoids an infinit loop when the last fileblock still contains ways
|
72
|
+
break unless ways_parser.next
|
73
|
+
end
|
74
|
+
|
75
|
+
p "Finish to count #{ways_counter} ways with specific tags in #{(Time.now - start)} seconds"
|
76
|
+
end
|
77
|
+
|
78
|
+
def count_in_relations
|
79
|
+
p "Begin to count relations with specific tags"
|
80
|
+
start = Time.now
|
81
|
+
relations_parser = ::PbfParser.new(@pbf_file)
|
82
|
+
relations_counter = 0
|
83
|
+
puts @select_tags.inspect
|
84
|
+
|
85
|
+
# Process the file until it finds any relation
|
86
|
+
relations_parser.next until relations_parser.relations.any?
|
87
|
+
|
88
|
+
until relations_parser.relations.empty?
|
89
|
+
relations_parser.relations.each do |relation|
|
90
|
+
if relation.key?(:tags) && has_select_tags?(relation[:tags])
|
91
|
+
relations_counter += 1
|
92
|
+
end
|
93
|
+
end
|
94
|
+
# When there's no more fileblocks to parse, #next returns false
|
95
|
+
# This avoids an infinit loop when the last fileblock still contains ways
|
96
|
+
break unless relations_parser.next
|
97
|
+
end
|
98
|
+
p "Finish to count #{relations_counter} relations with specific tags in #{(Time.now - start)} seconds"
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
|
103
|
+
#ruby count_tag_in_osm_data.rb "/home/luc/Téléchargements/corse-latest.osm.pbf" "{'cycleway:left' => '*', 'cycleway:right' => '*', 'cycleway:both' => '*', 'cycleway' => '*', 'highway' => 'cycleway'}" "ways"
|
104
|
+
if ARGV[2] == "nodes"
|
105
|
+
CountTagInOsmData.new(ARGV[0], ARGV[1]).count_in_nodes
|
106
|
+
elsif ARGV[2] == "ways"
|
107
|
+
CountTagInOsmData.new(ARGV[0], ARGV[1]).count_in_ways
|
108
|
+
elsif ARGV[2] == "relations"
|
109
|
+
CountTagInOsmData.new(ARGV[0], ARGV[1]).count_in_relations
|
110
|
+
else
|
111
|
+
CountTagInOsmData.new(ARGV[0], ARGV[1]).count_in_nodes
|
112
|
+
CountTagInOsmData.new(ARGV[0], ARGV[1]).count_in_ways
|
113
|
+
CountTagInOsmData.new(ARGV[0], ARGV[1]).count_in_relations
|
114
|
+
end
|
data/script/import-tiger-numbers
CHANGED
@@ -4,7 +4,7 @@ require File.expand_path('../../config/boot', __FILE__)
|
|
4
4
|
|
5
5
|
require 'georuby-ext'
|
6
6
|
|
7
|
-
require 'progressbar'
|
7
|
+
#require 'progressbar'
|
8
8
|
require 'geo_ruby/shp4r/shp'
|
9
9
|
|
10
10
|
require 'nokogiri'
|
@@ -178,12 +178,12 @@ TigerRecord.osm_index = osm_index
|
|
178
178
|
until ARGV.empty?
|
179
179
|
file = ARGV.shift
|
180
180
|
GeoRuby::Shp4r::ShpFile.open(file) do |shape_file|
|
181
|
-
progress = ProgressBar.new(file, shape_file.record_count)
|
181
|
+
#progress = ProgressBar.new(file, shape_file.record_count)
|
182
182
|
|
183
183
|
ActiveRoad::Base.transaction do
|
184
184
|
shape_file.each_record do |shape|
|
185
185
|
TigerRecord.new(shape).create_numbers
|
186
|
-
progress.inc
|
186
|
+
#progress.inc
|
187
187
|
end
|
188
188
|
end
|
189
189
|
end
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -14,7 +14,7 @@ ActiveRecord::Schema.define(:version => 20130419155438) do
|
|
14
14
|
|
15
15
|
create_table "junction_conditionnal_costs", :force => true do |t|
|
16
16
|
t.column "junction_id", :integer
|
17
|
-
t.column "cost", :
|
17
|
+
t.column "cost", :integer
|
18
18
|
t.column "tags", :string
|
19
19
|
t.column "start_physical_road_id", :integer
|
20
20
|
t.column "end_physical_road_id", :integer
|
@@ -52,6 +52,7 @@ ActiveRecord::Schema.define(:version => 20130419155438) do
|
|
52
52
|
t.column "physical_road_id", :integer
|
53
53
|
t.column "cost", :float
|
54
54
|
t.column "tags", :string
|
55
|
+
t.column "objectid", :string
|
55
56
|
end
|
56
57
|
|
57
58
|
create_table "physical_roads", :force => true do |t|
|
data/spec/dummy/db/structure.sql
CHANGED
@@ -9732,6 +9732,47 @@ CREATE CAST (text AS public.geometry) WITH FUNCTION public.geometry(text) AS IMP
|
|
9732
9732
|
|
9733
9733
|
SET search_path = public, pg_catalog;
|
9734
9734
|
|
9735
|
+
SET default_tablespace = '';
|
9736
|
+
|
9737
|
+
SET default_with_oids = false;
|
9738
|
+
|
9739
|
+
--
|
9740
|
+
-- Name: boundaries; Type: TABLE; Schema: public; Owner: -; Tablespace:
|
9741
|
+
--
|
9742
|
+
|
9743
|
+
CREATE TABLE boundaries (
|
9744
|
+
id integer NOT NULL,
|
9745
|
+
objectid character varying(255),
|
9746
|
+
name character varying(255),
|
9747
|
+
admin_level integer,
|
9748
|
+
postal_code character varying(255),
|
9749
|
+
insee_code character varying(255),
|
9750
|
+
geometry geometry,
|
9751
|
+
CONSTRAINT enforce_dims_geometry CHECK ((st_ndims(geometry) = 2)),
|
9752
|
+
CONSTRAINT enforce_geotype_geometry CHECK (((geometrytype(geometry) = 'MULTIPOLYGON'::text) OR (geometry IS NULL))),
|
9753
|
+
CONSTRAINT enforce_srid_geometry CHECK ((st_srid(geometry) = 4326))
|
9754
|
+
);
|
9755
|
+
|
9756
|
+
|
9757
|
+
--
|
9758
|
+
-- Name: boundaries_id_seq; Type: SEQUENCE; Schema: public; Owner: -
|
9759
|
+
--
|
9760
|
+
|
9761
|
+
CREATE SEQUENCE boundaries_id_seq
|
9762
|
+
START WITH 1
|
9763
|
+
INCREMENT BY 1
|
9764
|
+
NO MINVALUE
|
9765
|
+
NO MAXVALUE
|
9766
|
+
CACHE 1;
|
9767
|
+
|
9768
|
+
|
9769
|
+
--
|
9770
|
+
-- Name: boundaries_id_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: -
|
9771
|
+
--
|
9772
|
+
|
9773
|
+
ALTER SEQUENCE boundaries_id_seq OWNED BY boundaries.id;
|
9774
|
+
|
9775
|
+
|
9735
9776
|
--
|
9736
9777
|
-- Name: geography_columns; Type: VIEW; Schema: public; Owner: -
|
9737
9778
|
--
|
@@ -9740,8 +9781,6 @@ CREATE VIEW geography_columns AS
|
|
9740
9781
|
SELECT current_database() AS f_table_catalog, n.nspname AS f_table_schema, c.relname AS f_table_name, a.attname AS f_geography_column, geography_typmod_dims(a.atttypmod) AS coord_dimension, geography_typmod_srid(a.atttypmod) AS srid, geography_typmod_type(a.atttypmod) AS type FROM pg_class c, pg_attribute a, pg_type t, pg_namespace n WHERE ((((((t.typname = 'geography'::name) AND (a.attisdropped = false)) AND (a.atttypid = t.oid)) AND (a.attrelid = c.oid)) AND (c.relnamespace = n.oid)) AND (NOT pg_is_other_temp_schema(c.relnamespace)));
|
9741
9782
|
|
9742
9783
|
|
9743
|
-
SET default_tablespace = '';
|
9744
|
-
|
9745
9784
|
SET default_with_oids = true;
|
9746
9785
|
|
9747
9786
|
--
|
@@ -9805,6 +9844,8 @@ CREATE TABLE junctions (
|
|
9805
9844
|
updated_at timestamp without time zone NOT NULL,
|
9806
9845
|
geometry geometry,
|
9807
9846
|
tags hstore,
|
9847
|
+
height double precision,
|
9848
|
+
waiting_constraint double precision,
|
9808
9849
|
CONSTRAINT enforce_dims_geometry CHECK ((st_ndims(geometry) = 2)),
|
9809
9850
|
CONSTRAINT enforce_geotype_geometry CHECK (((geometrytype(geometry) = 'POINT'::text) OR (geometry IS NULL))),
|
9810
9851
|
CONSTRAINT enforce_srid_geometry CHECK ((st_srid(geometry) = 4326))
|
@@ -9914,10 +9955,24 @@ CREATE TABLE physical_roads (
|
|
9914
9955
|
created_at timestamp without time zone NOT NULL,
|
9915
9956
|
updated_at timestamp without time zone NOT NULL,
|
9916
9957
|
geometry geometry,
|
9917
|
-
kind character varying(255),
|
9918
|
-
minimum_width integer DEFAULT 0,
|
9919
9958
|
tags hstore,
|
9920
9959
|
length_in_meter double precision DEFAULT 0,
|
9960
|
+
minimum_width character varying(255),
|
9961
|
+
transport_mode character varying(255),
|
9962
|
+
uphill double precision,
|
9963
|
+
downhill double precision,
|
9964
|
+
slope character varying(255),
|
9965
|
+
cant character varying(255),
|
9966
|
+
covering character varying(255),
|
9967
|
+
steps_count integer,
|
9968
|
+
banisters_available boolean,
|
9969
|
+
tactile_band boolean,
|
9970
|
+
physical_road_type character varying(255),
|
9971
|
+
car boolean,
|
9972
|
+
bike boolean,
|
9973
|
+
train boolean,
|
9974
|
+
pedestrian boolean,
|
9975
|
+
name character varying(255),
|
9921
9976
|
CONSTRAINT enforce_dims_geometry CHECK ((st_ndims(geometry) = 2)),
|
9922
9977
|
CONSTRAINT enforce_geotype_geometry CHECK (((geometrytype(geometry) = 'LINESTRING'::text) OR (geometry IS NULL))),
|
9923
9978
|
CONSTRAINT enforce_srid_geometry CHECK ((st_srid(geometry) = 4326))
|
@@ -10003,6 +10058,13 @@ CREATE SEQUENCE street_numbers_id_seq
|
|
10003
10058
|
ALTER SEQUENCE street_numbers_id_seq OWNED BY street_numbers.id;
|
10004
10059
|
|
10005
10060
|
|
10061
|
+
--
|
10062
|
+
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
|
10063
|
+
--
|
10064
|
+
|
10065
|
+
ALTER TABLE ONLY boundaries ALTER COLUMN id SET DEFAULT nextval('boundaries_id_seq'::regclass);
|
10066
|
+
|
10067
|
+
|
10006
10068
|
--
|
10007
10069
|
-- Name: id; Type: DEFAULT; Schema: public; Owner: -
|
10008
10070
|
--
|
@@ -10045,6 +10107,14 @@ ALTER TABLE ONLY physical_roads ALTER COLUMN id SET DEFAULT nextval('physical_ro
|
|
10045
10107
|
ALTER TABLE ONLY street_numbers ALTER COLUMN id SET DEFAULT nextval('street_numbers_id_seq'::regclass);
|
10046
10108
|
|
10047
10109
|
|
10110
|
+
--
|
10111
|
+
-- Name: boundaries_pkey; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
10112
|
+
--
|
10113
|
+
|
10114
|
+
ALTER TABLE ONLY boundaries
|
10115
|
+
ADD CONSTRAINT boundaries_pkey PRIMARY KEY (id);
|
10116
|
+
|
10117
|
+
|
10048
10118
|
--
|
10049
10119
|
-- Name: geometry_columns_pk; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
|
10050
10120
|
--
|
@@ -10109,6 +10179,13 @@ ALTER TABLE ONLY street_numbers
|
|
10109
10179
|
ADD CONSTRAINT street_numbers_pkey PRIMARY KEY (id);
|
10110
10180
|
|
10111
10181
|
|
10182
|
+
--
|
10183
|
+
-- Name: index_boundaries_on_geometry; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
10184
|
+
--
|
10185
|
+
|
10186
|
+
CREATE INDEX index_boundaries_on_geometry ON boundaries USING gist (geometry);
|
10187
|
+
|
10188
|
+
|
10112
10189
|
--
|
10113
10190
|
-- Name: index_junctions_on_objectid; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
10114
10191
|
--
|
@@ -10145,24 +10222,24 @@ CREATE INDEX index_physical_roads_on_geometry ON physical_roads USING gist (geom
|
|
10145
10222
|
|
10146
10223
|
|
10147
10224
|
--
|
10148
|
-
-- Name:
|
10225
|
+
-- Name: index_physical_roads_on_logical_road_id; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
10149
10226
|
--
|
10150
10227
|
|
10151
|
-
CREATE INDEX
|
10228
|
+
CREATE INDEX index_physical_roads_on_logical_road_id ON physical_roads USING btree (logical_road_id);
|
10152
10229
|
|
10153
10230
|
|
10154
10231
|
--
|
10155
|
-
-- Name:
|
10232
|
+
-- Name: index_physical_roads_on_objectid; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
10156
10233
|
--
|
10157
10234
|
|
10158
|
-
CREATE INDEX
|
10235
|
+
CREATE INDEX index_physical_roads_on_objectid ON physical_roads USING btree (objectid);
|
10159
10236
|
|
10160
10237
|
|
10161
10238
|
--
|
10162
|
-
-- Name:
|
10239
|
+
-- Name: index_physical_roads_on_physical_road_type; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
10163
10240
|
--
|
10164
10241
|
|
10165
|
-
CREATE INDEX
|
10242
|
+
CREATE INDEX index_physical_roads_on_physical_road_type ON physical_roads USING btree (physical_road_type);
|
10166
10243
|
|
10167
10244
|
|
10168
10245
|
--
|
@@ -10211,6 +10288,8 @@ CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (v
|
|
10211
10288
|
-- PostgreSQL database dump complete
|
10212
10289
|
--
|
10213
10290
|
|
10291
|
+
SET search_path TO "$user",public;
|
10292
|
+
|
10214
10293
|
INSERT INTO schema_migrations (version) VALUES ('20110914160756');
|
10215
10294
|
|
10216
10295
|
INSERT INTO schema_migrations (version) VALUES ('20120201114800');
|
@@ -10247,4 +10326,14 @@ INSERT INTO schema_migrations (version) VALUES ('20130513134422');
|
|
10247
10326
|
|
10248
10327
|
INSERT INTO schema_migrations (version) VALUES ('20130513134511');
|
10249
10328
|
|
10250
|
-
INSERT INTO schema_migrations (version) VALUES ('20130607114951');
|
10329
|
+
INSERT INTO schema_migrations (version) VALUES ('20130607114951');
|
10330
|
+
|
10331
|
+
INSERT INTO schema_migrations (version) VALUES ('20130801151637');
|
10332
|
+
|
10333
|
+
INSERT INTO schema_migrations (version) VALUES ('20130809155019');
|
10334
|
+
|
10335
|
+
INSERT INTO schema_migrations (version) VALUES ('20130812143049');
|
10336
|
+
|
10337
|
+
INSERT INTO schema_migrations (version) VALUES ('20140206091734');
|
10338
|
+
|
10339
|
+
INSERT INTO schema_migrations (version) VALUES ('20140210132933');
|
data/spec/factories/junction.rb
CHANGED
@@ -6,7 +6,7 @@ FactoryGirl.define do
|
|
6
6
|
end
|
7
7
|
|
8
8
|
factory :junction_with_physical_roads, :class => ActiveRoad::Junction do
|
9
|
-
sequence(:objectid) { |n| "
|
9
|
+
sequence(:objectid) { |n| "junction_with_physical_roads::#{n}" }
|
10
10
|
geometry GeoRuby::SimpleFeatures::Point.from_x_y(2.2946, 48.8580, ActiveRoad.srid)
|
11
11
|
|
12
12
|
after(:create) do |junction|
|
@@ -1,8 +1,7 @@
|
|
1
1
|
FactoryGirl.define do
|
2
2
|
|
3
3
|
factory :physical_road, :class => ActiveRoad::PhysicalRoad do
|
4
|
-
sequence(:objectid) { |n| "
|
5
|
-
logical_road
|
4
|
+
sequence(:objectid) { |n| "physical_road::#{n}" }
|
6
5
|
geometry { GeoRuby::SimpleFeatures::LineString.from_points [GeoRuby::SimpleFeatures::Point.from_x_y(0, 0, ActiveRoad.srid), GeoRuby::SimpleFeatures::Point.from_x_y(1, 1, ActiveRoad.srid)] }
|
7
6
|
end
|
8
7
|
|
@@ -0,0 +1,120 @@
|
|
1
|
+
<?xml version='1.0' encoding='UTF-8'?>
|
2
|
+
<osm version="0.6" generator="osmconvert 0.7P" timestamp="2013-05-08T18:59:04Z">
|
3
|
+
<bounds minlat="2.10568" minlon="-54.61269" maxlat="6.370288" maxlon="-51.49161"/>
|
4
|
+
<node id="1" lat="5.308056" lon="-54.2" version="2" timestamp="2013-04-21T10:10:53Z" changeset="15808730" uid="149876" user="dbusse"/>
|
5
|
+
<node id="2" lat="5.308057" lon="-54.2" version="2" timestamp="2013-04-21T10:10:53Z" changeset="15808730" uid="149876" user="dbusse"/>
|
6
|
+
<node id="3" lat="5.308058" lon="-54.2" version="2" timestamp="2013-04-21T10:10:53Z" changeset="15808730" uid="149876" user="dbusse"/>
|
7
|
+
<node id="4" lat="5.308059" lon="-54.2" version="2" timestamp="2013-04-21T10:10:53Z" changeset="15808730" uid="149876" user="dbusse"/>
|
8
|
+
<node id="5" lat="5.308060" lon="-54.2" version="2" timestamp="2013-04-21T10:10:53Z" changeset="15808730" uid="149876" user="dbusse"/>
|
9
|
+
<node id="6" lat="5.308061" lon="-54.2" version="2" timestamp="2013-04-21T10:10:53Z" changeset="15808730" uid="149876" user="dbusse"/>
|
10
|
+
<node id="7" lat="5.308062" lon="-54.2" version="2" timestamp="2013-04-21T10:10:53Z" changeset="15808730" uid="149876" user="dbusse"/>
|
11
|
+
<node id="8" lat="5.308063" lon="-54.2" version="2" timestamp="2013-04-21T10:10:53Z" changeset="15808730" uid="149876" user="dbusse"/>
|
12
|
+
<way id="1" version="2" timestamp="2012-07-09T12:29:25Z" changeset="12161456" uid="218937" user="wl59">
|
13
|
+
<nd ref="1"/>
|
14
|
+
<nd ref="2"/>
|
15
|
+
<nd ref="3"/>
|
16
|
+
<tag k="building" v="yes"/>
|
17
|
+
<tag k="source" v="cadastre-dgi-fr source : Direction Générale des Impôts - Cadastre. Mise à jour : 2010"/>
|
18
|
+
</way>
|
19
|
+
<way id="2" version="2" timestamp="2012-07-09T12:29:25Z" changeset="12161456" uid="218937" user="wl59">
|
20
|
+
<nd ref="1"/>
|
21
|
+
<nd ref="4"/>
|
22
|
+
<nd ref="5"/>
|
23
|
+
<tag k="addr:housenumber" v="73"/>
|
24
|
+
<tag k="building" v="yes"/>
|
25
|
+
<tag k="source" v="cadastre-dgi-fr source : Direction Générale des Impôts - Cadastre. Mise à jour : 2010"/>
|
26
|
+
</way>
|
27
|
+
<way id="3" version="2" timestamp="2012-07-09T12:29:25Z" changeset="12161456" uid="218937" user="wl59">
|
28
|
+
<nd ref="1"/>
|
29
|
+
<nd ref="2"/>
|
30
|
+
<nd ref="7"/>
|
31
|
+
<nd ref="8"/>
|
32
|
+
<tag k="highway" v="road"/>
|
33
|
+
</way>
|
34
|
+
<way id="4" version="2" timestamp="2012-07-09T12:29:25Z" changeset="12161456" uid="218937" user="wl59">
|
35
|
+
</way>
|
36
|
+
<way id="5" version="16" timestamp="2012-03-19T21:45:37Z" changeset="11035419" uid="318501" user="Stephixus">
|
37
|
+
<nd ref="1"/>
|
38
|
+
<nd ref="2"/>
|
39
|
+
<nd ref="3"/>
|
40
|
+
<nd ref="4"/>
|
41
|
+
<nd ref="5"/>
|
42
|
+
<nd ref="9"/>
|
43
|
+
<tag k="highway" v="secondary"/>
|
44
|
+
<tag k="name" v="Rue J. Symphorien"/>
|
45
|
+
</way>
|
46
|
+
<node id="9" lat="5.308056" lon="-54.2" version="2" timestamp="2013-04-21T10:10:53Z" changeset="15808730" uid="149876" user="dbusse"/>
|
47
|
+
<node id="10" lat="5.308056" lon="-54.2" version="2" timestamp="2013-04-21T10:10:53Z" changeset="15808730" uid="149876" user="dbusse"/>
|
48
|
+
<way id="6" version="16" timestamp="2012-03-19T21:45:37Z" changeset="11035419" uid="318501" user="Stephixus">
|
49
|
+
<nd ref="1"/>
|
50
|
+
<nd ref="5"/>
|
51
|
+
<nd ref="9"/>
|
52
|
+
<nd ref="10"/>
|
53
|
+
<tag k="highway" v="secondary"/>
|
54
|
+
<tag k="name" v="Rue J. Symphorien"/>
|
55
|
+
</way>
|
56
|
+
<node id="277048539" lat="5.3" lon="-54.3" version="2" timestamp="2013-04-21T10:10:53Z" changeset="15808730" uid="149876" user="dbusse"/>
|
57
|
+
<node id="277048540" lat="5.4" lon="-54.3" version="2" timestamp="2013-04-21T10:10:53Z" changeset="15808730" uid="149876" user="dbusse"/>
|
58
|
+
<node id="277048541" lat="5.4" lon="-54.1" version="2" timestamp="2013-04-21T10:10:53Z" changeset="15808730" uid="149876" user="dbusse"/>
|
59
|
+
<node id="277048542" lat="5.3" lon="-54.1" version="2" timestamp="2013-04-21T10:10:53Z" changeset="15808730" uid="149876" user="dbusse"/>
|
60
|
+
<way id="7" version="11" timestamp="2013-03-20T19:17:44Z" changeset="15435383" uid="11068" user="windu2b">
|
61
|
+
<nd ref="277048539"/>
|
62
|
+
<nd ref="277048540"/>
|
63
|
+
<tag k="admin_level" v="8"/>
|
64
|
+
<tag k="boundary" v="administrative"/>
|
65
|
+
<tag k="source" v="cadastre-dgi-fr source : Direction Générale des Impôts - Cadastre. Mise à jour : 2013"/>
|
66
|
+
</way>
|
67
|
+
<way id="8" version="11" timestamp="2013-03-20T19:17:44Z" changeset="15435383" uid="11068" user="windu2b">
|
68
|
+
<nd ref="277048540"/>
|
69
|
+
<nd ref="277048541"/>
|
70
|
+
<tag k="admin_level" v="8"/>
|
71
|
+
<tag k="boundary" v="administrative"/>
|
72
|
+
<tag k="source" v="cadastre-dgi-fr source : Direction Générale des Impôts - Cadastre. Mise à jour : 2013"/>
|
73
|
+
</way>
|
74
|
+
<way id="9" version="11" timestamp="2013-03-20T19:17:44Z" changeset="15435383" uid="11068" user="windu2b">
|
75
|
+
<nd ref="277048541"/>
|
76
|
+
<nd ref="277048542"/>
|
77
|
+
<nd ref="277048539"/>
|
78
|
+
<tag k="admin_level" v="8"/>
|
79
|
+
<tag k="boundary" v="administrative"/>
|
80
|
+
<tag k="source" v="cadastre-dgi-fr source : Direction Générale des Impôts - Cadastre. Mise à jour : 2013"/>
|
81
|
+
</way>
|
82
|
+
<relation id="73464" version="12" timestamp="2013-09-24T19:38:24Z" changeset="18014700" uid="37548" user="Marcussacapuces91">
|
83
|
+
<member type="way" ref="7" role="outer"/>
|
84
|
+
<member type="way" ref="8" role="outer"/>
|
85
|
+
<member type="way" ref="9" role="outer"/>
|
86
|
+
<member type="node" ref="277048542" role="admin_centre"/>
|
87
|
+
<tag k="addr:postcode" v="20200"/>
|
88
|
+
<tag k="admin_level" v="8"/>
|
89
|
+
<tag k="boundary" v="administrative"/>
|
90
|
+
<tag k="name" v="Santa-Maria-di-Lota"/>
|
91
|
+
<tag k="ref:INSEE" v="2B309"/>
|
92
|
+
<tag k="source:addr:postcode" v="source of postcode is from galichon.com/INSEE"/>
|
93
|
+
<tag k="source:ref:INSEE" v="source of ref is from ref_INSEE in relation"/>
|
94
|
+
<tag k="type" v="boundary"/>
|
95
|
+
<tag k="wikipedia" v="fr:Santa-Maria-di-Lota"/>
|
96
|
+
</relation>
|
97
|
+
<node id="2646260105" visible="true" version="1" changeset="20308566" timestamp="2014-01-31T22:19:31Z" user="Denis_Helfer" uid="22165" lat="47.7378654" lon="7.3908514">
|
98
|
+
<tag k="addr:housenumber" v="4"/>
|
99
|
+
</node>
|
100
|
+
<node id="2646260106" visible="true" version="1" changeset="20308566" timestamp="2014-01-31T22:19:31Z" user="Denis_Helfer" uid="22165" lat="47.7388654" lon="7.3908514">
|
101
|
+
<tag k="addr:housenumber" v="7"/>
|
102
|
+
</node>
|
103
|
+
<node id="904865073" visible="true" version="1" changeset="20308566" timestamp="2014-01-31T22:19:31Z" user="Denis_Helfer" uid="22165" lat="47" lon="7"></node>
|
104
|
+
<node id="904862755" visible="true" version="1" changeset="20308566" timestamp="2014-01-31T22:19:31Z" user="Denis_Helfer" uid="22165" lat="47" lon="7.001"></node>
|
105
|
+
<node id="904860556" visible="true" version="1" changeset="20308566" timestamp="2014-01-31T22:19:31Z" user="Denis_Helfer" uid="22165" lat="47.001" lon="7.001"></node>
|
106
|
+
<node id="904864930" visible="true" version="1" changeset="20308566" timestamp="2014-01-31T22:19:31Z" user="Denis_Helfer" uid="22165" lat="47.001" lon="7"></node>
|
107
|
+
<way id="76809952" visible="true" version="2" changeset="24752595" timestamp="2014-08-14T18:56:27Z" user="brandon_macuser" uid="51600">
|
108
|
+
<nd ref="904865073"/>
|
109
|
+
<nd ref="904862755"/>
|
110
|
+
<nd ref="904860556"/>
|
111
|
+
<nd ref="904864930"/>
|
112
|
+
<tag k="addr:city" v="City of Oshawa"/>
|
113
|
+
<tag k="addr:housenumber" v="200"/>
|
114
|
+
<tag k="addr:street" v="Kingsway College Drive"/>
|
115
|
+
<tag k="amenity" v="school"/>
|
116
|
+
<tag k="building" v="yes"/>
|
117
|
+
<tag k="name" v="Auditorium"/>
|
118
|
+
<tag k="source" v="CanVec 6.0 - NRCan"/>
|
119
|
+
</way>
|
120
|
+
</osm>
|