geospatial

Geo Fence: how to find if a point or a shape is inside a polygon using oracle spatial

空扰寡人 提交于 2019-12-06 05:37:07
问题 How do i find if a point or a polygon is inside another polygon using oracle spatial SQL query Here is the scenario; I have a table (STATE_TABLE) which contains a spatial type (sdo_geometry) which is a polygon (of say a State), I have another table (UNIVERSITY_TABLE) which contains spatial data (sdo_geometry) (point/polygon) which contains Universities; Now how do i find if a selected University('s) are in a given State using SQL select statement. Primarily i want to locate existence of given

Mongo $geoNear query - incorrect nscanned number and incorrect results

跟風遠走 提交于 2019-12-06 05:25:13
问题 I have a collection with around 6k documents with 2dsphere index on location field, example below: "location" : { "type" : "Point", "coordinates" : [ 138.576187, -35.010441 ] } When using the below query I only get around 450 docs returned with nscanned around 3k. Every document has a location, many locations are duplicated. Distances returned from GeoJSON are in meters, and a distance multiplier of 0.000625 will convert distances to miles. To test, I'm expecting max distance of

Cannot render vector tiles (.mbtiles) file with leaflet

送分小仙女□ 提交于 2019-12-06 04:55:20
I am trying to render some locally-stored and vector-based tiles download from OpenMapTile. The reason I am doing that is because my end application will only run on a computer that cannot be connected to the internet. I have read many different things on whether or not leaflet can render vector-based tiles but it seems that it can from some examples. It seems that it is not possible with Vector Grid that only does raster tiles but that it is possible with Leaflet.TileLayer.MBTiles So I tried to do just that but always stumble upon an empty page when trying it out... I have the controllers for

MongoDB geospatial index in C#

本小妞迷上赌 提交于 2019-12-06 04:52:51
问题 I have been trying to get started but run into the same rock time after time trying to create and query MongoDB with C# official driver. The problem is how to create data with geo information. I am just not finding the answer. Code: MongoUrl url = new MongoUrl("mongodb://xxx.xx.x.xx/mydb"); MongoServer server = MongoServer.Create(url); MongoDatabase database = server.GetDatabase("mydb"); <-- this works fine BsonDocument[] batch = { new BsonDocument { { "name", "Bran" }, { "loc", "10, 10" } },

Calculate distance in Java Using MongoDB

本秂侑毒 提交于 2019-12-06 04:44:22
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", near : [-73.9000, 40.7000], spherical : true, maxDistance : 2500/6378137, distanceMultiplier:

PostgreSQL: How to get all points in certain radius

拥有回忆 提交于 2019-12-06 04:30:52
I'm using Postgresql 9.3 and iv'e installed cube and earthdistance extensions. I'm trying to follow this tutorial , so i have a simple events table with 4 fields: id, name, lat, lng. Now i'm trying to run this query, to get all events within 1 km radius: SELECT events.id, events.name FROM events WHERE earth_box(31.789225, 34.789612, 1000) @> ll_to_earth(events.lat, events.lng); but i keep getting this error: 20:59:34 Kernel error: ERROR: function earth_box(numeric, numeric, integer) does not exist HINT: No function matches the given name and argument types. You might need to add explicit type

Finding latitude and longitude of many places once

吃可爱长大的小学妹 提交于 2019-12-06 04:14:40
问题 I have a long list of towns and cities, and I'd like to add latitude and longitude information to each of them. Does anyone know the easiest way to generate this information once? See also Geocode multiple addresses 回答1: The first part of the third video shows how to get latitude and Longitude using Google Refine and geocoding. No need to write a new script. Ideal for doing this kind of change once . http://code.google.com/p/google-refine/ 回答2: Or use www.geonames.org - there's language APIs

Android: how to get the walking distance between two geo coordinates?

别来无恙 提交于 2019-12-06 03:22:20
问题 I used this query URL http://maps.google.com/maps?q=from+A+to+B&output=kml ,which is given in the answer to this question. But after I tried it, it doesn't work with coordinates. It works with address names tho. I guess I could use google's geocoding to get the addresses first. But I wonder if there is another way to get the walking distance between two coordinates? 回答1: My New Answer :) Use the Google Directions API. It should be possible to make a request to http://maps.google.com/maps/api

Shortest path between raw geo coordinates and a node of a graph

喜夏-厌秋 提交于 2019-12-06 03:11:02
问题 I have implemented a simple Dijkstra's algorithm for finding the shortest path on an .osm map with Java. The pathfinding in a graph which is created from an .osm file works pretty well. But in case the user's current location and/or destination is not a node of this graph (just raw coordinates) how do we 'link' those coordinates to the graph to make pathfinding work? The simple straightforward solution "find the nearest to the current location node and draw a straight line" doesn't seem to be

How do I enter an “empty” POINT() geometry value into a MySQL field of type POINT?

亡梦爱人 提交于 2019-12-06 03:04:55
问题 I have a table with a POINT geometry field. I enter latitude/longitude points into it like this: INSERT INTO table( point ) VALUES( POINT( lon_value, lat_value ); Sometimes I do not have lat/lon values to enter. I am unable to enter a blank, a NULL, or an empty POINT() ... since POINT(0,0) is actually a location on the globe, that won't work either. What is the solution here? 回答1: I would use coordinates of North Pole INSERT INTO table( point ) VALUES( POINT(0.0000,90.0000); If the actual