geospatial

GeoDjango, difference between dwithin and distance_lt?

霸气de小男生 提交于 2019-12-31 19:30:04
问题 Using geoDjango, what is the difference between myObj.objects.filter(point__dwithin(...etc.)) and myObj.objects.filter(point__distance_lt(...etc.)) ? Are they the same thing, or are they doing subtly different things? 回答1: Ok, I did some research but I don't know if the results are of any use ;) I looked at the unit tests that they use to test the DB queries but they don't give real hints (to me). I tried to compare the generated SQL: I have already a geo application using a PostgreSQL

GeoDjango, difference between dwithin and distance_lt?

ぐ巨炮叔叔 提交于 2019-12-31 19:28:17
问题 Using geoDjango, what is the difference between myObj.objects.filter(point__dwithin(...etc.)) and myObj.objects.filter(point__distance_lt(...etc.)) ? Are they the same thing, or are they doing subtly different things? 回答1: Ok, I did some research but I don't know if the results are of any use ;) I looked at the unit tests that they use to test the DB queries but they don't give real hints (to me). I tried to compare the generated SQL: I have already a geo application using a PostgreSQL

Why Use Redis instead of MongoDb for Caching? [closed]

孤人 提交于 2019-12-31 10:48:54
问题 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 . I've seen many people using Redis as a cache lately, why not Mongo? As far as I could tell Redis can set an expire date on an index,

Get Distance in Meters instead of degrees in Spatialite

喜你入骨 提交于 2019-12-31 10:02:14
问题 I have the following query: select distance(GeomFromText('POINT(8 49)',4326),GeomFromText('LINESTRING(8.329969 49.919323,8.330181 49.919468)',4326)) this gives me 0.97 degrees. But I need it in meters and do not know which SRID to transform to. Can somebody give me an example how to get the result in meters for spatialite? The positions are all in Europe. 回答1: Just multiply the value in degrees by 111195 - this value is (Earth mean radius)*PI/180 - that is 'mean length of one great circle

Get Distance in Meters instead of degrees in Spatialite

对着背影说爱祢 提交于 2019-12-31 10:01:21
问题 I have the following query: select distance(GeomFromText('POINT(8 49)',4326),GeomFromText('LINESTRING(8.329969 49.919323,8.330181 49.919468)',4326)) this gives me 0.97 degrees. But I need it in meters and do not know which SRID to transform to. Can somebody give me an example how to get the result in meters for spatialite? The positions are all in Europe. 回答1: Just multiply the value in degrees by 111195 - this value is (Earth mean radius)*PI/180 - that is 'mean length of one great circle

polygon vertices - clockwise or counterclockwise

依然范特西╮ 提交于 2019-12-31 03:32:05
问题 I came across this link http://www.mathopenref.com/coordpolygonarea2.html It explains how to calculate the area of a polygon and helps to identify whether the polygon vertices we entered is clockwise or counter clockwise. If area value is +ve, it is clockwise, if it is -nv then it is in counterclockwise. My requirement is to identify only whether it is clockwise or counterclockwise. Is this rule will work correctly (though there are limitations as mentioned in the link). I have only regular

What is SRID 0 for geometry columns?

浪子不回头ぞ 提交于 2019-12-30 05:57:42
问题 So I added geometry columns to a spatial table and using some of the msdn references I ended up specifying the SRID as 0 like so: update dbo.[geopoint] set GeomPoint = geometry::Point([Longitude], [Latitude], 0) However, I believe this was a mistake, but before having to update the column, is 0 actually the default = 4326? The query works as long as I specify the SRID as 0 on the query, but I'm getting weird results in comparison to the geography field I have... SRID 0 does not exist in sys

What is SRID 0 for geometry columns?

倾然丶 夕夏残阳落幕 提交于 2019-12-30 05:57:02
问题 So I added geometry columns to a spatial table and using some of the msdn references I ended up specifying the SRID as 0 like so: update dbo.[geopoint] set GeomPoint = geometry::Point([Longitude], [Latitude], 0) However, I believe this was a mistake, but before having to update the column, is 0 actually the default = 4326? The query works as long as I specify the SRID as 0 on the query, but I'm getting weird results in comparison to the geography field I have... SRID 0 does not exist in sys

Draw a map of a specific country with leaflet

心不动则不痛 提交于 2019-12-30 03:32:06
问题 I would like to use the package leaflet with R to draw a map of a specific countries such as Italy, Spain, etc. I checked the basic examples with the function setView() and I tried to give a vector of two values for the arg of latitude and longitutde : m <- leaflet() %>% addTiles() %>% # Add default OpenStreetMap map tiles setView(lng=c(46.00,48.00), lat=c(2.00,6.00), zoom = 4) m # Print the map (map is not centered on a country, it's just a test) But I will never be able to have a specific

Using full text search with geospatial index on Mongodb

為{幸葍}努か 提交于 2019-12-30 03:13:05
问题 Let's say I want to develop an android app that allows a user to search a hotel that is closest to where you are located. This is very common on apps nowadays, like AirBnb for example. This is the dataset I'm using: { "name" : "The Most Amazing Hotel", "city" : "India", "type": "Point" "coord": [ -56.16082, 61.15392 ] } { "name" : "The Most Incredible Hotel", "city" : "India", "type": "Point" "coord": [ -56.56285, 61.34590 ] } { "name" : "The Fantastic GuestHouse", "city" : "India", "type":