geo

Draw a map of a specific country with cartopy?

风流意气都作罢 提交于 2019-11-28 21:41:53
I have tried this example here, which works fine. But how do I focus on another country, i.e. show only germany? source for this example http://scitools.org.uk/cartopy/docs/latest/examples/hurricane_katrina.html exampl of us map http://scitools.org.uk/cartopy/docs/latest/_images/hurricane_katrina_01_00.png I've tried some coordinates on the extend() method, but I didn't manage to get to look it like the US map. Or do I have to modify the shape file? Using the Global Administrative Areas dataset at http://www.gadm.org/country , just download the Germany dataset and use cartopy's shapereader (in

How to sort array items by longitude latitude distance in javascripts?

廉价感情. 提交于 2019-11-28 19:02:14
I am having following JSON array of 6 locations. Is there any way sort these based on longitude and latitude where nearby locations come next in the array? [ {"id" : 279, "longitude":79.853239,"latitude":6.912283}, {"id" : 284, "longitude":79.865699,"latitude":6.885697}, {"id" : 13, "longitude":79.851187,"latitude":6.912220}, {"id" : 282, "longitude":79.858904,"latitude":6.871041}, {"id" : 281, "longitude":79.853346,"latitude":6.899757}, {"id" : 16, "longitude":79.854786,"latitude":6.894039} ] Sorting can be started from first item and result should be something like this [ {"id" : 279,

Redis高级数据结构GEO用法

给你一囗甜甜゛ 提交于 2019-11-28 18:23:34
需求 怎么实现一个“附件的人”或者附近的“商店”功能? 需求分析 可以基于数据库去做,给定一个坐标,以这个坐标为半径r, j使用sql选出近似圆的的元素进行展示。 select id from positions where x > x0-r and x < x0+r and y < y0+r and y> y0-r 但是如果访问量非常大,那数据库就无能为力,幸好Redis提供了GEO模块,直接可以使用。 业界比较通用的地理位置距离排序算法是 GeoHash 算法,Redis 也使用 GeoHash 算法。GeoHash 算法将二维的经纬度数据映射到一维的整数,这样所有的元素都将在挂载到一条线上,距离靠近的二维坐标映射到一维后的点之间距离也会很接近。 GeoHash 算法会继续对这个整数做一次 base32 编码 (0-9,a-z 去掉 a,i,l,o 四个字母) 变成一个字符串。在 Redis 里面,经纬度使用 52 位的整数进行编码,放进了 zset 里面,zset 的 value 是元素的 key,score 是 GeoHash 的 52 位整数值。zset 的 score 虽然是浮点数,但是对于 52 位的整数值,它可以无损存储。 在使用 Redis 进行 Geo 查询时,我们要时刻想到它的内部结构实际上只是一个 zset(skiplist)。通过 zset 的 score

Android GEO Location Tutorial [closed]

一世执手 提交于 2019-11-28 16:53:37
Does anyone know a good GEO Location tutorial for Android. I don’t want to have to get a Google maps API key I just want an Activity that gets the location of a phone and sticks it in a variable that I can then decide what to do with it later. Cheers, Mike. Only for location then Just go through Using GPS to get current location – Android tutorial Find Current Location in Android - GPS Sample Android Location Based Services Application – GPS location Obtaining User Location Location Manager Examples 来源: https://stackoverflow.com/questions/8543763/android-geo-location-tutorial

KML opens with the wrong geoposition

和自甴很熟 提交于 2019-11-28 12:00:31
问题 I'm trying to create a map of the Stockholm's subway lines in Fusional Tables. In the Fusion Tables I created a map with geo each station: https://www.google.com/fusiontables/DataSource?docid=1K7F2DMY5JBA6ZQOH8a1a4dQjwxoksRDMJ3-wPEg#map:id=3 I want to connect them to the polyline. Options to create polylines and way in the tables there, or they are very well hidden. So I created this KML file and loaded into tables: <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://www.opengis.net/kml

Redis Geo HyperLogLog类型介绍

南楼画角 提交于 2019-11-28 08:45:20
​Geo类型 Redis3.2.0版本推出 可以将用户给定的地理位置信息存储起来,并对这些信息进行操作 GEOADD key longitude latitude member [longitude latitude member ...] //在使用排序集表示的地理空间索引中添加一个或多个地理空间项,时间复杂度O(log(N)) 127.0.0.1:6379> geoadd key1 121.3996887207031 31.04559326171875 member1 116.3883056640625 39.92889404296875 member2 (integer) 2 GEODIST key member1 member2 [unit] //返回地理空间索引的两个成员之间的距离,时间复杂度O(log(N)) 127.0.0.1:6379> geodist key1 member1 member2 "1086809.8477"//默认单位为m 127.0.0.1:6379> geodist key1 member1 member2 m "1086809.8477" 127.0.0.1:6379> geodist key1 member1 member2 km "1086.8098" 127.0.0.1:6379> geodist key1 member1 member2

Using WHERE clause to find POI within a range of distance from Longitude and Latitude

爱⌒轻易说出口 提交于 2019-11-28 08:00:09
问题 I'm using following sql code to find out 'ALL' poi closest to the set coordinates, but I would want to find out specific poi instead of all of them. When I try to use the where clause I get an error and it doesn't work and this is where I'm currently stuck, since I only use one table for all the coordinates off all poi's. SET @orig_lat=55.4058; SET @orig_lon=13.7907; SET @dist=10; SELECT *, 3956 * 2 * ASIN(SQRT(POWER(SIN((@orig_lat -abs(latitude)) * pi()/180 / 2), 2) + COS(@orig_lat * pi()

How to define object in array in Mongoose schema correctly with 2d geo index

谁说胖子不能爱 提交于 2019-11-28 02:51:22
I'm currently having problems in creating a schema for the document below. The response from the server always returns the "trk" field values as [Object]. Somehow I have no idea how this should work, as I tried at least all approaches which made sense to me ;-) If this helps, my Mongoose version is 3.6.20 and MongoDB 2.4.7 And before I forget, it would be nice to also set it as Index (2d) Original data: { "_id": ObjectId("51ec4ac3eb7f7c701b000000"), "gpx": { "metadata": { "desc": "Nürburgring VLN-Variante", "country": "de", "isActive": true }, "trk": [ { "lat": 50.3299594, "lng": 6.9393006 },

How to do smooth transition for map reprojection in d3 js

北战南征 提交于 2019-11-28 00:36:42
问题 I'd like to do a smooth transition between alber/orthographic in a mini app I am building, much like this example: http://mbostock.github.io/d3/talk/20111018/#27 It seems like this smooth transition is broken in v3 however, with a rather choppy transition of the map paths: https://www.evernote.com/shard/s236/sh/46b002bd-9c5b-4e9b-87ef-270c303eb677/2eaeebb267a3fc59df5a8447bbbcc58b/res/37917835-5aad-4509-b534-31a3e3034762/Worst_Tornado_Outbreaks_of_All_Time-20130611-074050.jpg.jpg?resizeSmall

HAVERSINE distance in BigQuery?

我只是一个虾纸丫 提交于 2019-11-28 00:01:43
I'm looking for a way to get HAVERSINE() in BigQuery. For example, how to get the closest weather stations to an arbitrary point? Using standard SQL you can define a SQL function to encapsulate the logic. For example, #standardSQL CREATE TEMP FUNCTION RADIANS(x FLOAT64) AS ( ACOS(-1) * x / 180 ); CREATE TEMP FUNCTION RADIANS_TO_KM(x FLOAT64) AS ( 111.045 * 180 * x / ACOS(-1) ); CREATE TEMP FUNCTION HAVERSINE(lat1 FLOAT64, long1 FLOAT64, lat2 FLOAT64, long2 FLOAT64) AS ( RADIANS_TO_KM( ACOS(COS(RADIANS(lat1)) * COS(RADIANS(lat2)) * COS(RADIANS(long1) - RADIANS(long2)) + SIN(RADIANS(lat1)) * SIN