geospatial

How to find documents having a query-value within the range of two key-values

走远了吗. 提交于 2019-12-11 13:39:21
问题 I'm analyzing texts. Those texts have annotations (e.g. "chapter", "scenery", ...). Those annotations are in my MongoDB collection annotations , e.g. { start: 1, stop: 10000, type: chapter, details: { number: 1, title: "Where it all began" } }, { start: 10001, stop: 20000, type: chapter, details: { number: 2, title: "Lovers" } }, { start: 1, stop: 5000, type: scenery, details: { descr: "castle" } }, { start: 5001, stop: 15000, type: scenery, details: { descr: "forest" } } Challenge 1 : For a

Drawing anonymous circles in Google Maps

懵懂的女人 提交于 2019-12-11 12:53:09
问题 I'm trying to draw a google maps that has multiple Circle overlays, however I do not want to reveal the correct center of the radius. So for example, myLatlng is my lat/lon center of the radius, I want to draw a circle not around it, but a circle that will include that point. This is how I currently draw my circle: var myLatlng = new google.maps.LatLng(33.33333,22.22222); var circle = new google.maps.Circle({ map: map, radius: 3218, strokeColor: "#FFAA00", fillColor: "#00AAFF", fillOpacity: 0

Optimizing a Geo-Distance Related MySQL Query

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-11 12:05:27
问题 I have the following MySQL query: SELECT a.*, ( 3959 * acos( cos( radians('47.3909') ) * cos( radians( a.lat ) ) * cos( radians( a.lng ) - radians('-122.2637') ) + sin( radians('47.3909') ) * sin( radians( a.lat ) ) ) ) AS distance FROM zip_codes AS a ORDER BY distance ASC LIMIT 1; This will get me the zip code in my zip_codes table that is nearest to the coordinates I have specified. However, this is running pretty slow! Around 1 second. All similar queries run around 1 second as well. I am

mongomapper geospatial 'within' query

空扰寡人 提交于 2019-12-11 11:55:01
问题 I'm trying to do a 'within' query using mongomapper. When I execute the command in the shell everything works fine: box = [[32.476750,-117.246094],[32.850173,-116.806641]] db.locations.find({"location" : {"$within" : {"$box" : box}}}) // Bunch of results However, when I run the same in the rails console I get nil: box = [[32.476750,-117.246094],[32.850173,-116.806641]] Location.find(:location => {"$within" => {"$box" => box}}) => nil If I do Location.first I get a location back so I do know

Select items within range using MySQL spatial extensions?

半世苍凉 提交于 2019-12-11 11:42:23
问题 I am completely new to MySQL spatial extensions, so please excuse my ignorance on the topic. The scenario: 1) I collect a user's location via latitude and longitude. I store that location in a MySQL table. 2) I then display any other users within a range of that user. The range would be small - let's say 1000 ft. Question: What is the best practice for storing the location points? What is the best practice for querying and selecting the points nearest that user? 回答1: Use the POINT Spatial

How to import geosparql to your ontology?

守給你的承諾、 提交于 2019-12-11 10:43:16
问题 Based on this: How to extend ontology with other standard ontologies in Protégé?, I am really worried on how to import geosparql in an ontology I just created. I think that importing geosparql means to import this to my ontology in Protege: http://schemas.opengis.net/geosparql/1.0/geosparql_vocab_all.rdf My ontology is Saved As RDF/XML syntax and the file that contains it has a .owl extension. How to safely import geosparql in my ontology (Protege 5.0.0 beta)? 回答1: Both .rdf and .owl are

Oracle Spatial - select objects falling within area

…衆ロ難τιáo~ 提交于 2019-12-11 07:44:31
问题 this is probably simple to those who know (I hope!) I have an Oracle spatial database with a geometry column containing a list of node points, in northing/easting format (if it's relevent!) I need to select those objects which fall within a given radius of a given point. Northings and Eastings are 1 meter apart which makes it a bit easier. Ideally this should include objects which cross the area even if their node points fall outside it. Is this an easy-ish query? Maybe using SDO_WITHIN

R - how to write nested for-loop with different spatial data.frames

放肆的年华 提交于 2019-12-11 06:49:08
问题 I need to iterate thru a multi-feature SpatialPolygonsDataFrame (SPDF herein) and erase where each polygon intersects with SpatialLines contained in a list of single-feature SpatialLinesDataFrames (SLDF) and save the updated 'erased' SLDFs to a new list. If a line intersects with two different polygon features, I want two updated 'erased' SLDF to be created and added to the new SLDF list. In the sample I provide below, the SLDFs intersect with exactly one SPDF, except one of the SLDF

Map Lat/Lon Points to a Shape File in R

时光怂恿深爱的人放手 提交于 2019-12-11 05:27:47
问题 I am trying to identify the zip code for each set of lat/lon coordinate using a shapefile. Lat Lon data is extracted from: https://data.cityofchicago.org/Public-Safety/Crimes-2017/d62x-nvdr (Crimes_-_2001_to_present.csv) Shapefile: https://www2.census.gov/geo/tiger/PREVGENZ/zt/z500shp/ zt17_d00.shp (zip code definitions for the state of Illinois) library(rgeos) library(maptools) ccs<-read.csv("Crimes_-_2001_to_present.csv") zip.map <- readOGR("zt17_d00.shp") latlon<-ccs[,c(20,21)] str(latlon)

Difference between geodist() and dist() for Geo-Spacial Search

余生长醉 提交于 2019-12-11 05:26:44
问题 What is the Difference between Geodist(sfield,x,y) and dist(2,x,y,a,b) in Apache Solr for Geo-Spacial Searches ?? dist(2,x,y,0,0) :- calculates the Euclidean distance between (0,0) and (x,y) for each document. Return the Distance between two Vectors (points) in an n-dimensional space. I was earlier using geodist() distance function for Geo-Spatial searches on my website but its response time was large. so have done a POC(proof of concept) for different distance functions and found that dist(2