Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 176 lines (133 sloc) 8.065 kb
2b6955a Fix gemnasium format from md to rdoc
Renzo Sanchez-Silva authored
1 {<img src="https://gemnasium.com/rnz0/rgeoserver.png" alt="Dependency Status" />}[https://gemnasium.com/rnz0/rgeoserver]
e1c6da8 @rnz0 Update master
authored
2 {<img src="https://secure.travis-ci.org/rnz0/rgeoserver.png" />}[http://travis-ci.org/rnz0/rgeoserver]
2d1c5d1 Adding gemnasium dependency check
Renzo Sanchez-Silva authored
3
be0505b @rnz0 Update README.rdoc
authored
4 == RGeoServer
14c82cb First commit
Renzo Sanchez-Silva authored
5
e73eca4 Changing project title description and adding gwc seed in front example
Renzo Sanchez-Silva authored
6 RGeoServer is a Ruby client for the GeoServer RESTful Configuration interface.
14c82cb First commit
Renzo Sanchez-Silva authored
7
8 It provides primitive Ruby model abstraction.
9
10 == Documentation
11 The GeoServer REST Configuration API Reference can be found here:
12
9199d39 Fix doc link. Thanks waynegraham
rnz0 authored
13 http://docs.geoserver.org/stable/en/user/rest/index.html
14c82cb First commit
Renzo Sanchez-Silva authored
14
15
16 == Installation
17
18 $ gem install rgeoserver
19
20
21 == Example:
22
b7ed266 Logging instructions for readme file
Renzo Sanchez-Silva authored
23 Sample usage from an irb console
24
14c82cb First commit
Renzo Sanchez-Silva authored
25 > catalog = RGeoServer::Catalog.new :user=>"admin", :url=>"http://10.0.0.2/geoserver/rest", :password=>"osgeo!"
26 => Catalog: http://10.0.0.2/geoserver/rest
27 > w = catalog.get_workspace('topp')
28 => RGeoServer::Workspace: topp
29 > ds = w.data_stores.first
30 => RGeoServer::DataStore: states_shapefile
31 > ds.profile
32 => {"name"=>"states_shapefile", "enabled"=>"true", "connectionParameters"=>{"url"=>"file:data/shapefiles/states.shp", "namespace"=>"http://www.openplans.org/topp"}, "featureTypes"=>["states"]}
33 > ft = ds.featuretypes.first
34 => RGeoServer::FeatureType: states
35 > ft.profile
36 => {:name=>"states", :workspace=>"topp", :nativeName=>"states"}
37
8893fe4 Initial implementation of styles. Referencing back to layers. Not sav…
Renzo Sanchez-Silva authored
38 > lyr = RGeoServer::Layer.new c, :name => 'Arc_Sample'
8ba3707 Fix lyr profile in README
Renzo Sanchez-Silva authored
39 => RGeoServer::Layer: Arc_Sample
8893fe4 Initial implementation of styles. Referencing back to layers. Not sav…
Renzo Sanchez-Silva authored
40 > lyr.profile
8ba3707 Fix lyr profile in README
Renzo Sanchez-Silva authored
41 => {"name"=>"Arc_Sample", "path"=>"/", "defaultstyle"=>"rain", "styles"=>["raster"], "type"=>"RASTER", "enabled"=>"true", "attribution"=>{"logoWidth"=>"0", "logoHeight"=>"0"}, "resource"=>{"type"=>"coverage", "name"=>"Arc_Sample", "store"=>"arcGridSample", "workspace"=>"nurc"}, "metadata"=>{"GWC.autoCacheStyles"=>"true", "GWC.metaTilingX"=>"4", "GWC.metaTilingY"=>"4", "GWC.gutter"=>"0", "GWC.cachedNonDefaultStyles"=>"raster", "GWC.enabled"=>"true", "GWC.cacheFormats"=>"image/jpeg,image/png", "GWC.gridSets"=>"EPSG:4326,EPSG:900913"}}
8893fe4 Initial implementation of styles. Referencing back to layers. Not sav…
Renzo Sanchez-Silva authored
42 > sld = lyr.styles.first
8ba3707 Fix lyr profile in README
Renzo Sanchez-Silva authored
43 => RGeoServer::Style: raster
8893fe4 Initial implementation of styles. Referencing back to layers. Not sav…
Renzo Sanchez-Silva authored
44 > sld.profile
8ba3707 Fix lyr profile in README
Renzo Sanchez-Silva authored
45 => {"name"=>"raster", "sld_version"=>"1.0.0", "filename"=>"raster.sld", "sld"=>{"sld_name"=>"raster", "sld_title"=>"Default Raster"}}
46
8893fe4 Initial implementation of styles. Referencing back to layers. Not sav…
Renzo Sanchez-Silva authored
47
2d1d5e8 Fix importing Confstruct and adding meaningful complete sample script
Renzo Sanchez-Silva authored
48 A full sample script creating coverage stores in a small cluster:
49
50 require 'rgeoserver'
51
52 layers = {
53 'south_america_1787' => {
54 'url' => 'file:///geo_data/rumsey/g0411047.tif',
55 'description' => "Map of South America by D'Anville",
56 'type' => 'GeoTIFF'
57 },
58 'city_of_san_francisco_1859' => {
59 'url' => 'file:///geo_data/rumsey/g1030000alpha.tif',
60 'description' => 'Map of San Francisco by the U.S. Coast Survey, with detail of the unsettled lands',
61 'type' => 'GeoTIFF'
62 }
63 }
64
65 (1..7).each do |cat_id|
66 cat = RGeoServer::Catalog.new :user=>'admin', :url => "http://geoserver-app#{cat_id}/rest", :password => "osgeo!"
9b80fb8 Fix to batch example and new specs
Renzo Sanchez-Silva authored
67 ws = cat.get_default_workspace
2d1c5d1 Adding gemnasium dependency check
Renzo Sanchez-Silva authored
68 cat.list(RGeoServer::CoverageStore, layers.keys, :workspace => ws) do |cs|
2d1d5e8 Fix importing Confstruct and adding meaningful complete sample script
Renzo Sanchez-Silva authored
69 cs.url = layers[cs.name]['url']
70 cs.data_type = layers[cs.name]['type']
71 cs.enabled = 'true'
72 cs.save
9b80fb8 Fix to batch example and new specs
Renzo Sanchez-Silva authored
73 # Create the corresponding layer
74 c = RGeoServer::Coverage.new cat, :workspace => ws, :coverage_store => cs, :name => cs.name
75 c.title = cs_name.gsub('_',' ').titleize
76 c.abstract = layers[cs.name]['description']
77 c.save
e73eca4 Changing project title description and adding gwc seed in front example
Renzo Sanchez-Silva authored
78 # Seed the tile cache
79 l = RGeoServer::Layer.new cat, :name => cs.name
80 l.seed :issue, {
81 :srs => {
82 :number => 4326
83 },
84 :zoomStart => 1,
85 :zoomStop => 10,
86 :format => 'image/png',
87 :threadCount => 1
88 }
2d1d5e8 Fix importing Confstruct and adding meaningful complete sample script
Renzo Sanchez-Silva authored
89 end
90 end
91
92
0b44180 Adding testing instructions
Renzo Sanchez-Silva authored
93 == Testing
8c3507c Minor typo
Renzo Sanchez-Silva authored
94 We use {jettywrapper}[https://github.com/projecthydra/jettywrapper] to wrap a test instance of GeoServer. In theory, you should be able to point to any other local installation. Suppose that you download the binary stable version 2.1.3 binary from {here}[http://sourceforge.net/project/downloading.php?groupname=geoserver&filename=geoserver-2.1.3-bin.zip&use_mirror=softlayer], then unzip it under say, /tmp/geoserver-2.1.3. The integration tests are executed as follows:
b7ed266 Logging instructions for readme file
Renzo Sanchez-Silva authored
95 $ rake integration['/tmp/geoserver-2.1.3','8080','-DGEOSERVER_DATA_DIR=data_dir']
96
97 If you have the test instance running already on port 8080, you can run the tests simply with:
98
99 $ rake
5af5004 Adding testing instructions
Renzo Sanchez-Silva authored
100
25878b4 Fixing yard task
Renzo Sanchez-Silva authored
101 To generate the documentation run:
b7ed266 Logging instructions for readme file
Renzo Sanchez-Silva authored
102 $ rake yard
14c82cb First commit
Renzo Sanchez-Silva authored
103
25878b4 Fixing yard task
Renzo Sanchez-Silva authored
104 To enter into an irb console with all classess loaded:
b7ed266 Logging instructions for readme file
Renzo Sanchez-Silva authored
105 $ rake console
106
107 == Logging
0c88d0c @rnz0 Update README.rdoc
authored
108 For now we use {RestClient's}[https://github.com/archiloque/rest-client] base logger. It can be enabled by setting:
b7ed266 Logging instructions for readme file
Renzo Sanchez-Silva authored
109
110 RestClient.log = '/tmp/restclient.log'
111
f04437e Sample logging a script
Renzo Sanchez-Silva authored
112 or set an environment variable, for example:
113
114 $ RESTCLIENT_LOG=stdout ruby ingest_layer.rb
115 RestClient.get "http://localhost:8080/geoserver/rest/workspaces/cite.xml", "Accept"=>"application/xml", "Accept-Encoding"=>"gzip, deflate", "Content-Type"=>"application/xml"
116 # => 200 OK | application/xml 662 bytes
117 RestClient.get "http://localhost:8080/geoserver/rest/workspaces/cite/coveragestores/city_of_san_francisco_1859.xml", "Accept"=>"application/xml", "Accept-Encoding"=>"gzip, deflate", "Content-Type"=>"application/xml"
118 # => 404 NotFound | text/plain 73 bytes
119 RestClient.post "http://localhost:8080/geoserver/rest/workspaces/cite/coveragestores", "<?xml version=\"1.0\"?>\n<coverageStore>\n <name>city_of_san_francisco_1859</name>\n <workspace>\n <name>cite</name>\n </workspace>\n <enabled>true</enabled>\n <type>GeoTIFF</type>\n <description>Map of San Francisco by the U.S. Coast Survey, with detail of the unsettled lands</description>\n <url>file:///geo_data/rumsey/g1030000alpha.tif</url>\n</coverageStore>\n", "Accept"=>"application/xml", "Accept-Encoding"=>"gzip, deflate", "Content-Length"=>"363", "Content-Type"=>"application/xml"
120 # => 201 Created | 0 bytes
121
14c82cb First commit
Renzo Sanchez-Silva authored
122
123 == Related Resources
124 * {OSGeo The Open Source Geospatial Foundation}[http://www.osgeo.org]
125 * {GeoServer Project page}[http://docs.geoserver.org/stable/en/user/index.html]
5c97d85 Removing diagram image in rdoc
Renzo Sanchez-Silva authored
126 * {GeoServer Catalog design}[http://bit.ly/JrX1J8]
14c82cb First commit
Renzo Sanchez-Silva authored
127 * {GeoTools}[http://geotools.org/]
bf27ebe Adding to readme
Renzo Sanchez-Silva authored
128 * Implementation in other languages:
129 * Python: {gsconfig.py}[https://github.com/dwins/gsconfig.py]
14c82cb First commit
Renzo Sanchez-Silva authored
130
131 == Release History
132
1be2dfd Adding iterators
Renzo Sanchez-Silva authored
133 - <b>v0.5</b> - Initial alpha release
14c82cb First commit
Renzo Sanchez-Silva authored
134
135 == TODO
2d1c5d1 Adding gemnasium dependency check
Renzo Sanchez-Silva authored
136 - Complete data stores and coverages functionality and data upload.
5f5daf2 Adding Namespace and initial tests for it
Renzo Sanchez-Silva authored
137 - Complete updating data in objects. On failure, objects should roll back.
6349bac Layers are saving. More tests coming.
Renzo Sanchez-Silva authored
138 - Complete documentation.
139 - Complete test coverage:
9b80fb8 Fix to batch example and new specs
Renzo Sanchez-Silva authored
140 - Break down testing into separate specs per class.
6349bac Layers are saving. More tests coming.
Renzo Sanchez-Silva authored
141 - Add more flexibility for integration tests with embedded Jetty and other containers.
5f5daf2 Adding Namespace and initial tests for it
Renzo Sanchez-Silva authored
142 - Add ability to perform integration tests in a CI server.
f04437e Sample logging a script
Renzo Sanchez-Silva authored
143 - Provide more examples:
144 - Customize configuration.
145 - Connect under SSL.
146 - Batch processing.
8032576 @rnz0 Update travis-ci hook info, removing from TODO
authored
147 - Migrate base HTTP client to {Faraday}[https://github.com/technoweenie/faraday]?
9b80fb8 Fix to batch example and new specs
Renzo Sanchez-Silva authored
148 - Curlify operations: To provide optional log/output of the curl command that would produce the same
149 result as the ResourceInfo#save method.
14c82cb First commit
Renzo Sanchez-Silva authored
150
151 == Contributing with Patches and Pull requests checklist
152 * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
153 * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
154 * Fork the project
155 * Start a feature/bugfix branch
156 * Commit and push until you are happy with your contribution
157 * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
158 * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
159
160
161 == Acknowledgements
735d54f @rnz0 GWC operations were already done.
authored
162 Inspired on the {Rubydora}[https://github.com/cbeer/rubydora] gem. Followed somewhat closely to {gsconfig.py}[https://github.com/dwins/gsconfig.py]
14c82cb First commit
Renzo Sanchez-Silva authored
163
164 == Contributors
68cdaf6 @rnz0 Update README.rdoc
authored
165 This package is supported and maintained by Stanford University Libraries.
166
167 Bess Sadler <bess@stanford.edu>
14c82cb First commit
Renzo Sanchez-Silva authored
168
169 == License
170
ef8e0c9 @rnz0 adding Stanford copyright and license to Apache 2
authored
171 Copyright (c) 2012 Stanford University
14c82cb First commit
Renzo Sanchez-Silva authored
172
ef8e0c9 @rnz0 adding Stanford copyright and license to Apache 2
authored
173 Author: Renzo Sanchez-Silva <renzo.sanchez.silva@gmail.com>.
174
de38be7 @rnz0 correct reference to Apache Licence
authored
175 Licensed under the Apache License, Version 2.0
Something went wrong with that request. Please try again.