Skip to content

Commit

Permalink
The brazilian famous "jaba" on readme...
Browse files Browse the repository at this point in the history
  • Loading branch information
nofxx committed Dec 15, 2008
1 parent 956f0e1 commit 63d07e0
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 12 deletions.
29 changes: 20 additions & 9 deletions README.rdoc
@@ -1,5 +1,4 @@
== Postgis Adapter

= PostgisAdapter

A plugin for ActiveRecord which manages the PostGIS geometric columns
in a transparent way (that is like the other base data type columns).
Expand All @@ -16,18 +15,21 @@ Postgis Manual - http://postgis.refractions.net/documentation/manual-svn

If you are using Spatial Adapter, *remove it first*.


==== Dependencies

- georuby
- postgres 8.3+
- postgis 1.3+


==== As gem:

sudo gem sources --add http://gems.github.com
sudo gem install nofxx-postgis_adapter

config.gem "nofxx-postgis_adapter", :lib => "postgis_adapter", :source => "http://gems.github.com"


==== As plugin:

Expand All @@ -36,7 +38,6 @@ If you are using Spatial Adapter, *remove it first*.

=== How to Use


Geometric columns in your ActiveRecord models now appear just like
any other column of other basic data types. They can also be dumped
in ruby schema mode and loaded in migrations the same way as columns
Expand Down Expand Up @@ -90,6 +91,7 @@ Here are this fork additions. To use it:
@street.crosses?(@park)

@area.contains?(@place)


Polygons:

Expand All @@ -101,6 +103,7 @@ Polygons:

@park.overlaps?(@other_park)
=> false


Line Strings:

Expand Down Expand Up @@ -164,6 +167,7 @@ Or use a (almost) postgis like notation:
@area.bbox "@", @park



=== Warning

*To be fixed:*
Expand All @@ -173,6 +177,7 @@ implement a multi geom.

http://nofxx.lighthouseapp.com/projects/20712/tickets/3-multiple-geoms-in-model


=== Wiki

Check out the wiki pages (http://github.com/nofxx/postgis_adapter/wikis).
Expand Down Expand Up @@ -206,8 +211,8 @@ In PostGIS, since you can only use operations with geometries with the same SRID
Park.find_by_geom([[3,5.6],[19.98,5.9],123])


== Database Tools

== Database Tools

=== Migrations

Expand Down Expand Up @@ -244,14 +249,19 @@ the geometric column is a point:

== Geometric data types


Ruby geometric datatypes are currently made available only through
the GeoRuby library (http://georuby.rubyforge.org): This is where the
*Point.from_x_y* in the example above comes from. It is a goal
of a future release of the Spatial Adapter to support additional
geometric datatype libraries, such as Ruby/GEOS, as long as they
can support reading and writing of EWKB.

== Annotate

If you are using annotate_models, check out this fork which adds geometrical annotations for PostgisAdapter and SpatialAdapter:

http://github.com/nofxx/annotate_models


=== Warning

Expand All @@ -277,22 +287,23 @@ something like this :

== License


Spatial Adapter for Rails is released under the MIT license.
PostGis Adapter is released under the MIT license.
Postgis Adapter is released under the MIT license.


== Support


Tested using rails 2.2.2 / postgresql 8.3.5 / postgis 1.3.3 / linux / osx

Any questions, enhancement proposals, bug notifications or corrections:

=== PostGis Adapter

=== PostgisAdapter

Project Tracker http://nofxx.lighthouseapp.com/projects/20712-postgis_adapter


=== SpatialAdapter


guilhem.vellut+georuby@gmail.com.
8 changes: 7 additions & 1 deletion lib/postgis_functions/class.rb
Expand Up @@ -10,6 +10,9 @@ module PostgisFunctions
#
module ClassMethods

#
# Returns the closest record
#
def closest_to(p, srid=4326)
find(:first, :order => "ST_Distance(geom, GeomFromText('POINT(#{p.x} #{p.y})', #{srid}))" )
end
Expand All @@ -18,7 +21,10 @@ def close_to(p, srid=4326)
find(:all, :order => "ST_Distance(geom, GeomFromText('POINT(#{p.x} #{p.y})', #{srid}))" )
end

def by_size sort='asc'
#
#
#
def by_linestring_length sort='asc'
find(:all, :order => "ST_length(geom) #{sort}" )
end

Expand Down
4 changes: 2 additions & 2 deletions spec/spec.opts
@@ -1,6 +1,6 @@
--colour
--format
profile
spinner
--timeout
20
--diff
--diff

0 comments on commit 63d07e0

Please sign in to comment.