geocoding

Mongoose calls to geoNear with GeoJSON points as query parameters not working

醉酒当歌 提交于 2019-12-03 16:46:55
Given a schema defined for documents containing a GeoJSON location; var BranchSchema = new Schema({ location: { 'type': { type: String, required: true, enum: ['Point', 'LineString', 'Polygon'], default: 'Point' }, coordinates: [Number] }, name: String }); BranchSchema.index({location: '2dsphere'}); And some sample data: [ { "name": "A", "location": { "type": "Point", "coordinates": [153.027117, -27.468515 ] //Brisbane, Australia } }, { "name": "B", "location": { "type": "Point", "coordinates": [153.029884, -27.45643] //Also Brisbane, Australia } } ] The following geoNear query is not behaving

Does Geocoder gem work with google API key?

北城余情 提交于 2019-12-03 16:36:54
问题 I am using ruby geocoder gem for my project and as the project is growing I am starting to look into connecting to the Google API key. After adding this to the project: Geocoder.configure do |config| # geocoding service (see below for supported options): config.lookup = :google # to use an API key: config.api_key = 'my_key' # geocoding service request timeout, in seconds (default 3): config.timeout = 5 end I get Google Geocoding API error: request denied. when I start the application. From

How to determine if a PHP string ONLY contains latitude and longitude

折月煮酒 提交于 2019-12-03 16:31:16
I have to work with strings which may contain Lat/Long data, like this: $query = "-33.805789,151.002060"; $query = "-33.805789, 151.002060"; $query = "OVER HERE: -33.805789,151.002060"; For my purposes, the first 2 strings are correct, but the last one isn't. I am trying to figure out a match pattern which would match a lat and long separated by a comma, or a comma and a space. But if it has anything in the string other than numbers, spaces, dots, minus signs and commas, then it should fail the match. Hope this makes sense, and TIA! ^[+-]?\d+\.\d+, ?[+-]?\d+\.\d+$ The ^ at the start and $ at

How to load Google ClientLocation API without loading the whole Google Maps API?

折月煮酒 提交于 2019-12-03 16:26:58
All I want to do is find out the person IP address so that I can reverse geocode it to find out their latitude and longitude from which they are viewing my web site from. I can do that using Google ClientLocation API but it's unclear to me if I have to load the huge Google Map framework just to use it. Is it possible to simply use the ClientLocation API without having to load all of Google Maps? If so, how? Yes, you only need to use the ClientLocation object in the google.loader namespace so you need not reference the maps api or anything else. For example. <script src="http://www.google.com

Rails inner join combined with geocoding gem

笑着哭i 提交于 2019-12-03 15:18:34
I have 2 related rails models class Location < ActiveRecord::Base has_many :rates geocoded_by .... end class Rate < ActiveRecord::Base belongs_to :location end I am using the geocoder gem - http://www.rubygeocoder.com I want to find all rates with a particular pair attribute that are within a certain distance to the user. In SQL, I would do an inner join on the rates SELECT * FROM rates INNER JOIN locations ON rates.location_id=locations.id; Then, insert a where condition to filter on the pair attribute, and then use the Geocoder's near method on the resulting table (the near method works by

Google reverse geocoding - how to snap to nearest full postcode

a 夏天 提交于 2019-12-03 15:15:07
I am using Google's reverse geocoding functionality with the maps api v3 to retrieve postal addresses for latitude longitude (when dragging a marker around a map). This is a UK application only, and part of the system requires a full, or near full, postcode to process correctly. However the reverse geocoder regularly returns just the part of the postcode - for example "GU3", even when the actual address returned appears to be complete - for example including street and house number. Is there anyway, preferably google but otherwise if not, of 'snapping' the address to the nearest full postcode?

GeoCoding in Rails for polygon bounds [closed]

时光怂恿深爱的人放手 提交于 2019-12-03 15:12:48
Closed . This question needs to be more focused. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it focuses on one problem only by editing this post . Closed 5 years ago . Is there a way in rails via some mapping API/gem where I can define map areas/map zones (with polygon bounds) and detect if an address falls within a particular zone/area. This is easily done with geokit . First construct a polygon from LatLng: polygon = Geokit::Polygon.new([ Geokit::LatLng.new(0,0), Geokit::LatLng.new(10,0), Geokit::LatLng.new(10,10), Geokit::LatLng

Reverse Geocoding for Israel [closed]

早过忘川 提交于 2019-12-03 14:15:20
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . Where can i find a free service for reverse geocoding a coordinate in israel to get a street address? the google api web service doesnt give me a street address in israely coordinates... Thanks. 回答1: I am also searching.. found no free service, but Waze have a nice one for pay. This is example I got from them:

Get places in radius of a certain point using SQL geography

非 Y 不嫁゛ 提交于 2019-12-03 14:02:36
I have an SQL table column with the Geography type: create table dbo.Events ( Id int identity not null constraint PK_Events_Id primary key clustered (Id), Localization geography not null ); How can I get all events in a radius of 40 km? Is this possible? Thank You, Miguel Assuming you have latitude and longitude of the point from which you want to search: DECLARE @Origin GEOGRAPHY, -- distance defined in meters @Distance INTEGER = 40000; -- center point SET @Origin = GEOGRAPHY::STGeomFromText('POINT(-122.084039 37.42227)', 4326); -- return all rows from events in 40km radius SELECT * FROM dbo

Is there way to do batch geocoding (get lat/lon by address and vice-versa)? [closed]

烂漫一生 提交于 2019-12-03 13:31:56
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Google Geocoding API has serious limitations (2,500 requests per day) and we always get a limit error. Their business license costs