[OSM-dev] Potlatch on own server
Dan Moore
writetodan at yahoo.com
Sun May 20 16:05:45 BST 2007
hi Nick,
> Decided in view of the problems to skip pre-populating the OSM database on my
> test rails server. Tried out Potlatch (checked out from SVN yesterday) on a
> blank OSM database created with "rake db:migrate". The result of this is that
> new ways will draw, but they don't upload to the server correctly.
>
> The ways themselves get added to the database, so do the nodes and segments,
> but there's a problem with way segments and way tags. maybe this is related
> to the primary key issue?
here's an, as yet, untested patch for the db migrate. changes:
- removes some duplicate indexes
- makes node coordinates double-precision
- removes uniqueness constraint on way 'id' in way segments and tags tables
looking at it now, you might need to add:
t.column "id", :integer
...statements to current_way_segments and current_way_tags - i'm not really sure
about these migrate scripts...
well, hope that helps. let me know how you get on.
cheers, dan.
Index: sites/rails_port/db/migrate/001_create_osm_db.rb
===================================================================
--- sites/rails_port/db/migrate/001_create_osm_db.rb (revision 2921)
+++ sites/rails_port/db/migrate/001_create_osm_db.rb (working copy)
@@ -28,8 +28,8 @@
end
create_table "current_nodes", :force => true do |t|
- t.column "latitude", :float
- t.column "longitude", :float
+ t.column "latitude", :double
+ t.column "longitude", :double
t.column "user_id", :integer, :limit => 20
t.column "visible", :boolean
t.column "tags", :text, :default => "", :null => false
@@ -52,7 +52,7 @@
add_index "current_segments", ["node_a"], :name => "current_segments_a_idx"
add_index "current_segments", ["node_b"], :name => "current_segments_b_idx"
- create_table "current_way_segments", :force => true do |t|
+ create_table "current_way_segments", :id => false, :force => true do |t|
t.column "segment_id", :integer
t.column "sequence_id", :integer
end
@@ -60,7 +60,7 @@
add_index "current_way_segments", ["segment_id"], :name => "current_way_segments_seg_idx"
add_index "current_way_segments", ["id"], :name => "current_way_segments_id_idx"
- create_table "current_way_tags", :force => true do |t|
+ create_table "current_way_tags", :id => false, :force => true do |t|
t.column "k", :string, :default => "", :null => false
t.column "v", :string, :default => "", :null => false
end
@@ -152,15 +152,14 @@
end
create_table "nodes", :force => true do |t|
- t.column "latitude", :float
- t.column "longitude", :float
+ t.column "latitude", :double
+ t.column "longitude", :double
t.column "user_id", :integer, :limit => 20
t.column "visible", :boolean
t.column "tags", :text, :default => "", :null => false
t.column "timestamp", :datetime
end
- add_index "nodes", ["id"], :name => "nodes_uid_idx"
add_index "nodes", ["latitude", "longitude"], :name => "nodes_latlon_idx"
create_table "segments", :force => true do |t|
@@ -174,7 +173,6 @@
add_index "segments", ["node_a"], :name => "street_segments_nodea_idx"
add_index "segments", ["node_b"], :name => "street_segments_nodeb_idx"
- add_index "segments", ["id"], :name => "street_segment_uid_idx"
create_table "users", :force => true do |t|
t.column "email", :string
@@ -218,8 +216,6 @@
t.column "visible", :boolean, :default => true
end
- add_index "ways", ["id"], :name => "ways_id_version_idx"
-
end
end
____________________________________________________________________________________Give spam the boot. Take control with tough spam protection in the all-new Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_html.html
More information about the dev
mailing list