similar to: Rails Join problem

Displaying 20 results from an estimated 4000 matches similar to: "Rails Join problem"

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
2008 Sep 19
0
Rounding Errors using GeoKit
Hi all, I''m trying to use the excellent GeoKit plugin to geocode addresses entered by users. I use GeoKit to get latitude and longitude values, then plot these using Google Maps. The problem I have is that the maps produced tend to be slightly off where they should be. Nearby addresses seem to be grouped to one point, which suggests that the problem is in rounding the lat and lng values
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
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
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?
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
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 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 =
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
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
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
2009 Jun 01
0
[mapstraction commit] r12 - Implemented most Cloudmade functions. Still requires image, tile and KML/GeoRSS overlays
Author: duvander Date: Sun May 31 17:34:27 2009 New Revision: 12 Modified: trunk/source/mxn.cloudmade.core.js Log: Implemented most Cloudmade functions. Still requires image, tile and KML/GeoRSS overlays Modified: trunk/source/mxn.cloudmade.core.js ============================================================================== --- trunk/source/mxn.cloudmade.core.js (original) +++
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
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
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/.
2014 Jun 15
0
Problem with converting a list of grids to a list of polygons
Hi. For a spatial analysis (its visualization) I need to produce a map of conditions and traits. When I used SpatialPixelsDataFrame (sp package) my grid cells were regular and between each row was a small gap, which is not only messy but incorrect. So I generated the coords of each grid from the centroids in order to elongate the cells manually (or does anybody know another way to solve this?).
2009 Nov 04
0
r53 committed - applied patch from John McKerrell
Revision: 53 Author: freyfogle Date: Wed Nov 4 08:34:55 2009 Log: applied patch from John McKerrell http://code.google.com/p/mapstraction/source/detail?r=53 Modified: /trunk/source/mxn.cloudmade.core.js ======================================= --- /trunk/source/mxn.cloudmade.core.js Sun Sep 20 06:30:15 2009 +++ /trunk/source/mxn.cloudmade.core.js Wed Nov 4 08:34:55 2009 @@ -7,6 +7,21 @@
2006 Aug 18
1
customization of ActiveRecord models
I''m trying to determine how/if I can use MySql''s spatial extensions with ActiveRecord. The spatial extensions usually require inserts in the following format: INSERT INTO `locations` (name, point) VALUES ("location name",GeomFromText(''POINT(<lng> <lat>'')); And reads as SELECT name, AsText(point) AS point FROM locations; While I
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