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
override def repositories = super.repositories ++ Set( | |
"fusesource.m2" at "http://repo.fusesource.com/nexus/content/repositories/public/" | |
) | |
override def libraryDependencies = super.libraryDependencies ++ Set( | |
"org.fusesource.scalate" % "scalate-core" % "1.3.2" | |
) |
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
trait MyString { | |
def theString: String | |
} | |
case class AString(theString: String) extends MyString | |
case class IntAsString(theInt: Int) extends MyString { | |
def theString = theInt.toString | |
} | |
object MyString { |
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
val file = new java.io.FileInputStream(args(0)) | |
val inflater = new java.util.zip.InflaterInputStream(file) | |
val bytes = Iterator.continually(inflater.read) takeWhile(-1 !=) | |
bytes.foreach(System.out.write) | |
System.out.flush() |
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
diff --git a/src/geoserver/catalog.py b/src/geoserver/catalog.py | |
index 8f5331e..4f0a2e5 100644 | |
--- a/src/geoserver/catalog.py | |
+++ b/src/geoserver/catalog.py | |
@@ -56,6 +56,12 @@ class Catalog(object): | |
None, | |
self.http | |
)) | |
+ orig_req = self.http.request | |
+ def wrapped_request(*args, **kwargs): |
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
val orig = xml.XML.load("OSM_Roads.sld") | |
val ftypes = orig \\ "FeatureTypeStyle" | |
val printer = new xml.PrettyPrinter(80, 2) | |
for (name <- Seq("railway", "aeroway", "highway")) { | |
val nodes = | |
<StyledLayerDescriptor xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd"> | |
<UserStyle> |
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 | |
from geoserver.catalog import Catalog | |
from itertools import cycle, izip | |
import re | |
_punc = re.compile(r"[\.:]") #regex for punctuation that confuses restconfig | |
_foregrounds = ["#ffbbbb", "#bbffbb", "#bbbbff", "#ffffbb", "#bbffff", "#ffbbff"] | |
_backgrounds = ["#880000", "#008800", "#000088", "#888800", "#008888", "#880088"] |
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
import os | |
def vexec(cmd): | |
os.system("source bin/activate && DJANGO_SETTINGS_MODULE=geonode.settings " + cmd) |
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
* { | |
mark: url("http://example.com/example.jpg"); | |
mark-size: [ATTR * 6]; | |
} |
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
import logging | |
for _module in ["geonode.maps.views"]: | |
_logger = logging.getLogger(_module) | |
_logger.addHandler(logging.FileHandler("geonode.log")) | |
_logger.setLevel(logging.DEBUG) |
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
import org.geoscript._ | |
import style_new._ | |
import filter.Expression.enrichString | |
// import enrichString for spiffy "".cql method, otherwise strings are treated as literals | |
// alternatively: import org.geotools.filter.text.ecql.ECQL.{ toExpression => cql } | |
// to use cql("") | |
val states = layer.Shapefile("geoscript/src/test/resources/data/states.shp") | |
val theme = |