[BASH][1] script to build a [texture atlas][2] for small/medium web sites/games. Requires [ImageMagick][3].
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'''Provides utility functions for encoding and decoding linestrings using the | |
Google encoded polyline algorithm. | |
''' | |
def encode_coords(coords): | |
'''Encodes a polyline using Google's polyline algorithm | |
See http://code.google.com/apis/maps/documentation/polylinealgorithm.html | |
for more information. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION gis.split_polygon(poly geometry, expand double precision DEFAULT 0.0001, srid integer DEFAULT 3857, level integer DEFAULT 0) | |
RETURNS SETOF geometry AS | |
$BODY$ | |
declare | |
num_points integer; | |
env geometry; | |
p1 geometry; | |
p2 geometry; | |
b1 geometry; | |
b2 geometry; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -14,10 +14,12 @@ | |
* You should have received a copy of the GNU Lesser General Public License along with | |
* this program. If not, see <http://www.gnu.org/licenses/>. | |
*/ | |
package org.oscim.android.canvas; | |
+import static android.graphics.Bitmap.Config.ARGB_8888; | |
+ | |
import java.io.InputStream; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
clang++-3.6 -DVARIADIC_WRAPPER -O3 -Wall -Wpedantic -std=c++11 variadic.cpp | |
./a.out | |
objdump -j .rodata -j .text -d -S a.out > a.txt | |
clang++-3.6 -O3 -Wall -Wpedantic -std=c++11 variadic.cpp | |
./a.out | |
objdump -j .rodata -j .text -d -S a.out > b.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
clang++-3.6 -DVARIADIC_WRAPPER -O3 -Wall -Wpedantic -std=c++11 variadic.cpp | |
./a.out | |
objdump -j .rodata -j .text -d -S a.out > a.txt | |
clang++-3.6 -O3 -Wall -Wpedantic -std=c++11 variadic.cpp | |
./a.out | |
objdump -j .rodata -j .text -d -S a.out > b.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cameras: | |
perspective: | |
type: perspective | |
vanishing_point: [0, -500] | |
lights: | |
directional1: | |
type: directional | |
direction: [.5, .1, -1] | |
diffuse: .4 | |
ambient: 0.6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or replace function get_motorway_links(bbox geometry) | |
returns table (id bigint, highway text, geom geometry) | |
language sql as | |
$$ | |
with | |
-- roads that are shown at current zoom-level | |
roads as (select osm_id as id, way as geom, highway | |
from planet_line | |
where way && $1 and highway in ('motorway', 'trunk')), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Copyright 2008, 2009, 2010, 2011, 2012 Roland Olbricht | |
# | |
# This file is (not yet) part of Overpass_API | |
# | |
# Overpass_API is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU Affero General Public License as | |
# published by the Free Software Foundation, either version 3 of the | |
# License, or (at your option) any later version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION map.tile_building_test(IN bbox geometry, IN pixel double precision) | |
RETURNS TABLE(osm_id bigint, tags hstore, geom geometry) | |
language sql AS | |
$BODY$ | |
WITH | |
buildings AS | |
(SELECT (ROW_NUMBER() OVER(ORDER BY way DESC))::integer AS id, osm_id, way, tags, way_area | |
FROM osm_polygon | |
WHERE way && $1 | |
AND (building is not null and not building in ('roof'))), |
OlderNewer