Skip to content

Instantly share code, notes, and snippets.

View artemp's full-sized avatar
🎸
compiling

Artem Pavlenko artemp

🎸
compiling
View GitHub Profile
@artemp
artemp / dissolve.patch
Created April 13, 2017 11:51
dissolve.patch
diff --git a/include/boost/geometry/extensions/algorithms/dissolve.hpp b/include/boost/geometry/extensions/algorithms/dissolve.hpp
index da03c1f..def7877 100644
--- a/include/boost/geometry/extensions/algorithms/dissolve.hpp
+++ b/include/boost/geometry/extensions/algorithms/dissolve.hpp
@@ -65,14 +65,12 @@ class backtrack_for_dissolve
public :
typedef detail::overlay::backtrack_state state_type;
- template
- <
@artemp
artemp / .clang-format
Created February 10, 2016 16:07
clang-format config
---
# Mapnik C/C+ style
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: true
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true

Speakers notes

Part of a presenation given at NACIS 2013: https://github.com/springmeyer/cloudless-nacis2013

  • Bahamas - land really pops due to blurred shallow nearshore
  • Australia - rich hues
  • Great Barrier Reef - Extremely subtle textures visible + water mask helps show smallest reefs
  • Amur River - effectively shows many combined flood events / murky water in delta
  • Taiwan - deforestation clearly visible
  • Tibet - Jewel lakes
@artemp
artemp / binary_visitor_test.cpp
Created May 5, 2014 11:57
binary visitor test
namespace test {
template <typename T>
struct string_to_number {};
template <>
struct string_to_number<double>
{
double operator() (std::string const& str) const
{
@artemp
artemp / gist:5445615
Created April 23, 2013 17:24
make test
make test
*** Running visual tests...
......................................................................................................................................................................
Visual rendering: 2 failed / 164 passed
1) 40000 different pixels:
/tmp/mapnik-visual-images/tiff-alpha-gdal-600-400-1.0-agg.png (actual)
tests/visual_tests/images/tiff-alpha-gdal-600-400-1.0-agg-reference.png (expected)
2) 40000 different pixels:
/tmp/mapnik-visual-images/tiff-alpha-gdal-600-400-2.0-agg.png (actual)
tests/visual_tests/images/tiff-alpha-gdal-600-400-2.0-agg-reference.png (expected)
<?xml version="1.0" encoding="utf-8"?>
<Map 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" background-color="rgb(255,255,255)">
<Style name="drainage">
<Rule>
<Filter>([HYC]=8)</Filter>
<CompositingSymbolizer fill="rgb(153,204,255,127)" smooth="1" comp-op="exclusion"/>
</Rule>
</Style>
<Style name="highway-border">
<Rule>
@artemp
artemp / generate_metatiles.py
Created March 19, 2012 19:13
Render metatiles
#!/usr/bin/env python
from math import pi,cos,sin,log,exp,atan
import sys, os
DEG_TO_RAD = pi/180
RAD_TO_DEG = 180/pi
def minmax (a,b,c):
a = max(a,b)
class feature_kv_iterator :
public boost::iterator_facade<feature_kv_iterator,
boost::tuple<std::string , value> const,
boost::forward_traversal_tag>
{
public:
typedef boost::tuple<std::string,value> value_type;
feature_kv_iterator (feature_impl const& f, bool begin = false)
: f_(f),
@artemp
artemp / loop
Created January 26, 2012 16:54
placement loop
while (placement->next())
{
BOOST_FOREACH( geometry_type * geom, geometries_to_process )
{
// I'd like to try to label every geometry !!!
}
}
@artemp
artemp / text-sym-logic
Created January 25, 2012 13:34
text symboliser logic
...
while (!placement_found && placement_options->next())
{
...
BOOST_FOREACH( geometry_type * geom, geometries_to_process )
{
...
while (!placement_found && placement_options->next_position_only())
{
...