Skip to content

Instantly share code, notes, and snippets.

POI style (24x24)
town hall
vending machine (improve svg)
shopping centre
public building
stadium
cemetery
graveyard
silo/tank (improve svg)
@gravitystorm
gravitystorm / commits.txt
Created March 8, 2011 14:03
Which commits will go in which branch when p2 moves to git. Starting from r25368
25544 master
25535 master
25534 backgrounds
25533 master
25530 master
25529 magic_roundabout
25525 backgrounds
25524 backgrounds
25522 backgrounds
25514 startup
@gravitystorm
gravitystorm / gist:2965031
Created June 21, 2012 10:26
rails port warnings and errors
rake test
(in /home/andy/src/rails_port)
Run options: --seed 32376
# Running tests:
...................................................WARNING: MiniTest::MINI_DIR was removed. Don't violate other's internals.
WARNING: Used by /usr/lib/ruby/1.9.1/test/unit/assertions.rb:143:in `assert_respond_to'.
...........................................................................................................................................Entity: line 1: parser error : Attribute lat redefined
<osm><node id='123' lon='23.23' lat='23.1' lat='12' changeset='23' version='23'
A) Test Way Name Swap
There is an edge case in deciding significance of names. In Russia, "Foo Street" and "Street Foo" are the same, and so if a decliner adds a street name and reversed by an agreer, the name should be removed. Currently the bot treats "Street Foo" as a distinct name, and so keeps it.
history = [OSM::Way[[1,2,3], :id=>1, :changeset=>1, :version=>1, "highway"=>"residental"], # created by agreer
OSM::Way[[1,2,3], :id=>1, :changeset=>3, :version=>2, "highway"=>"residental", "name"=>"ул. Гая"], # name added by decliner
OSM::Way[[1,2,3], :id=>1, :changeset=>2, :version=>3, "highway"=>"residental", "name"=>"Гая ул."]] # name swapped around by agreer
Expected
@gravitystorm
gravitystorm / gist:3083598
Created July 10, 2012 14:24
Fractal Edge Cases
Users whose edits are all kept: CTs accepted in the database
Users whose edits are all removed: undecided + declined in the database
=======
Users who have not accepted but whose edits will be kept: "Adopted users"
https://github.com/gravitystorm/openstreetmap-license-change/blob/master/users_whitelist.txt
Users who have accepted but whose edits will be all removed: Not supported
#!/usr/bin/ruby
require 'set'
@edit_whitelist = File.open("edits_whitelist.txt").read.split("\n").map{|e| e.split("v")[0]}.to_set
@logs = File.open("logs.list").read.split("\n")
@flagged_changesets = Set.new
@changesets = Set.new
update regions set status = 'failed'
where (lat = 49 and lon in (18,19,20,21,22,23))
or (lat = 50 and lon in (14,15,16,17,18,19,20,21,22,23,24))
or (lat = 51 and lon in (14,15,16,17,18,19,20,21,22,23))
or (lat = 52 and lon in (14,15,16,17,18,19,20,21,22,23))
or (lat = 53 and lon in (14,15,16,17,18,19,20,21,22,23))
or (lat = 54 and lon in (14,15,16,17,18,19,20,21,22,23))
@gravitystorm
gravitystorm / gist:5582101
Created May 15, 2013 06:57
segfault in mapnik 24913c4759db7 (debug)
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffe4de8700 (LWP 23441)]
0x00007ffff71298ed in mapnik::read_double_xdr (data=0x7fffdbfffff9 "", val=@0x7fff5c36dd90: 0) at include/mapnik/global.hpp:142
142 boost::int64_t bits = ((boost::int64_t)data[7] & 0xff) |
(gdb) bt
#0 0x00007ffff71298ed in mapnik::read_double_xdr (data=0x7fffdbfffff9 "", val=@0x7fff5c36dd90: 0) at include/mapnik/global.hpp:142
#1 0x00007ffff7129ee0 in mapnik::wkb_reader::read_coords (this=0x7fffe4dbb800, ar=...) at src/wkb.cpp:219
#2 0x00007ffff712a3d8 in mapnik::wkb_reader::read_linestring (this=0x7fffe4dbb800, paths=...) at src/wkb.cpp:294
#3 0x00007ffff7129bdd in mapnik::wkb_reader::read (this=0x7fffe4dbb800, paths=...) at src/wkb.cpp:127
#4 0x00007ffff7129713 in mapnik::geometry_utils::from_wkb (paths=..., wkb=0x7fffd6b1c270 "", size=0, format=mapnik::wkbGeneric) at src/wkb.cpp:460
@gravitystorm
gravitystorm / gist:5582700
Created May 15, 2013 09:20
bt full from mapnik segfault
#0 0x00007ffff71298ed in mapnik::read_double_xdr (data=0x7fffdbfffff9 "", val=@0x7fff5c36dd90: 0) at include/mapnik/global.hpp:142
bits = 140737032992608
#1 0x00007ffff7129ee0 in mapnik::wkb_reader::read_coords (this=0x7fffe4dbb800, ar=...) at src/wkb.cpp:219
i = 5563352
#2 0x00007ffff712a3d8 in mapnik::wkb_reader::read_linestring (this=0x7fffe4dbb800, paths=...) at src/wkb.cpp:294
ar = {pt_ = 0x7fff56e8a010, size_ = 16777504}
line = {_M_ptr = 0x7fffe4dbb7a0}
num_points = 16777504
#3 0x00007ffff7129bdd in mapnik::wkb_reader::read (this=0x7fffe4dbb800, paths=...) at src/wkb.cpp:127
type = 2
#0 0x00007ffff78a2f96 in mapnik::wkb_reader::read_polygon(boost::ptr_vector<mapnik::geometry<double, mapnik::vertex_vector>, boost::heap_clone_allocator, std::allocator<void*> >&) [clone .constprop.94] ()
from /usr/local/lib/libmapnik.so.2.2
#1 0x00007ffff78a5025 in mapnik::geometry_utils::from_wkb(boost::ptr_vector<mapnik::geometry<double, mapnik::vertex_vector>, boost::heap_clone_allocator, std::allocator<void*> >&, char const*, unsigned int, mapnik::wkbFormat) ()
from /usr/local/lib/libmapnik.so.2.2
#2 0x00007fffeb6ac369 in postgis_featureset::next() ()
from /usr/local/lib/mapnik/input/postgis.input
#3 0x00007ffff76cbeab in mapnik::feature_style_processor<mapnik::agg_renderer<mapnik::image_32> >::render_style(mapnik::layer const&, mapnik::agg_renderer<mapnik::image_32>&, mapnik::feature_type_style const*, mapnik::rule_cache const&, std::string const&, boost::shared_ptr<mapnik::Featureset>, mapnik::proj_transform const&) () from /usr/local/lib/libmapnik.so.2.2
#4 0x00007ffff76cdc3d in mapnik::