<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -9,3 +9,4 @@ coverage/*
 doc/*
 ext/*.bundle
 ext/*.so
+ext/Makefile</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -5,10 +5,10 @@ VALUE rb_distance;
 double HaversineDistance( double y1, double x1, double y2, double x2 )
 {
   double nRadius = 6370997.0; // Earth&#8217;s radius in Kilometers
-  double rad = 0.0174532925199433;  
+  double rad = 0.0174532925199433;
 	// Get the difference between our two points in radians
-	double nDLat = (y2 - y1) * rad;  
-	double nDLon = (x2 - x1) * rad; 
+	double nDLat = (y2 - y1) * rad;
+	double nDLon = (x2 - x1) * rad;
 	y1 *= rad;
   y2 *= rad;
 
@@ -19,68 +19,69 @@ double HaversineDistance( double y1, double x1, double y2, double x2 )
 }
 
 //
-double PythagoreanDistance( double y1, double x1, double y2, double x2 )
-{
-  double nR = sqrt( pow(x2 - x1) + pow( y2 - y1 ));
-  return nR;
-}
+/*double PythagoreanDistance( double y1, double x1, double y2, double x2 )*/
+/*{*/
+/*  double nR = sqrt( pow(x2 - x1) + pow( y2 - y1 ));*/
+/*  return nR;*/
+/*}*/
 
-double FlatEarthDistance(double y1, double x1, double y2, double x2 )
-{
-  double rad = 1.570796326794897;
-  double nRadius = 6370997.0; // Earth&#8217;s radius in Kilometers  
-  double nA = rad - y1;
-  double nB = rad - y2;
-  double nC = sqrt( pow(nA) + pow(nB) - 2 * nA * nB * cos(x2 - x1));
-  double nR = nRadius * nC;
-  return nR;
-}
+/*double FlatEarthDistance(double y1, double x1, double y2, double x2 )*/
+/*{*/
+/*  double rad = 1.570796326794897;*/
+/*  double nRadius = 6370997.0; // Earth&#8217;s radius in Kilometers*/
+/*  double nA = rad - y1;*/
+/*  double nB = rad - y2;*/
+/*  double nC = sqrt( pow(nA) + pow(nB) - 2 * nA * nB * cos(x2 - x1));*/
+/*  double nR = nRadius * nC;*/
+/*  return nR;*/
+/*}*/
 
 // Using Vincenty Formula
 //a is the semi-major axis (equatorial radius) of the ellipsoid
 // b is the semi-minor axis (polar radius) of the ellipsoid
 // Their values by default are set to the ones of the WGS84 ellipsoid
