/spreader

Spreader is a gem which provides database-agnostic methods for facilitating the injection of coordinates into a data store.

Primary LanguageRuby

Spreader Build Status Gem Version

Installation

spreader can be installed via the execution of the following command:

gem install spreader

Usage

Given an XML file containing one node formatted in the following manner:

<coordinates>longitude_in_decimal_degrees,latitude_in_decimal_degrees[, altitude_in_decimal_degrees]</coordinates>

The method call is thus:

Spreader.sow(path_to_xml, model_name, latitude_field_name, longitude_field_name)

Given an XML file containing nodes formatted in the following manner:

<name>
	<coordinates>longitude_in_decimal_degrees,latitude_in_decimal_degrees[, altitude_in_decimal_degrees]</coordinates>
	<coordinates>longitude_in_decimal_degrees,latitude_in_decimal_degrees[, altitude_in_decimal_degrees]</coordinates>
</name>

The method call is thus:

Spreader.sow(path_to_xml, model_name, latitude_field_name, longitude_field_name)

Given a newline delimited CSV file containing one or more lines formatted in the following manner:

longitude_in_decimal_degrees,latitude_in_decimal_degrees

The method call is thus:

Spreader.sow(path_to_csv, model_name, latitude_field_name, longitude_field_name)