Module: MapLayers::GeoRSS
- Defined in:
- lib/map_layers.rb
Overview
GeoRSS Server methods www.georss.org/1
Instance Method Summary collapse
-
#georss ⇒ Object
Publish layer in GeoRSS format.
Instance Method Details
#georss ⇒ Object
Publish layer in GeoRSS format
241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/map_layers.rb', line 241 def georss rows = map_layers_config.model.find(:all, :limit => GEORSS_FEATURE_LIMIT) @features = rows.collect do |row| if map_layers_config.geometry Feature.from_geom(row.send(map_layers_config.text), row.send(map_layers_config.geometry), row.send(map_layers_config.id)) else Feature.new(row.send(map_layers_config.text), row.send(map_layers_config.lon), row.send(map_layers_config.lat)) end end @base_url = "http://#{request.env["HTTP_HOST"]}/" @item_url = "#{@base_url}#{map_layers_config.model_id.to_s.pluralize}" @title = map_layers_config.model_id.to_s.pluralize.humanize logger.info "MapLayers::GEORSS: returning #{@features.size} features" render :inline => GEORSS_XML_ERB, :content_type => "text/xml" rescue Exception => e logger.error "MapLayers::GEORSS: returning no features - Caught exception '#{e}'" render :text => GEORSS_EMPTY_RESPONSE, :content_type => "text/xml" end |