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" encoding="UTF-8"?> | |
<sld:UserStyle xmlns="http://www.opengis.net/sld" xmlns:sld="http://www.opengis.net/sld" xmlns:ogc | |
<sld:Name>Default Styler</sld:Name> | |
<sld:Title/> | |
<sld:FeatureTypeStyle> | |
<sld:Name>name</sld:Name> | |
<sld:Rule> | |
<sld:PointSymbolizer> | |
<sld:Graphic> | |
<sld:Mark> |
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 | |
cat = Catalog("http://localhost:8001/geoserver/rest", username="admin", password="geoserver") | |
topp = cat.get_workspace("topp") | |
files = dict((x, "roads." + x) for x in ["shp", "prj", "dbf", "shx"]) | |
for i in xrange(0, 200): | |
cat.create_featurestore("roads_" + str(i), files, workspace=topp) | |
for i in xrange(0, 200): |
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
ds = self.cat.create_datastore() | |
ds.name = "gsconfig" | |
ds.parameters.update( | |
host="localhost", port="5432", database="db", user="postgres", | |
passwd="password", dbtype="postgis") | |
self.cat.save(ds) |
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
def tryWithDefault[A, B](a: A, b: B)(pf: PartialFunction[A, B]): B = | |
if (pf isDefinedAt a) pf(a) | |
else b | |
println(tryWithDefault(1, 0) { case n if n % 2 == 0 => n / 2 }) // 0 | |
println(tryWithDefault(12, 0) { case n if n % 2 == 0 => n / 2 }) // 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 geoserver.catalog | |
import os, os.path | |
cat = geoserver.catalog.Catalog( | |
'http://localhost:8080/geoserver/rest', | |
"admin", "geoserver") | |
style_dir = "/home/dwins/Downloads/graphite/" | |
suffix = 'graphite' | |
extant_styles = set(s.name for s in cat.get_styles()) |
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
package dwins.web | |
class Unfiltered extends unfiltered.filter.Planify ({ | |
case GET(Path("/")) => Ok ~> TextContent ~> Text("Hello") | |
}) |
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
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/POI.svg | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/cul_de_sac.15.png | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/cul_de_sac.16.png | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/cul_de_sac.17.png | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/cul_de_sac.18.png | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/exit-freeway.svg | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/exit.svg | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/ferry.svg | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/golf.svg | |
Missing File: file:/usr/share/opengeo-suite-data/geoserver_data/data/styles/symbols/golf_small.svg |
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
sealed trait Breakfast { | |
def beverage: String | |
def dish: String | |
} | |
object LumberJack extends Breakfast { | |
val beverage = "black coffee" | |
val dish = "ham and eggs | |
} |
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
from django.core.management.base import BaseCommand | |
from django.db import transaction | |
from geonode.maps.models import MapLayer | |
import json | |
class Command(BaseCommand): | |
help = """ | |
Changes the OWS url for all layers in geonode maps, useful for when a map | |
server changes. If you use an absolute URL for the GEOSERVER_URL setting | |
this simplifies the process of changing the hostname for your GeoNode site. |
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 | |
cat = Catalog("http://localhost:8080/geoserver/rest/") | |
for r in cat.get_resources(): | |
print "Resource %s %s %s" % (r.workspace, r.store, r.name) | |
for name in dir(r): | |
print "\t", name + ":", getattr(r, name) |