Project

ogc

0.0
No commit activity in last 3 years
No release in over 3 years
This gems allow you to make calls in using Web Feature Service protocol defined by OGC (Open Geospatial Consortium) organization.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 2.13
~> 5.8
~> 10.0
~> 0.35
~> 1.22

Runtime

< 5.1, >= 4.0
>= 1.6.6, ~> 1.6
 Project Readme

Ogc

Build Status Code Climate GitHub version

This gems allow you to make calls in using WFS or WPS protocol defined by OGC organization.

Installation

Add this line to your application's Gemfile:

gem 'ogc'

And then execute:

$ bundle

Or install it yourself as:

$ gem install ogc

Usage

Currently the gem OGC handles only some Web Feature Service calls.

To use it, you have two ways.

Either, you use the shortcut method of WebFeatureServicemodule:

# GetCapabilities
Ogc::WebFeatureService.get_capabilities('http://localhost/wfs', version: '1.0.0', key: 'SECRET')
#=> #<Ogc::WebFeatureService::GetCapabilities:0x007ffba414adc8 @url="http://localhost/wfs", @params={"version"=>"1.0.0", "key"=>"SECRET", "service"=>"wfs"}>

# GetFeature
Ogc::WebFeatureService.get_feature('http://localhost/wfs', version: '1.0.0', key: 'SECRET')
#=> #<Ogc::WebFeatureService::GetFeature:0x007ffba41ad720 @url="http://localhost/wfs", @params={"version"=>"1.0.0", "key"=>"SECRET", "service"=>"wfs"}>

Or use the class directly:

# GetCapabilities
Ogc::WebFeatureService::GetCapabilies.new('http://localhost/wfs', version: '1.0.0', key: 'SECRET')
#=> #<Ogc::WebFeatureService::GetCapabilities:0x007ffba414adc8 @url="http://localhost/wfs", @params={"version"=>"1.0.0", "key"=>"SECRET", "service"=>"wfs"}>

# GetFeature
Ogc::WebFeatureService::GetFeature.new('http://localhost/wfs', version: '1.0.0', key: 'SECRET')
#=> #<Ogc::WebFeatureService::GetFeature:0x007ffba41ad720 @url="http://localhost/wfs", @params={"version"=>"1.0.0", "key"=>"SECRET", "service"=>"wfs"}>

After that, you can use the methods #get and #post to resquest the endpoint.

ogc = Ogc::WebFeatureService::GetFeature.new('http://localhost/wfs', version: '1.0.0', key: 'SECRET')
ogc.get(:FEATURE_1, filter '…')
#=> Nokogiri::XML::Document

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/ogc. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.