This file contains hidden or 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 |
This file contains hidden or 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> | |
This file contains hidden or 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> | |
This file contains hidden or 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: |
This file contains hidden or 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__": | |
This file contains hidden or 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() ) |
This file contains hidden or 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; | |
This file contains hidden or 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> |
This file contains hidden or 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