View gist:32120
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
asdfasdf |
View gist:32231
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
<Map bgcolor="#8cb6d3" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over"> | |
<Style name="line style 1"> | |
<Rule><MaxScaleDenominator>99999</MaxScaleDenominator><LineSymbolizer><CssParameter name="stroke-width">13.0</CssParameter><CssParameter name="stroke">#a1cbea</CssParameter><CssParameter name="stroke-linejoin">round</CssParameter></LineSymbolizer></Rule> | |
<Rule><MinScaleDenominator>100000</MinScaleDenominator><LineSymbolizer><CssParameter name="stroke-width">9.0</CssParameter><CssParameter name="stroke">#a1cbea</CssParameter><CssParameter name="stroke-linejoin">round</CssParameter></LineSymbolizer></Rule> | |
</Style> | |
<Layer name="layer 2" srs="+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs +over" status="on"> | |
<StyleName>line style 1</StyleName> | |
<Datasource> | |
<Parameter name="type">shape</Parameter> | |
View gist:32252
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
<Parameter name="table"><![CDATA[ | |
(SELECT *, | |
(CASE WHEN round(way_area * 1000000) >= 20 THEN 'large' | |
WHEN round(way_area * 1000000) >= 1 THEN 'medium' | |
ELSE 'small' END) AS size, | |
REGEXP_REPLACE(UPPER(name), '(.)', E'\\1\xC2\xA0\xC2\xA0', 'g') AS name_stretched | |
FROM planet_osm_polygon | |
WHERE building IS NOT NULL | |
ORDER BY z_order ASC, way_area DESC) AS citylike]]></Parameter> | |
View gist:227536
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
# turn a django model into a mapnik datasource | |
def model_to_mapnik_ds(model,geom_name=None): | |
params = {'user':settings.DATABASE_USER, | |
'dbname':settings.DATABASE_NAME, | |
'password':settings.DATABASE_PASSWORD, | |
'user':settings.DATABASE_USER | |
} | |
if geom_name: | |
geom_field = [f for f in model._meta.fields if f.name == geom_name][0] | |
else: |
View josm_preset2osm2pgsql_style.py
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 python | |
import os | |
import sys | |
from lxml import etree | |
from lxml import objectify | |
keys = [] | |
if __name__ == "__main__": | |
View gist:497172
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
// pull layers from query string | |
boost::optional<std::string> layer_string = get_layer_string(): | |
if (layer_string) | |
{ | |
std::clog << "filtering layers...\n"; | |
// convert comma separated layers to vector | |
std::vector<std::string> layer_names = parse_layer_string(*layer_string); | |
// for each map layer object | |
BOOST_FOREACH ( layer const& lyr, map_.layers() ) |
View gist:579264
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
Index: plugins/input/shape/dbffile.hpp | |
=================================================================== | |
--- plugins/input/shape/dbffile.hpp (revision 2199) | |
+++ plugins/input/shape/dbffile.hpp (working copy) | |
@@ -36,6 +36,7 @@ | |
using mapnik::transcoder; | |
using mapnik::Feature; | |
+using namespace boost::iostreams; | |
View gist:588304
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
<?xml version="1.0" ?> | |
<Map bgcolor="rgb(255,255,255)" srs="+init=epsg:4326"> | |
<Style name="NYC_Structures4326_style"> | |
<Rule> | |
<PolygonSymbolizer> | |
<CssParameter name="fill">rgb(78,110,187)</CssParameter> | |
<CssParameter name="gamma">0.7</CssParameter> | |
</PolygonSymbolizer> | |
<LineSymbolizer> | |
<CssParameter name="stroke-width">0.96</CssParameter> |
View osm.pbf to postgis
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
# note: there is work afoot to load pbf directly with osm2pgsql | |
# http://lists.openstreetmap.org/pipermail/dev/2010-October/020953.html | |
# but for now osmosis >= 0.37 works best | |
# install java/osmosis if you don't already have it | |
sudo apt-get install sun-java6-jre | |
wget http://bretth.dev.openstreetmap.org/osmosis-build/osmosis-0.37.zip | |
unzip osmosis-0.37.zip | |
cd osmosis-0.37 | |
chmod +x bin/osmosis |
OlderNewer