Displaying 20 results from an estimated 9000 matches similar to: "Rounding Errors using GeoKit"
2009 Feb 23
2
geokit - using :through to connect models
hello..
i am currently trying to use :through to attach two of my models
together using geokit. for some reason, i am running into a problem:
ArgumentError: Unknown key(s): as
i have two models, one that is geocoded, and one that belongs to that
model. the models look like:
,----[ employer.rb ]
| class Employer < ActiveRecord::Base
| acts_as_mappable
| before_validation_on_create
2009 Sep 02
0
Geokit - find within fuzzy locations
I''m using Geokit gem to query mappable records within some distance to a
mappable user.
When geocoding an address such as "Madrid", lat&lng represent a point,
in this case the center of the city.
Suppose I have some records with location "Madrid", which are mapped
with lat & lng to the center of the city. When querying for the closest
record, the inaccuracy
2008 Nov 27
0
Rails Join problem
Hi, i''m trying to use the GeoKit plugin to calculate the distance
between 2 points. So the idea is, i do a search for an article, and
the results i want to order by distance. So i have a form where I
enter the article (that im looking for) and my address. Then rails
must find all articles that match with my query and order by address.
So now, i have two models: Article and User. Articles
2007 Dec 01
0
mock feed
Hello generous coders,
I''m having difficulty getting a couple of tests to pass.
I have an address model which takes an address and with a callback on save
and update passes the address to google''s
geocoding service. The returned XML is parsed and saved to the address
object:
protected
def geocode_address
key = "mykey"
url =
2008 Jul 06
1
GeoKit / Form Validation
I am new to rails and have been scouring the web for the past two days
trying to figure out 2 things.
1) I am currently using a form with 2 models. The first is person, the
second is address. I attempted to duplicate the two models on one form
as seen in Advanced Rails Recipes and Railscasts, and they work fine -
except when there are validation issues on the address piece it just
returns saying
2010 May 20
0
best practices for calling a web service (like geocode)
Guys,
I have a Customer class which creates an instance of an Address class,
and the user can then go into the show method of the Customer class
and associate other addresses with that Customer (sites). As soon as
an Address instance is created, I want to call geocoding to get the
latitude and longitude of that address so that I can later render a
map of all the sites. now, I suspect that a
2010 Dec 14
5
Build associated model confusion
I''m new to Rails3, and I''m just trying to get one last thing to work
before I call it a night. The situation is the following (please if
the code is horrible, just let me know, still learning):
I want to log a dive. I might have a new location on that dive at
which point I have to create a new Location, and then create the dive.
A dive has_one location. A location has_many
2011 Feb 08
0
favorite pattern for adding functionality to an AR?
Do you have a preferred programming pattern for adding functionality to
an ActiveRecord? As an example, say I have some gnarly trig functions
for distance and bearing between pairs of latitude and longitude:
=== file: latlng.rb
module LatLng
def haversine_distance(lat1, lng1, lat2, lng2)
...
end
def bearing(lat1, lng1, lat2, lng2)
...
end
=== EOF
... and I want to mix in
2010 Nov 08
1
API Google MAPS
Hello everybody,
I''m working with Version 3 of Google Maps JavaScript API, and I have
the next code:
In a layout of my application:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?
2018 Jan 19
1
Leaflet maps. Nudging co-incident markers
I have a dataset showing points, with a category for each point and its location.
I simply want to display my points, in a way that users can toggle the points on and off by category.
Where I have two objects in the same category I'd like to display them nudged to appear as two distinct, but very close points.
I have made reproduceable example (the places are not real), which is loosely
2007 Mar 04
0
Event listeners
Hello.. I am playing around on a pilot project with this wonderful
Rails plugin.... thanks for sharing it w us !
I read in a post , in reply to this subject yjat :
Events are possible. Either through the @map.record_init "azeazeae" (for
arbitrary events like domlistener) or through the
@map.event_init(@map,:click,"function(){alert(''HOYOYO'');}").
The
2009 Sep 20
3
coordinates for geokit
i''m trying geokit and loving it, but i''m seeing really odd stuff on
distances, I''m wondering about the coordinates i''ve got in my DB. I
don''t think they''re standard format, they look like this.
east 6''41.6 north 45''24.8
Can anyone advise please ?
--
Posted via http://www.ruby-forum.com/.
2008 Jan 26
0
Error: no such file to load -- geokit (plugin is install)
Hi,
after spending hours on getting geokit and ym4r running I don''t know how
to do or how to getting a test running. I have try the tutorial from
http://www.railslodge.com/plugins/179-ym4r but I don''t get it :(.
Has sone one other tutorials he can recommend?
Maybe someone knows were I did my mistake (I only want to show a fixed
address, no database connection so far, pure
2014 Feb 06
0
Array Confusion
I have the following instruction that returns an array that I'm quite confused about. I can't even read it. Can someone shed some light as to how to reach into this array of hashes (that's what I can see) to get the location lat and lon?
res = Geocoder.search(addy1)
This is the res:
[#<Geocoder::Result::Google:0x007fb46c345e18
2009 Jul 27
6
Superscripts and rounding
I am new to the world of R/programming so this may be a really easy question.
I thank you for your patience and help in advance
I would like the characters km^2 to be displayed on the plot subtitle as km
squared - two as a superscript.
I would also like to have the numbers from the data set for longitude and
latitude to be rounded to four decimal places.
Thank you.
plot (
2007 Feb 10
0
Precision on Latitude/Longitude
Hi All,
I''m having a problem with Rails truncating latitude and longitude
values. In my database (mySQL) table, my lat/lng columns are defined as
Decimal(25,20), but I get different precision values depending on what I
do. If I post, via XML, a value of 37.436490000000006 to my controller,
what gets inserted into the db table is 37.43648999999999900000. Then,
when I fetch the record in a
2006 May 18
3
Google Map
Used a great howto @
http://iamrice.org/articles/2005/12/09/using-google-maps-in-the-uk-with-rails
for using google maps on uk sites. Just having one issue I can''t seem
to work out how to draw the postcode from my table I keep getting hit by
method errors.
The controller is
require ''postcode_2_latlong''
postcode = Postcode.new("TN22 2LG")
# I want this to
2018 May 19
0
How to average values from grid cells with coordinates
Hi lily,
You could also create "blackcells" as a dataframe (which is itself a
type of list). I used a list as I thought it would be a more general
solution if there were different numbers of values for different grid
cells. The use of 1 for the comparison was due to the grid increments
being 1. If you had larger or smaller grid increments, you would use
the grid increment size for the
2018 May 16
0
How to average values from grid cells with coordinates
Hi lily,
There are one or two assumptions to be made here. First is that the
latitude and longitude values of the "black" cells are equally spaced
as in your illustration. Second, that all latitude and longitude
values for the "red" cells fall at the corners of four "black" cells.
You can get the four "black" cells by finding the lat/lon values that
are
2011 Jun 17
0
Inconsistent results from var.get.nc in RNetCDF
Hello -
I am having trouble extracting data from NetCDF data files using
RNetCDF. The data files each have 3 dimensions (longitude, latitude,
and a date) and 3 variables (latitude, longitude, and a climate
variable).
Here is some of the output from print.nc for clarity:
-----
dimensions:
month = UNLIMITED ; // (1368 currently)
lat = 3105 ;
lon = 7025 ;
variables:
float