-double EllipsoidalDistance(double y1, double x1, double y2, double x2, double a = 1, double b )
-{
-  double rad = 0.0174532925199433;
-  double f = (a-b)/a;
-  double l, lambda = (x2 - x1) * rad;  
-  double u1 = atan((1-f) * tan(y1 * rad));
-  double u2 = atan((1-f) * tan(y2 * rad));    
-  double sinU1 = sin(u1);
-  double cosU1 = cos(u1);
-  double sinU2 = sin(u2);
-  double cosU2 = cos(u2);
-  double lambdaP = 6.283185307179586;
-  int iterLimit = 20;
-  
-  while(abs(lambda-lambdaP) &gt; 1e-12 &amp;&amp; iterLimit &gt; 0) {
-    double sinLambda = sin(lambda);
-    double cosLambda = cos(lambda);
-    double sinSigma = sqrt((cosU2*sinLambda) * (cosU2*sinLambda) + (cosU1*sinU2-sinU1*cosU2*cosLambda) * (cosU1*sinU2-sinU1*cosU2*cosLambda));    
-    if (sinSignma == 0) {
-      return 0;
-    }    
-    double cosSigma = sinU1*sinU2 + cosU1*cosU2*cosLambda;
-    double sigma = atan2(sinSigma, cosSigma);
-    double sinAlpha = cosU1 * cosU2 * sinLambda / sinSigma;
-    double cosSqAlpha = 1 - sinAlpha*sinAlpha;
-    double cos2SigmaM = cosSigma - 2*sinU1*sinU2/cosSqAlpha;
-    if (nan(cos2SigmaM)){
-      cos2SigmaM = 0;  //#equatorial line: cosSqAlpha=0
-    }    
-    double c = f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha));
-    lambdaP = lambda;
-    lambda = l + (1-c) * f * sinAlpha * (sigma + c * sinSigma * (cos2SigmaM + c * cosSigma * (-1 + 2 * cos2SigmaM * cos2SigmaM)));
-    return lambda
-  }   
-  if(iterLimit == 0){
-   return 0;
-  }   
-  double uSq = cosSqAlpha * (a*a - b*b) / (b*b);
-  double a_bis = 1 + uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq)));
-  double b_bis = uSq/1024 * (256+uSq*(-128+uSq*(74-47*uSq)));
-  double deltaSigma = b_bis * sinSigma*(cos2SigmaM + b_bis/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)- b_bis/6*cos2SigmaM*(-3+4*sinSigma*sinSigma)*(-3+4*cos2SigmaM*cos2SigmaM)));
-  double final = b*a_bis*(sigma-deltaSigma);
-  return final;  
-}
\ No newline at end of file
+/*double EllipsoidalDistance(double y1, double x1, double y2, double x2, double a, double b )*/
+/*{*/
+/*  double a = 1;*/
+/*  double rad = 0.0174532925199433;*/
+/*  double f = (a-b)/a;*/
+/*  double l, lambda = (x2 - x1) * rad;*/
+/*  double u1 = atan((1-f) * tan(y1 * rad));*/
+/*  double u2 = atan((1-f) * tan(y2 * rad));*/
+/*  double sinU1 = sin(u1);*/
+/*  double cosU1 = cos(u1);*/
+/*  double sinU2 = sin(u2);*/
+/*  double cosU2 = cos(u2);*/
+/*  double lambdaP = 6.283185307179586;*/
+/*  int iterLimit = 20;*/
+
+/*  while(abs(lambda-lambdaP) &gt; 1e-12 &amp;&amp; iterLimit &gt; 0) {*/
+/*    double sinLambda = sin(lambda);*/
+/*    double cosLambda = cos(lambda);*/
+/*    double sinSigma = sqrt((cosU2*sinLambda) * (cosU2*sinLambda) + (cosU1*sinU2-sinU1*cosU2*cosLambda) * (cosU1*sinU2-sinU1*cosU2*cosLambda));*/
+/*    if (sinSignma == 0) {*/
+/*      return 0;*/
+/*    }*/
+/*    double cosSigma = sinU1*sinU2 + cosU1*cosU2*cosLambda;*/
+/*    double sigma = atan2(sinSigma, cosSigma);*/
+/*    double sinAlpha = cosU1 * cosU2 * sinLambda / sinSigma;*/
+/*    double cosSqAlpha = 1 - sinAlpha*sinAlpha;*/
+/*    double cos2SigmaM = cosSigma - 2*sinU1*sinU2/cosSqAlpha;*/
+/*    if (nan(cos2SigmaM)){*/
+/*      cos2SigmaM = 0;  //#equatorial line: cosSqAlpha=0*/
+/*    }*/
+/*    double c = f/16*cosSqAlpha*(4+f*(4-3*cosSqAlpha));*/
+/*    lambdaP = lambda;*/
+/*    lambda = l + (1-c) * f * sinAlpha * (sigma + c * sinSigma * (cos2SigmaM + c * cosSigma * (-1 + 2 * cos2SigmaM * cos2SigmaM)));*/
+/*    return lambda*/
+/*  }*/
+/*  if(iterLimit == 0){*/
+/*   return 0;*/
+/*  }*/
+/*  double uSq = cosSqAlpha * (a*a - b*b) / (b*b);*/
+/*  double a_bis = 1 + uSq/16384*(4096+uSq*(-768+uSq*(320-175*uSq)));*/
+/*  double b_bis = uSq/1024 * (256+uSq*(-128+uSq*(74-47*uSq)));*/
+/*  double deltaSigma = b_bis * sinSigma*(cos2SigmaM + b_bis/4*(cosSigma*(-1+2*cos2SigmaM*cos2SigmaM)- b_bis/6*cos2SigmaM*(-3+4*sinSigma*sinSigma)*(-3+4*cos2SigmaM*cos2SigmaM)));*/
+/*  double final = b*a_bis*(sigma-deltaSigma);*/
+/*  return final;*/
+/*}*/</diff>
      <filename>ext/distance.c</filename>
    </modified>
    <modified>
      <diff>@@ -11,12 +11,12 @@ module GeorubyC
         super(srid,with_z,with_m)
         @points=[]
       end
