geospatial

MySQL INSERT/UPDATE on POINT column

我怕爱的太早我们不能终老 提交于 2020-01-12 05:39:54
问题 I'm trying to populate my DB with geographical places of my country. One of my tables have 4 fields: ID[PK], latitude. longitude ande geoPoint EDIT `SCDBs`.`Punto_Geografico`; SET @lat = 18.469692; SET @lon = -63.93212; SET @g = 'POINT(@lat @lon)'; UPDATE Punto_Geografico SET latitude = @lat, longitude =@lon, geoPoint =@g WHERE idpunto_geografico = 0; im getting the following error: Error Code: 1416 Cannot get geometry object from data you send to the GEOMETRY field I'm pretty sure that

SQL Distance Query without Trigonometry

廉价感情. 提交于 2020-01-10 20:15:11
问题 I have an SQLite database, which does not support trig functions. I would like to sort a set of lat,lng pairs in my table by distance as compared to a second lat,lng pair. I'm familiar with the standard haversine distance formula for sorting lat,lng pairs by distance. In this case I don't care particularly for precision, my points are separated by large distances, so I don't mind rounding off the distances by treating curves as straight lines. My question, is there a generally accepted

mongodb mongoose unit of maxDistance

Deadly 提交于 2020-01-10 19:10:31
问题 In my application, I am trying to use, RentModel.find({prop_location : { $near : [msg.lat, msg.lng], $maxDistance : 500}}, function(err, docs){} I have only one value in the database with latitude, longitude of san francisco. Now, When there is no maxDistance => It finds out the location perfectly from anywhere. When I add maxDistance as 5 and search exactly at the same location (with same latitude, longitude), it does not find the location. If it is 50, same as point 2. If it is 500, I can

How to look up elevation data by lat/lng [closed]

橙三吉。 提交于 2020-01-10 10:08:29
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 2 years ago . I am planning an app that will need the ability to look up the elevation of geographic points by lat/lng. Ideally I would like something that would work worldwide, but US-only would also suffice. I have looked at using the USGS Elevation Query Web Service, however it only allows

Find if given longitude, latitude pair lies in any of the polygon in MongoDB

风流意气都作罢 提交于 2020-01-07 05:02:17
问题 As per my current understanding on MongoDB we search our collection by passing an array of [long, lat] pair arrays, to check if that document's [long, lat] pair exits inside the coordinates [[ [], [], [] ]] . i,e., db.SomeCollection.find({ "location":{ $geoWithin: { $geometry: { type: "Polygon", coordinates: [ [[1, 2], [1, 3], [1, 4]], [[2, 5], [2, 6], [2, 7]] ] } } } }) What i am looking for is that i need to feed the [long, lat] pair to a document containing fixed Polygonal Geofence arrays

Find if given longitude, latitude pair lies in any of the polygon in MongoDB

坚强是说给别人听的谎言 提交于 2020-01-07 05:02:12
问题 As per my current understanding on MongoDB we search our collection by passing an array of [long, lat] pair arrays, to check if that document's [long, lat] pair exits inside the coordinates [[ [], [], [] ]] . i,e., db.SomeCollection.find({ "location":{ $geoWithin: { $geometry: { type: "Polygon", coordinates: [ [[1, 2], [1, 3], [1, 4]], [[2, 5], [2, 6], [2, 7]] ] } } } }) What i am looking for is that i need to feed the [long, lat] pair to a document containing fixed Polygonal Geofence arrays

Geoserver - elasticsearch layer is not created

旧街凉风 提交于 2020-01-07 02:15:13
问题 I am very new to geoserver. Recently we have setup geoserver with elasticgeo plugin. Now I can see Elasticsearch option in Vector data sources while creating a new datastore. Used below Rest API calls to create a workspace & data store. scurl -v -k -u admin:geoserver -XPOST "https://localhost:6443/geoserver/rest/namespaces" -H "Content-type: text/xml" -d "<namespace><prefix>test</prefix><uri>http://test.com</uri></namespace>" scurl -v -k -u admin:geoserver -XPOST "https://localhost:6443

Optimal circles placement - geospatial

我怕爱的太早我们不能终老 提交于 2020-01-05 09:14:23
问题 I am trying to solve the following problem: I have 1000 points (lat,lon) scattered on a map Each point has a value call it x_i I need to put n circles with radii r_i < 5 miles such that the sum of the points' values x_i in the circle is s_i > 200 Circles can't intersect I have to maximize the sum of all s_i. The variables are: all r_i, n, positions of circles (which points I pick as centers of my circles). Can someone help me with some guidance on how to solve something like this? UPDATE I am

Query polygons $geowithin $box mongodb doesn't return anything

梦想的初衷 提交于 2020-01-05 07:46:30
问题 Guys I am trying to query all the polygons inside by bounding box but it simply returns 0.. It should be returning many polygons! Alternatively I try to query a much larger bounding box and nothing happens! My query is: { geometry: { $geoWithin: { $box: [ [-73.995762,40.764826], [-73.934034,40.802038] ] } } } Notice that the very same query returns a valid result for geometries of type Point 回答1: to query all the polygons inside by bounding box but it simply returns 0 The $box operator for

Given a latitude / longitude to a certain number of decimal places, how to tell the area covered (in metres)?

房东的猫 提交于 2020-01-05 07:13:09
问题 If i have a position specified in latitude and longitude, then it can cover a box, depending on how many digits of accuracy are in the position. For example, given a position of 55.0° N, 3.0° W (i.e. to 1 decimal place), and assuming a truncation (as opposed to rounding), this could cover anything that's 55.01° to 55.09°. This would cover the area in this box: http://www.openstreetmap.org/?minlat=55.0&maxlat=55.1&maxlon=-3.0&minlon=-3.1&box=yes Is there anyway to calculate the area of that