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
""" | |
Post processor for OSM tables imported by Imposm to rename suffixes and prefixes to shorter versions | |
Use like: | |
python gen_osm_replacment > gen_osm_replacment.sql | |
psql -d osm < gen_osm_replacmenet.sql | |
""" | |
replacements = [ | |
('Avenue', 'Ave'), | |
('Boulevard', 'Blvd'), |
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
# From http://stackoverflow.com/questions/12822584/how-to-reset-south-migrations-to-capture-the-current-state-of-my-django-models/12823039#12823039 | |
# I figured this out (wasn't too bad). To set up the migration reset, I do the following: | |
rm <app-dir>/migrations/* | |
python manage.py schemamigration <app-name> --initial | |
python manage.py migrate <app-name> 0001 --fake --delete-ghost-migrations | |
# I commit the changes to the repository, and then for each deployment of the code elsewhere, run: | |
python manage.py migrate <app-name> 0001 --fake --delete-ghost-migrations |
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
/* -*-c++-*- */ | |
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph | |
* Copyright 2008-2014 Pelican Mapping | |
* http://osgearth.org | |
* | |
* osgEarth is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU Lesser General Public License as published by | |
* the Free Software Foundation; either version 2 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
typedef std::set< osg::Node* > NodeSet; | |
typedef std::map< osg::Node*, osg::ref_ptr< osg::Node > > CloneMap; | |
struct CopyNodesVisitor : public osg::NodeVisitor | |
{ | |
CopyNodesVisitor(NodeSet& keepers): | |
osg::NodeVisitor(osg::NodeVisitor::TRAVERSE_ALL_CHILDREN), | |
_keepers(keepers), | |
_currentParent(0) | |
{ |
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
function rotate3D(controller, startPosition, movement, constrainedAxis, rotateOnlyVertical, rotateOnlyHorizontal) { | |
rotateOnlyVertical = defaultValue(rotateOnlyVertical, false); | |
rotateOnlyHorizontal = defaultValue(rotateOnlyHorizontal, false); | |
var scene = controller._scene; | |
var camera = scene.camera; | |
var canvas = scene.canvas; | |
var oldAxis = camera.constrainedAxis; | |
if (defined(constrainedAxis)) { |
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
from osgeo import gdal | |
import numpy as np | |
import os | |
ds = gdal.Open("UNIT_S60W070/ASTGTM2_S56W068_dem.tif") | |
band = ds.GetRasterBand(1) | |
data = band.ReadAsArray() |
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
/* -*-c++-*- */ | |
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph | |
* Copyright 2015 Pelican Mapping | |
* http://osgearth.org | |
* | |
* osgEarth is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU Lesser General Public License as published by | |
* the Free Software Foundation; either version 2 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
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2010 Robert Osfield | |
* | |
* This application is open source and may be redistributed and/or modified | |
* freely and without restriction, both in commercial and non commercial applications, | |
* as long as this copyright notice is maintained. | |
* | |
* This application is distributed in the hope that it will be useful, | |
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
*/ |
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
/* -*-c++-*- */ | |
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph | |
* Copyright 2015 Pelican Mapping | |
* http://osgearth.org | |
* | |
* osgEarth is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU Lesser General Public License as published by | |
* the Free Software Foundation; either version 2 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
/* -*-c++-*- */ | |
/* osgEarth - Dynamic map generation toolkit for OpenSceneGraph | |
* Copyright 2015 Pelican Mapping | |
* http://osgearth.org | |
* | |
* osgEarth is free software; you can redistribute it and/or modify | |
* it under the terms of the GNU Lesser General Public License as published by | |
* the Free Software Foundation; either version 2 of the License, or | |
* (at your option) any later version. | |
* |
OlderNewer