RGeo 0.3.3 Released

I’ve released RGeo 0.3.3. This is a bug fix release with several important fixes, and upgrading is highly recommended.

Changes include:

  • The WKRep WKT parser recognizes MultiPoint WKTs in which individual points are not contained in parens. This syntax is technically incorrect, but we are now supporting it because there was some ambiguity due to an error in early versions of the spec, and apparently there are now examples in the wild. (Reported by J Smith.)
  • The Geos CAPI implementation sometimes returned the wrong result from GeometryCollection#geometry_n. Fixed.
  • Fixed a hang when validating certain projected linestrings. (Patch contributed by Toby Rahilly.)
  • Several rdoc updates (including a contribution by Andy Allan).
  • Separated declarations and code in the C extensions to avert warnings on some compilers.

RGeo is a spatial data library for Ruby, providing full implementations of the standard spatial data types. It is the basis for a suite of useful gems for writing geospatial applications in Ruby and Rails. For more information, see the documentation at http://virtuoso.rubyforge.org/rgeo/README_rdoc.html.

Geo-Rails part 5: Spatial Data Formats

The location revolution is a revolution of data. Ubiquitous data, from mobile GPS and user input as well as from census and other datasets, is what makes location-aware applications possible. And so the first task of many geospatial projects is to determine how to find and utilize (and, in some cases, produce) external data.

In this article, we will survey some of the important spatial data formats, including serialization, file formats, and api-oriented formats. Specifically, we will look at:

  • Basic serialization using WKT and WKB
  • Variants on WKT and WKB
  • Reading public datasets from shapefiles
  • Web service oriented formats such as GeoJSON
  • XML-based formats commonly used in web services

We will also go over a few quick examples using Ruby and RGeo. This will be a fairly high-level overview and we won’t go into a lot of detail. We’ll take deeper looks at some of these formats in future articles.

This is part 5 of my continuing series of articles on geospatial programming in Ruby and Rails. For a list of the other installments, please visit http://www.daniel-azuma.com/blog/archives/category/tech/georails.

Continue reading

Geo-Rails part 4: Coordinate Systems and Projections

When people speak of a learning curve in geospatial programming, they’re usually referring to handling coordinate systems. It’s true that many spatial applications require close attention to the coordinate system, and it’s true that there are some difficult concepts involved. However, it’s been my experience that once the light bulb turns on, it opens up a lot of the power and potential of geodata.

In this article, we’ll take a first look at coordinate systems and geographic projections. We will:

  • Examine the importance and effect of coordinate system differences
  • Survey the various coordinate systems used for geospatial data
  • Become familiar with coordinate system representations and SRIDs
  • Specify coordinate systems in RGeo factories
  • Use RGeo to convert data between coordinate systems
  • Learn how to handle coordinate systems in Rails

This is part 4 of my continuing series of articles on geospatial programming in Ruby and Rails. For a list of the other installments, please visit http://www.daniel-azuma.com/blog/archives/category/tech/georails.

Continue reading

Geo-Rails part 3: Spatial Data Types with RGeo

RGeo is a library and framework for handling spatial data in a Ruby application. It’s currently designed more for completeness than ease of use, so there’s a bit of an initial learning curve. This article is an attempt to smooth that learning curve a bit. It contains a tutorial introduction to RGeo, covering the basics that every RGeo user needs to know, and a bit of discussion of where the library came from. Included is:

  • An introduction to the industry standard spatial data types
  • Working with spatial data objects in RGeo
  • Factories: why RGeo uses them and what they’re for
  • A comparison with GeoRuby
  • A guide to the RDocs

RGeo includes a number of advanced features which I’ll cover in future articles. But for now, I think these are the important topics that will get you started.

This is part 3 of my series of articles on geospatial programming in Ruby and Rails. For a list of the other installments, please visit http://www.daniel-azuma.com/blog/archives/category/tech/georails.

Continue reading