geospatial

Inverse geospatial search with Lucene

爷,独闯天下 提交于 2019-12-08 03:52:27
问题 Is there a way to implement something like "inverse" geospatial search with Lucene? With inverse I mean, the indexed objects each define both a position (lat/lng) and a radius. I want to find all objects where my search position is within the radius of the indexed objects. A real life example could be a set of pizza delivery services, each of them delivers an area of radius x. I want to find all pizza services that could deliver a pizza to me. So, it is not me defining the search radius, it

calculate the area of a polygon in ruby

人盡茶涼 提交于 2019-12-08 03:16:44
问题 I have an array of latitude/longitude coordinate pairs that represent a polygon. I'm trying to determine the total area within that polygon. How would I go about doing that in Ruby? Here's an example array of the polygon: [[37.7663613767094, -122.452969210084], [37.7674219449606, -122.444718340349], [37.7701838510542, -122.445330289514], [37.7709974013834, -122.439159589248], [37.7700761930893, -122.438861402472], [37.7703501163684, -122.436868738421], [37.7712650571321, -122.437078116573],

Creating an abitrary, curved Well Known Text LineString for display in OpenLayers

谁都会走 提交于 2019-12-08 02:53:32
问题 I am dynamically generating a WKT LineString between points in a map layer being generated for display in OpenLayers. I'd like to make the lines between the points curved, and I'd like to be able to dynamically change the curvature based on various input variables. This is for a network monitoring app, and we'd like the curvature to based on delay times between the points (not the raw delay itself, but the deviation from "normal" values during a given time period). While some GIS app and

Geocoding - Grouping multiple addresses into major cities

╄→гoц情女王★ 提交于 2019-12-08 01:43:01
问题 Been hunting through previous questions on Geocoding and while many are helpful I'm not finding one to my needs. I need to group multiple addresses to the nearest city centers. My only address information is city, country, and state (if applicable). For example, all addresses in San Francisco and within miles should be listed as San Francisco. I'll need to know the count of addresses rolled-up to San Francisco. I'm open to suggestions on how to approach this. I don't particularly want to

Calculating the number of people who live within or outside a certain distance from hospitals

淺唱寂寞╮ 提交于 2019-12-08 01:22:54
问题 I'm new to geospatial stats and can't figure out a simple question: I have two datasets with spatial coordinates. One has coordinates of hospitals and clinics in a particular district. The other has coordinates of all households in that district. Here's some mock data hospital_coord <-data.frame(longitude = c(80.15998, 72.89125, 77.65032, 77.60599), latitude = c(12.90524, 19.08120, 12.97238, 12.90927)) people_coord <-data.frame(longitude = c(72.89537, 77.65094, 73.95325, 72.96746, 77.65058,

a failed attempt at placing a dot over an image based on known lat and lng points

蹲街弑〆低调 提交于 2019-12-07 22:25:30
问题 I apologize for the vague title, I really can't figure out a batter way to sum it up. Suggestions are more than welcome. I'm working on a project that really doesn't NEED a google map, it'd just create extra overhead for this project. But, I can't figure out how to do this WITHOUT google maps... so far. If I were to place a graphical overlay of a floor plan into google maps, I could use a browser location to approximate a users position. For this, it's a VERY large place, so there's room for

Adding CRS in sp seems inconsistent

瘦欲@ 提交于 2019-12-07 22:17:50
问题 I want to use the over() function from the sp package in R . I assigne a CRS . #say that polygon is EPSG3857 (Web Mercator PROJECTION) proj4string(finalPolygon) <- CRS("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs") and all seems good. str(finalPolygon) > ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot > .. .. ..@ projargs: chr "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1

Calculate distance in Java Using MongoDB

廉价感情. 提交于 2019-12-07 19:11:54
问题 I am working on location calculation in Java and MongoDB. I pass latitude and longitude to method and find nearest location from provided input. I am able to get Location name from my master table where i have all landmarks with latitude and longitude. My requirement is that i want to get location with distance using MongoDB - like 4Km from XYZ . MongoDB has Geospatial query and i am working on it. I can get mentioned input by running in command prompt by using db.runCommand({ geoNear : "data

MongoDB: Geospatial Index array not in correct format

梦想的初衷 提交于 2019-12-07 18:10:48
问题 While trying to setup to use the Geospatial Index on MongoDB, I run into the error message that the location array is not in the correct format. This is my collection "test". { "_id" : ObjectId("4f037ac176d6fdab5b00000a"), "CorporateId" : "XYZ12345", "Places" : [ { "Location" : { "Longitude" : "50.0", "Latitude" : "50.0" }, "ValidFrom" : "2011-11-01 00:00:00", "ValidTo" : "2021-12-31 00:00:00", "itemCount" : "1" } ] } Once I run this code. db.test.ensureIndex({"Places.Location": "2d"}); I get

Sunspot geospatial search ERROR:unknown field 'location_ll'

99封情书 提交于 2019-12-07 17:14:14
问题 I've been trying to integrate geospatial search into my rails app for a few days now, but keep getting this error when I run rake sunspot:solr:reindex RSolr::Error::Http - 400 Bad Request Error: ERROR:unknown field 'location_ll' Request Data: "<?xml version=\"1.0\" encoding=\"UTF-8\"?><add><doc><field name=\"id\">Place 1</field><field name=\"type\">Place</field><field name=\"type\">ActiveRecord::Base</field><field name=\"class_name\">Place</field><field name=\"location_ll\">42.348065,-71