Coder Social home page Coder Social logo

rgeo-geojson's Introduction

rgeo-geojson

Gem Version Build Status

rgeo-geojson is an extension to RGeo that provides GeoJSON encoding and decoding.

Summary

RGeo is a key component for writing location-aware applications in the Ruby programming language. At its core is an implementation of the industry standard OGC Simple Features Specification, which provides data representations of geometric objects such as points, lines, and polygons, along with a set of geometric analysis operations. See the README for the "rgeo" gem for more information.

RGeo::GeoJSON is an optional RGeo module that provides GeoJSON encoding and decoding. GeoJSON is a JSON format used for geographic data structures.

Example:

require 'rgeo/geo_json'

str1 = '{"type":"Point","coordinates":[1,2]}'
geom = RGeo::GeoJSON.decode(str1, json_parser: :json)
geom.as_text              # => "POINT(1.0 2.0)"

str2 = '{"type":"Feature","geometry":{"type":"Point","coordinates":[2.5,4.0]},"properties":{"color":"red"}}'
feature = RGeo::GeoJSON.decode(str2, json_parser: :json)
feature['color']          # => 'red'
feature.geometry.as_text  # => "POINT(2.5 4.0)"

hash = RGeo::GeoJSON.encode(feature)
hash.to_json == str2      # => true

Install

RGeo::GeoJSON has the following requirements:

  • Ruby 1.9.3 or later
  • rgeo 0.5.0 or later.

Include in your bundle:

gem 'rgeo-geojson'

Install rgeo-geojson as a gem:

gem install rgeo-geojson

See the README for the "rgeo" gem, a required dependency, for further installation information.

Development and support

RDoc Documentation is available at http://rdoc.info/gems/rgeo-geojson

Source code is hosted on Github at https://github.com/rgeo/rgeo-geojson

Contributions are welcome. Fork the project on Github.

Report bugs on Github issues at http://github.com/rgeo/rgeo-geojson/issues

Acknowledgments

RGeo was created by Daniel Azuma (http://www.daniel-azuma.com).

Development is supported by Pirq and Neighborland.

License

Copyright (c) Daniel Azuma, Tee Parham

https://github.com/rgeo/rgeo-geojson/blob/master/LICENSE.txt

rgeo-geojson's People

Contributors

teeparham avatar dazuma avatar tneems avatar rgarner avatar calebwoods avatar sethherr avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.