-      
+
       #Delegate the unknown methods to the points array
       def method_missing(method_name,*args,&amp;b)
         @points.send(method_name,*args,&amp;b)
       end
-      
+
       #tests if the line string is closed
       def is_closed
         #a bit naive...
@@ -33,9 +33,9 @@ module GeorubyC
             max_y = point.y if point.y &gt; max_y
             min_y = point.y if point.y &lt; min_y
             max_x = point.x if point.x &gt; max_x
-            min_x = point.x if point.x &lt; min_x 
+            min_x = point.x if point.x &lt; min_x
             max_z = point.z if point.z &gt; max_z
-            min_z = point.z if point.z &lt; min_z 
+            min_z = point.z if point.z &lt; min_z
           end
           [Point.from_x_y_z(min_x,min_y,min_z),Point.from_x_y_z(max_x,max_y,max_z)]
         else
@@ -43,7 +43,7 @@ module GeorubyC
             max_y = point.y if point.y &gt; max_y
             min_y = point.y if point.y &lt; min_y
             max_x = point.x if point.x &gt; max_x
-            min_x = point.x if point.x &lt; min_x 
+            min_x = point.x if point.x &lt; min_x
           end
           [Point.from_x_y(min_x,min_y),Point.from_x_y(max_x,max_y)]
         end
@@ -61,10 +61,10 @@ module GeorubyC
           [0,0]
         end
       end
-      
+
       #Tests the equality of line strings
       def ==(other_line_string)
