Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: flavour/iscram
base: a3a2502288
...
head fork: flavour/iscram
compare: 741039fb92
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 10 files changed
  • 0 commit comments
  • 1 contributor
View
2  VERSION
@@ -1 +1 @@
-2bf808f (2012-04-18 08:23:56)
+a3a2502 (2012-04-18 11:02:22)
View
1  modules/eden/gis.py
@@ -2289,6 +2289,7 @@ def model(self):
requires=IS_NULL_OR(IS_IN_SET(["circle", "square", "star", "x", "cross", "triangle"]))),
Field("size", "integer"),
Field("colour", requires=IS_NULL_OR(IS_HTML_COLOUR())),
+ gis_opacity()(),
*meta_fields())
# ---------------------------------------------------------------------
View
54 modules/eden/survey.py
@@ -2063,6 +2063,29 @@ def seriesMap(r, **attr):
value=pqstn_name)
# Set up the legend
+ priorityObj = S3AnalysisPriority(range=[-.66, .66],
+ colour={-1:"#888888", # grey
+ 0:"#008000", # green
+ 1:"#FFFF00", # yellow
+ 2:"#FF0000", # red
+ },
+ # Make Higher-priority show up more clearly
+ opacity={-1:0.5,
+ 0:0.6,
+ 1:0.7,
+ 2:0.8,
+ },
+ image={-1:"grey",
+ 0:"green",
+ 1:"yellow",
+ 2:"red",
+ },
+ desc={-1:"No Data",
+ 0:"Low",
+ 1:"Average",
+ 2:"High",
+ },
+ zero = True)
for series_id in seriesList:
series_name = survey_getSeriesName(series_id)
response_locations = getLocationList(series_id)
@@ -2079,23 +2102,6 @@ def seriesMap(r, **attr):
analysisTool.advancedResults()
else:
analysisTool = None
- priorityObj = S3AnalysisPriority(range=[-.66, .66],
- colour={-1:"#888888", # grey
- 0:"#008000", # green
- 1:"#FFFF00", # yellow
- 2:"#FF0000", # red
- },
- image={-1:"grey",
- 0:"green",
- 1:"yellow",
- 2:"red",
- },
- desc={-1:"No Data",
- 0:"Low",
- 1:"Average",
- 2:"High",
- },
- zero = True)
if analysisTool != None and not math.isnan(analysisTool.mean):
pBand = analysisTool.priorityBand(priorityObj)
legend = TABLE(
@@ -2113,7 +2119,8 @@ def seriesMap(r, **attr):
if len(response_locations) > 0:
for i in range( 0 , len( response_locations) ):
- complete_id = response_locations[i].complete_id
+ location = response_locations[i]
+ complete_id = location.complete_id
# Insert how we want this to appear on the map
url = URL(c="survey",
f="series",
@@ -2123,16 +2130,17 @@ def seriesMap(r, **attr):
"read"
]
)
- response_locations[i].shape = "circle"
- response_locations[i].size = 5
+ location.shape = "circle"
+ location.size = 5
if analysisTool is None:
priority = -1
else:
priority = analysisTool.priority(complete_id,
priorityObj)
- response_locations[i].colour = priorityObj.colour[priority]
- response_locations[i].popup_url = url
- response_locations[i].popup_label = response_locations[i].name
+ location.colour = priorityObj.colour[priority]
+ location.opacity = priorityObj.opacity[priority]
+ location.popup_url = url
+ location.popup_label = response_locations[i].name
feature_queries.append({ "name": "%s: Assessments" % series_name,
"query": response_locations,
"active": True })
View
2  modules/s3/s3gis.py
@@ -3980,6 +3980,8 @@ def add_javascript(script):
rowdict["size"] = row["size"]
if "colour" in row:
rowdict["colour"] = row["colour"]
+ if "opacity" in row:
+ rowdict["opacity"] = row["opacity"]
record_id = fqtable.insert(**rowdict)
if not created_by:
auth.s3_make_session_owner(fqtable, record_id)
View
12 modules/s3/s3msg.py
@@ -356,14 +356,14 @@ def parse_message(message=""):
# =========================================================================
def process_log(self):
"""
- Processes the unparsed messages in msg_log.
- """
+ Processes the unparsed messages in msg_log
+ """
+
db = current.db
- s3db = current.s3db
- ltable = s3db.msg_log
+ ltable = current.s3db.msg_log
- query = (ltable.is_parsed == False)& \
- (ltable.inbound == True)
+ query = (ltable.is_parsed == False) & \
+ (ltable.inbound == True)
rows = db(query).select()
for row in rows:
View
34 modules/s3/s3survey.py
@@ -2743,26 +2743,36 @@ def __init__(self,
4:"#FF0000", # red
5:"#880088", # purple
},
+ # Make Higher-priority show up more clearly
+ opacity={-1:0.5,
+ 0:0.6,
+ 1:0.6,
+ 2:0.7,
+ 3:0.7,
+ 4:0.8,
+ 5:0.8,
+ },
image={-1:"grey",
- 0:"blue",
- 1:"green",
- 2:"yellow",
- 3:"orange",
- 4:"red",
- 5:"purple",
+ 0:"blue",
+ 1:"green",
+ 2:"yellow",
+ 3:"orange",
+ 4:"red",
+ 5:"purple",
},
desc={-1:"No Data",
- 0:"Very Low",
- 1:"Low",
- 2:"Medium Low",
- 3:"Medium High",
- 4:"High",
- 5:"Very High",
+ 0:"Very Low",
+ 1:"Low",
+ 2:"Medium Low",
+ 3:"Medium High",
+ 4:"High",
+ 5:"Very High",
},
zero = True
):
self.range = range
self.colour = colour
+ self.opacity = opacity
self.image = image
self.description = desc
View
7 modules/s3/s3xml.py
@@ -155,9 +155,6 @@ class S3XML(S3Codec):
lonmin="lonmin",
lonmax="lonmax",
marker="marker",
- shape="shape", # for GIS Feature Queries
- size="size", # for GIS Feature Queries
- colour="colour",# for GIS Feature Queries
popup="popup", # for GIS Feature Layers/Queries
sym="sym", # For GPS
type="type",
@@ -633,10 +630,6 @@ def gis_encode(self,
@param rmap: list of references to encode
@param download_url: download URL of this instance
@param marker: marker dict or filename
- @param shape: shape as alternative to marker
- @param size: size of shape
- @param colour: colour of shape
- @param popup_url: URL used for onClick Popup contents
"""
gis = current.gis
View
5 static/formats/geojson/export.xsl
@@ -199,6 +199,11 @@
<colour>
<xsl:value-of select="data[@field='colour']"/>
</colour>
+ <xsl:if test="data[@field='opacity']!=''">
+ <opacity>
+ <xsl:value-of select="data[@field='opacity']"/>
+ </opacity>
+ </xsl:if>
</xsl:otherwise>
</xsl:choose>
</properties>
View
31 static/scripts/S3/s3.gis.layers.js
@@ -327,7 +327,7 @@ function addGeoJSONLayer(layer) {
labelAlign: 'cm',
pointRadius: '${radius}',
fillColor: '${fill}',
- fillOpacity: opacity,
+ fillOpacity: '${fillOpacity}',
strokeColor: '${stroke}',
strokeWidth: 2,
strokeOpacity: opacity,
@@ -393,15 +393,6 @@ function addGeoJSONLayer(layer) {
}
return pix;
},
- //graphicOpacity: function(feature) {
- // Unclustered Point
- // var opacity = styleMarker.opacity;
- // Clustered Point
- // if (feature.cluster) {
- // opacity = '';
- // }
- // return opacity;
- //},
graphicName: function(feature) {
if (feature.cluster) {
// Clustered Point
@@ -467,6 +458,24 @@ function addGeoJSONLayer(layer) {
}
return color;
},
+ fillOpacity: function(feature) {
+ if (feature.cluster) {
+ if (feature.cluster[0].attributes.opacity) {
+ // Use opacity from features
+ var opacity = feature.cluster[0].attributes.opacity;
+ } else {
+ // default fillOpacity for Clustered Point
+ var opacity = opacity;
+ }
+ } else if (feature.attributes.opacity) {
+ // Use opacity from feature
+ var opacity = feature.attributes.opacity;
+ } else {
+ // default fillOpacity for Unclustered Point
+ var opacity = opacity;
+ }
+ return opacity;
+ },
stroke: function(feature) {
if (feature.cluster) {
if (feature.cluster[0].attributes.colour) {
@@ -485,7 +494,7 @@ function addGeoJSONLayer(layer) {
var color = feature.attributes.colour;
if ( color.indexOf('#') == -1) {
// gis_layer_theme
- color = '#FFFFFF';
+ color = '#' + color;
}
} else {
// default strokeColor for Unclustered Point
View
11 static/scripts/S3/s3.gis.min.js
@@ -27,11 +27,12 @@ function addBingLayers(){var a=S3.gis.Bing,b=a.ApiKey,c;if(a.Aerial){c=new OpenL
function addDraftLayer(){var a=S3.gis.marker_url+S3.gis.marker_default,b=S3.gis.marker_default_height,c=S3.gis.marker_default_width,d=OpenLayers.Util.extend({},OpenLayers.Feature.Vector.style["default"]);d.graphicOpacity=1;d.graphicWidth=c;d.graphicHeight=b;d.graphicXOffset=-(c/2);d.graphicYOffset=-b;d.externalGraphic=a;S3.gis.draftLayer=new OpenLayers.Layer.Vector(S3.i18n.gis_draft_layer,{style:d,displayInLayerSwitcher:false});S3.gis.draftLayer.setVisibility(true);map.addLayer(S3.gis.draftLayer)}
OpenLayers.Strategy.AttributeCluster=OpenLayers.Class(OpenLayers.Strategy.Cluster,{attribute:null,shouldCluster:function(a,b){var c=OpenLayers.Strategy.Cluster.prototype;return a.cluster[0].attributes[this.attribute]===b.attributes[this.attribute]&&c.shouldCluster.apply(this,arguments)},CLASS_NAME:"OpenLayers.Strategy.AttributeCluster"});
function addGeoJSONLayer(a){var b=a.name,c=a.url;if(void 0!=a.marker_image)var d=S3.gis.marker_url+a.marker_image,f=a.marker_height,e=a.marker_width;else d="";var g=void 0!=a.refresh?a.refresh:900;if(void 0!=a.dir){var h=a.dir;$.inArray(h,S3.gis.dirs)==-1&&S3.gis.dirs.push(h)}else h="";var j=void 0!=a.visibility?a.visibility:true,l=void 0!=a.opacity?a.opacity:1,m=void 0!=a.cluster_distance?a.cluster_distance:S3.gis.cluster_distance,o=void 0!=a.cluster_threshold?a.cluster_threshold:S3.gis.cluster_threshold,
-k=void 0!=a.projection?a.projection:4326,k=4326==k?S3.gis.proj4326:new OpenLayers.Projection("EPSG:"+k),l=new OpenLayers.Style({label:"${label}",labelAlign:"cm",pointRadius:"${radius}",fillColor:"${fill}",fillOpacity:l,strokeColor:"${stroke}",strokeWidth:2,strokeOpacity:l,graphicWidth:"${graphicWidth}",graphicHeight:"${graphicHeight}",graphicXOffset:"${graphicXOffset}",graphicYOffset:"${graphicYOffset}",graphicOpacity:l,graphicName:"${graphicName}",externalGraphic:"${externalGraphic}"},{context:{graphicWidth:function(a){return a.cluster?
-"":a.attributes.marker_width?a.attributes.marker_width:e},graphicHeight:function(a){return a.cluster?"":a.attributes.marker_height?a.attributes.marker_height:f},graphicXOffset:function(a){return a.cluster?"":a.attributes.marker_width?-(a.attributes.marker_width/2):-(e/2)},graphicYOffset:function(a){return a.cluster?"":a.attributes.marker_height?-a.attributes.marker_height:-f},graphicName:function(a){return a.cluster?"circle":a.attributes.shape?a.attributes.shape:"circle"},externalGraphic:function(a){return a.cluster?
-"":a.attributes.marker_url?a.attributes.marker_url:d},radius:function(a){return a.cluster?Math.min(a.attributes.count/2,8)+10:a.attributes.size?a.attributes.size:10},fill:function(a){if(a.cluster)if(a.cluster[0].attributes.colour){a=a.cluster[0].attributes.colour;a.indexOf("#")==-1&&(a="#"+a)}else a="#8087ff";else if(a.attributes.colour){a=a.attributes.colour;a.indexOf("#")==-1&&(a="#"+a)}else a="#f5902e";return a},stroke:function(a){if(a.cluster)if(a.cluster[0].attributes.colour){a=a.cluster[0].attributes.colour;
-a.indexOf("#")==-1&&(a="#"+a)}else a="#2b2f76";else if(a.attributes.colour){a=a.attributes.colour;a.indexOf("#")==-1&&(a="#FFFFFF")}else a="#f5902e";return a},label:function(a){var b="";if(a.cluster&&a.attributes.count>1)b=a.attributes.count;return b}}}),l=new OpenLayers.StyleMap({"default":l,select:{fillColor:"#ffdc33",strokeColor:"#ff9933"}}),a=new OpenLayers.Layer.Vector(b,{dir:h,projection:k,strategies:[new OpenLayers.Strategy.BBOX({ratio:1.5}),new OpenLayers.Strategy.Refresh({force:true,interval:g*
-1E3}),new OpenLayers.Strategy.AttributeCluster({attribute:"colour",distance:m,threshold:o})],layer_id:a.id,legendURL:d,styleMap:l,protocol:new OpenLayers.Protocol.HTTP({url:c,format:S3.gis.format_geojson})});a.setVisibility(j);a.events.on({featureselected:onGeojsonFeatureSelect,featureunselected:onFeatureUnselect,loadstart:showThrobber,loadend:hideThrobber,loadcancel:hideThrobber});map.addLayer(a);S3.gis.layers_all.push(a)}
+k=void 0!=a.projection?a.projection:4326,k=4326==k?S3.gis.proj4326:new OpenLayers.Projection("EPSG:"+k),l=new OpenLayers.Style({label:"${label}",labelAlign:"cm",pointRadius:"${radius}",fillColor:"${fill}",fillOpacity:"${fillOpacity}",strokeColor:"${stroke}",strokeWidth:2,strokeOpacity:l,graphicWidth:"${graphicWidth}",graphicHeight:"${graphicHeight}",graphicXOffset:"${graphicXOffset}",graphicYOffset:"${graphicYOffset}",graphicOpacity:l,graphicName:"${graphicName}",externalGraphic:"${externalGraphic}"},
+{context:{graphicWidth:function(a){return a.cluster?"":a.attributes.marker_width?a.attributes.marker_width:e},graphicHeight:function(a){return a.cluster?"":a.attributes.marker_height?a.attributes.marker_height:f},graphicXOffset:function(a){return a.cluster?"":a.attributes.marker_width?-(a.attributes.marker_width/2):-(e/2)},graphicYOffset:function(a){return a.cluster?"":a.attributes.marker_height?-a.attributes.marker_height:-f},graphicName:function(a){return a.cluster?"circle":a.attributes.shape?a.attributes.shape:
+"circle"},externalGraphic:function(a){return a.cluster?"":a.attributes.marker_url?a.attributes.marker_url:d},radius:function(a){return a.cluster?Math.min(a.attributes.count/2,8)+10:a.attributes.size?a.attributes.size:10},fill:function(a){if(a.cluster)if(a.cluster[0].attributes.colour){a=a.cluster[0].attributes.colour;a.indexOf("#")==-1&&(a="#"+a)}else a="#8087ff";else if(a.attributes.colour){a=a.attributes.colour;a.indexOf("#")==-1&&(a="#"+a)}else a="#f5902e";return a},fillOpacity:function(a){if(a.cluster){if(a.cluster[0].attributes.opacity)var b=
+a.cluster[0].attributes.opacity}else if(a.attributes.opacity)b=a.attributes.opacity;return b},stroke:function(a){if(a.cluster)if(a.cluster[0].attributes.colour){a=a.cluster[0].attributes.colour;a.indexOf("#")==-1&&(a="#"+a)}else a="#2b2f76";else if(a.attributes.colour){a=a.attributes.colour;a.indexOf("#")==-1&&(a="#"+a)}else a="#f5902e";return a},label:function(a){var b="";if(a.cluster&&a.attributes.count>1)b=a.attributes.count;return b}}}),l=new OpenLayers.StyleMap({"default":l,select:{fillColor:"#ffdc33",
+strokeColor:"#ff9933"}}),a=new OpenLayers.Layer.Vector(b,{dir:h,projection:k,strategies:[new OpenLayers.Strategy.BBOX({ratio:1.5}),new OpenLayers.Strategy.Refresh({force:true,interval:g*1E3}),new OpenLayers.Strategy.AttributeCluster({attribute:"colour",distance:m,threshold:o})],layer_id:a.id,legendURL:d,styleMap:l,protocol:new OpenLayers.Protocol.HTTP({url:c,format:S3.gis.format_geojson})});a.setVisibility(j);a.events.on({featureselected:onGeojsonFeatureSelect,featureunselected:onFeatureUnselect,
+loadstart:showThrobber,loadend:hideThrobber,loadcancel:hideThrobber});map.addLayer(a);S3.gis.layers_all.push(a)}
function addGoogleLayers(){var a=S3.gis.Google,b;if(a.MapMaker||a.MapMakerHybrid){if(a.Satellite){b=new OpenLayers.Layer.Google(a.Satellite.name,{type:G_SATELLITE_MAP,sphericalMercator:true,layer_id:a.Satellite.id});map.addLayer(b);a.Base=="satellite"&&map.setBaseLayer(b)}if(a.Maps){b=new OpenLayers.Layer.Google(a.Maps.name,{type:G_NORMAL_MAP,sphericalMercator:true,layer_id:a.Maps.id});map.addLayer(b);a.Base=="maps"&&map.setBaseLayer(b)}if(a.Hybrid){b=new OpenLayers.Layer.Google(a.Hybrid.name,{type:G_HYBRID_MAP,
sphericalMercator:true,layer_id:a.Hybrid.id});map.addLayer(b);a.Base=="maps"&&map.setBaseLayer(b)}if(a.Terrain){b=new OpenLayers.Layer.Google(a.Terrain.name,{type:G_PHYSICAL_MAP,sphericalMercator:true,layer_id:a.Terrain.id});map.addLayer(b);a.Base=="terrain"&&map.setBaseLayer(b)}if(a.MapMaker){b=new OpenLayers.Layer.Google(a.MapMaker.name,{type:G_MAPMAKER_NORMAL_MAP,sphericalMercator:true,layer_id:b.id});map.addLayer(b);a.Base=="mapmaker"&&map.setBaseLayer(b)}if(a.MapMakerHybrid){b=new OpenLayers.Layer.Google(a.MapMakerHybrid.name,
{type:G_MAPMAKER_HYBRID_MAP,sphericalMercator:true,layer_id:b.id});map.addLayer(b);a.Base=="mapmakerhybrid"&&map.setBaseLayer(b)}}else{if(a.Satellite){b=new OpenLayers.Layer.Google(a.Satellite.name,{type:"satellite",numZoomLevels:22,layer_id:a.Satellite.id});map.addLayer(b);a.Base=="satellite"&&map.setBaseLayer(b)}if(a.Maps){b=new OpenLayers.Layer.Google(a.Maps.name,{numZoomLevels:20,layer_id:a.Maps.id});map.addLayer(b);a.Base=="maps"&&map.setBaseLayer(b)}if(a.Hybrid){b=new OpenLayers.Layer.Google(a.Hybrid.name,

No commit comments for this range

Something went wrong with that request. Please try again.