-        if(other_line_string.class != self.class or 
+        if(other_line_string.class != self.class or
              other_line_string.length != self.length)
           false
         else
@@ -79,67 +79,67 @@ module GeorubyC
 
       #call to native Geo intersect, return true or false
       def intersects?(other_line_string)
-        
+
       end
 
       def to_c
         f = []
         points.each do |p|
-         f &lt;&lt; Native::LineString.new(p[0],p[1])  
+         f &lt;&lt; Native::LineString.new(p[0],p[1])
          next
         end
         f
       end
       #Binary representation of a line string
-      def binary_representation(allow_z=true,allow_m=true) #:nodoc: 
+      def binary_representation(allow_z=true,allow_m=true) #:nodoc:
         rep = [length].pack(&quot;V&quot;)
         each {|point| rep &lt;&lt; point.binary_representation(allow_z,allow_m) }
         rep
       end
-      
+
       #WKB geometry type
-      def binary_geometry_type #:nodoc: 
+      def binary_geometry_type #:nodoc:
         2
       end
 
       #Text representation of a line string
-      def text_representation(allow_z=true,allow_m=true) #:nodoc: 
-        @points.collect{|point| point.text_representation(allow_z,allow_m) }.join(&quot;,&quot;) 
+      def text_representation(allow_z=true,allow_m=true) #:nodoc:
+        @points.collect{|point| point.text_representation(allow_z,allow_m) }.join(&quot;,&quot;)
       end
       #WKT geometry type
-      def text_geometry_type #:nodoc: 
+      def text_geometry_type #:nodoc:
         &quot;LINESTRING&quot;
       end
 
       #georss simple representation
-      def georss_simple_representation(options) #:nodoc: 
+      def georss_simple_representation(options) #:nodoc:
         georss_ns = options[:georss_ns] || &quot;georss&quot;
         geom_attr = options[:geom_attr]
         &quot;&lt;#{georss_ns}:line#{geom_attr}&gt;&quot; + georss_poslist + &quot;&lt;/#{georss_ns}:line&gt;\n&quot;
       end
       #georss w3c representation : outputs the first point of the line
-      def georss_w3cgeo_representation(options) #:nodoc: 
+      def georss_w3cgeo_representation(options) #:nodoc:
         w3cgeo_ns = options[:w3cgeo_ns] || &quot;geo&quot;
         &quot;&lt;#{w3cgeo_ns}:lat&gt;#{self[0].y}&lt;/#{w3cgeo_ns}:lat&gt;\n&lt;#{w3cgeo_ns}:long&gt;#{self[0].x}&lt;/#{w3cgeo_ns}:long&gt;\n&quot;
       end
       #georss gml representation
-      def georss_gml_representation(options) #:nodoc: 
+      def georss_gml_representation(options) #:nodoc:
         georss_ns = options[:georss_ns] || &quot;georss&quot;
         gml_ns = options[:gml_ns] || &quot;gml&quot;
-        
+
         result = &quot;&lt;#{georss_ns}:where&gt;\n&lt;#{gml_ns}:LineString&gt;\n&lt;#{gml_ns}:posList&gt;\n&quot;
         result += georss_poslist
         result += &quot;\n&lt;/#{gml_ns}:posList&gt;\n&lt;/#{gml_ns}:LineString&gt;\n&lt;/#{georss_ns}:where&gt;\n&quot;
       end
 
-      def georss_poslist #:nodoc: 
+      def georss_poslist #:nodoc:
         map {|point| &quot;#{point.y} #{point.x}&quot;}.join(&quot; &quot;)
       end
 
       #outputs the geometry in kml format : options are &lt;tt&gt;:id&lt;/tt&gt;, &lt;tt&gt;:tesselate&lt;/tt&gt;, &lt;tt&gt;:extrude&lt;/tt&gt;,
       #&lt;tt&gt;:altitude_mode&lt;/tt&gt;. If the altitude_mode option is not present, the Z (if present) will not be output (since
       #it won't be used by GE anyway: clampToGround is the default)
-      def kml_representation(options = {}) #:nodoc: 
+      def kml_representation(options = {}) #:nodoc:
         result = &quot;&lt;LineString#{options[:id_attr]}&gt;\n&quot;
         result += options[:geom_data] if options[:geom_data]
         result += &quot;&lt;coordinates&gt;&quot;
@@ -147,8 +147,8 @@ module GeorubyC
         result += &quot;&lt;/coordinates&gt;\n&quot;
         result += &quot;&lt;/LineString&gt;\n&quot;
       end
-      
-      def kml_poslist(options) #:nodoc: 
+
+      def kml_poslist(options) #:nodoc:
         pos_list = if options[:allow_z]
            map {|point| &quot;#{point.x},#{point.y},#{options[:fixed_z] || point.z || 0}&quot; }
         else
@@ -157,7 +157,7 @@ module GeorubyC
         pos_list.reverse! if(options[:reverse])
         pos_list.join(&quot; &quot;)
       end
-      
+
       #Creates a new line string. Accept an array of points as argument
       def self.from_points(points,srid=@@srid,with_z=false,with_m=false)
         line_string = new(srid,with_z,with_m)
@@ -171,7 +171,6 @@ module GeorubyC
         line_string.concat( points.map {|p| Point.from_coordinates(p,srid,with_z,with_m) } )
         line_string
       end
-
-     end
+    end
   end
 end</diff>
      <filename>lib/georuby_c/base/line_string.rb</filename>
    </modified>
    <modified>
      <diff>@@ -3,82 +3,84 @@ require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
 module LineSpecHelper
   def mock_points
 #    @point = mock(Point, :x =&gt; 1.0, :y =&gt; 2.0)
-    Array.new(7) { |i| mock(Point, :x =&gt; i, :y =&gt; i, :text_representation =&gt; &quot;#{i} #{i}&quot;) }
+    Array.new(7) { |i| mock_point(i,i) }
+  end
+
+  def mock_point(x=1,y=2)
+    mock(Point, :x =&gt; x, :y =&gt; y, :text_representation =&gt; &quot;#{x} #{y}&quot;)
   end
 end
 
-describe LineString do  
+describe LineString do
+  include LineSpecHelper
   before(:each) do
     @line = LineString.from_points([mock(Point)])
   end
-  
+
   it &quot;should instantiate&quot; do
     violated unless @line
   end
-  
+
   it &quot;should have binary_geometry_type 2&quot; do
     @line.binary_geometry_type.should eql(2)
   end
-  
+
   it &quot;should have text_geometry_type&quot; do
     @line.text_geometry_type.should eql(&quot;LINESTRING&quot;)
   end
-  
+
   it &quot;should have a points array&quot; do
     @line.points.should be_instance_of(Array)
   end
-  
+
   describe &quot;, from coordinates&quot; do
     before(:each) do
-      Point.should_receive(:anything)#.with('')
-      @line = LineString.from_coordinates([[1,2][2.2,4.5]])
+      Point.should_receive(:from_coordinates).
+        exactly(4).with(anything, 4326, false, false).and_return(mock_point)
+      @line = LineString.from_coordinates([1.2,2.5,2.2,4.5])
     end
-  
-    it &quot;should instantiate from coordinates&quot; do    
-      @line.should be_instance_of(LineString)
+
+    it &quot;should instantiate from coordinates&quot; do
+      @line.points.length.should eql(4)
     end
-    
-  
   end
+
   describe &quot;, Instantiated&quot; do
-    include LineSpecHelper
+
     before(:each) do
       @line = LineString.from_points(mock_points)
     end
-    
-    
+
     it &quot;should be closed if the last point equals the first&quot; do
       @line.push(@line.first)
       @line.should be_closed
       @line.length.should eql(8)
     end
-    
+
     it &quot;should print the text representation&quot; do
-      @line.text_representation.should eql(&quot;0 0,1 1,2 2,3 3,4 4,5 5,6 6&quot;)      
+      @line.text_representation.should eql(&quot;0 0,1 1,2 2,3 3,4 4,5 5,6 6&quot;)
     end
-    
+
     it &quot;should print the georss_simple_representation&quot; do
       @line.georss_simple_representation({:geom_attr =&gt; nil}).
         should eql(&quot;&lt;georss:line&gt;0 0 1 1 2 2 3 3 4 4 5 5 6 6&lt;/georss:line&gt;\n&quot;)
     end
-    
+
     it &quot;should map the georss_poslist&quot; do
       @line.georss_poslist.should eql(&quot;0 0 1 1 2 2 3 3 4 4 5 5 6 6&quot;)
     end
-    
+
     it &quot;should print the kml_representation&quot; do
-      @line.kml_representation.should 
-        eql(&quot;&lt;LineString&gt;\n&lt;coordinates&gt;0,0 1,1 2,2 3,3 4,4 5,5 6,6&lt;/coordinates&gt;\n&lt;/LineString&gt;\n&quot;)      
+      @line.kml_representation.should
+        eql(&quot;&lt;LineString&gt;\n&lt;coordinates&gt;0,0 1,1 2,2 3,3 4,4 5,5 6,6&lt;/coordinates&gt;\n&lt;/LineString&gt;\n&quot;)
     end
-    
+
     it &quot;should print the kml_poslist without reverse or z&quot; do
       @line.kml_poslist({}).should eql(&quot;0,0 1,1 2,2 3,3 4,4 5,5 6,6&quot;)
     end
-    
+
     it &quot;should print the kml_poslist reverse&quot; do
       @line.kml_poslist({:reverse =&gt; true}).should eql(&quot;6,6 5,5 4,4 3,3 2,2 1,1 0,0&quot;)
-    end    
+    end
   end
-  
-  
-end
\ No newline at end of file
+end</diff>
      <filename>spec/georuby_c/base/line_string_spec.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,6 +1,3 @@
-lib_path = File.expand_path(&quot;#{File.dirname(__FILE__)}/../../lib&quot;)
-$LOAD_PATH.unshift lib_path unless $LOAD_PATH.include?(lib_path)
-
 begin
   require 'spec'
 rescue LoadError
@@ -9,12 +6,13 @@ rescue LoadError
   require 'spec'
 end
 
+$:.unshift(File.dirname(__FILE__) + '/../lib')
 require 'georuby_c'
 include GeorubyC
 include Base
 
 Spec::Runner.configure do |config|
 
-  
-  
-end
\ No newline at end of file
+
+
+end</diff>
      <filename>spec/spec_helper.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>ext/Makefile</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>0b012a1ab1c29ad0493172b19009a1c45874df8d</id>
    </parent>
  </parents>
  <author>
    <name>Marcos Augusto</name>
    <email>x@nofxx.com</email>
  </author>
  <url>http://github.com/nofxx/georuby_c/commit/0a9571d3344007af00eb8c2acb4021171de01726</url>
  <id>0a9571d3344007af00eb8c2acb4021171de01726</id>
  <committed-date>2008-09-29T16:06:56-07:00</committed-date>
  <authored-date>2008-09-29T16:06:56-07:00</authored-date>
  <message>testing on linux</message>
  <tree>b6bf0c0c70e8209ac16acf8d3ca16fe09c0abc48</tree>
  <committer>
    <name>Marcos Augusto</name>
    <email>x@nofxx.com</email>
  </committer>
</commit>
