location

Android - How to determine whether coordinates lie on road in Google Maps

拟墨画扇 提交于 2019-12-04 08:02:35
I need to make a check in my application that determines whether the given coordinates lie on road or not in Google Maps. Is there any function in Google Maps API that can aid me with that? Thanks in advance! As far as I know this can't be done using the Google Maps API. I think your best bet is to use a crowd-sourced dataset such as OpenStreetMap (OSM) . You'd need to set up your own spatial database (e.g., PostGIS ) and import OSM data into the database. Then, you'd create a server-side API (hosted in a web server such as Tomcat or Glassfish ) to receive the mobile phone's current location,

Android GPS Location Speed Unreliable

泪湿孤枕 提交于 2019-12-04 08:01:06
问题 Writing a GPS logging application~ I'm finding the values returned by the getSpeed() method on Locations reported by LocationManager are massively unreliable. I'm using LocationManager.GPS_PROVIDER , filtering the Locations provided through onLocationChanged for best accuracy. Even at single digit accuracy levels the speed returned is generally ridiculously high. We're talking up to 200 mp/h (yes I know it's logged in metres/sec) when the phone is stationary. I'm testing the same code base on

后端必备 Nginx 配置

扶醉桌前 提交于 2019-12-04 07:58:31
概要 防盗链 根据文件类型设置过期时间 静态资源访问 日志配置 日志字段说明 access_log 访问日志 error_log 日志 日志切割 反向代理 禁止指定user_agent nginx访问控制 负载均衡 防盗链 location ~* \.(gif|jpg|png)$ { # 只允许 192.168.0.1 请求资源 valid_referers none blocked 192.168.0.1; if ($invalid_referer) { rewrite ^/ http://$host/logo.png; } }复制代码 根据文件类型设置过期时间 location ~.*\.css$ { expires 1d; break; } location ~.*\.js$ { expires 1d; break; } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { access_log off; expires 15d; #保存15天 break; } # curl -x127.0.0.1:80 http://www.test.com/static/image/common/logo.png -I #测试图片的max-age 复制代码 静态资源访问 http { # 这个将为打开文件指定缓存,默认是没有启用的,max 指定缓存数量

前端必备 Nginx 配置

我的未来我决定 提交于 2019-12-04 07:58:18
Nginx (engine x) 是一个轻量级高性能的HTTP和反向代理服务器,同时也是一个通用 代理服务器 (TCP/UDP/IMAP/POP3/SMTP),最初由俄罗斯人Igor Sysoev编写。 基本命令 nginx -t 检查配置文件是否有语法错误 nginx -s reload 热加载,重新加载配置文件 nginx -s stop 快速关闭 nginx -s quit 等待工作进程处理完成后关闭 复制代码 搭建好nginx服务器并启动过后,我们先看nginx默认配置,再逐个介绍不同使用场景。 默认配置 Nginx 安装目录下, 我们复制一份` nginx.conf`成 ` nginx.conf.default` 作为配置文件备份,然后修改` nginx.conf` # 工作进程的数量 worker_processes 1; events { worker_connections 1024; # 每个工作进程连接数 } http { include mime.types; default_type application/octet-stream; # 日志格式 log_format access '$remote_addr - $remote_user [$time_local] $host "$request" ' '$status $body_bytes_sent

Nginx配置

最后都变了- 提交于 2019-12-04 06:58:17
1、实现反向代理   实现案例(1):打开浏览器,在浏览器的地址栏中输入地址www.123.com,跳转到Linux系统Tomcat主页面 第一部在windows系统中配置host文件   host文件位置:C:\Windows\System32\drivers\etc 下的host   修改host文件:最后追加: 自己的Linux系统ip www.123.com   配置完之后,在浏览器中输入 www.123.com:8080 就会看见tomcat的主页了 第二步:在Nginx中进行请求转发(即:实现反向代理)   在Nginx的配置文件中:配置文件目录 cd /usr/local/nginx/conf/   在文件nginx.conf中配置 listen 80; server_name 47.96.152.80; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; proxy_pass http://127.0.0.1:8080; index index.html index.htm; } 第三步,启动Nginx测试 启动命令:在nginx的 sbin目录下启动:./nginx 在浏览器中输入:www.123.com就能看见Tomcat了   实现案例(2)

Android: placing an ImageView on an exact location on the screen

我们两清 提交于 2019-12-04 06:52:06
问题 I would like to use getLocationOnScreen to get the location of an ImageView, and then I would like to place another ImageView exactly at that place. Assume they both are in the same layout. When the app starts only imgv1 is visible. The user can move and rotate that image. Then the user can press a button and second image, imgv2 should be placed exactly on top of imgv1 so it covers it. Both imgv1 and imgv2 have the same size. For example, assume I have imgv1 and imgv2 as: ImageView imgv1,

Google maps containsLocation on android

拟墨画扇 提交于 2019-12-04 06:41:38
I'm writing an app that needs to determine whether a user falls within one of several defined zones (based on gps location). The Google maps javascript API has an easy to use function containsLocation() . However I want to be able to do this from an app on android, not a web-based service. Does anyone know if such a call exists in the android version of maps? Any pointers will be helpful! A bit late, but here's the answer: com.google.maps.android.PolyUtil.containsLocation() from Google Maps Android API utility library. You can use the Geofencing feature for this purpose. The API's for that are

Finding Location on Google Map

。_饼干妹妹 提交于 2019-12-04 06:34:26
问题 i am trying to find my location on Google Map. My code is here. I have run my app in my telephone but it's unfortunately stopped. Any ideas about what can be the problem ? Thanks. public class MainActivity extends Activity implements LocationListener { private LatLng loc ; private LocationManager locationManager; private String provider; @SuppressLint("NewApi") @Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity

Android: Checking if google settings location is enabled

半世苍凉 提交于 2019-12-04 05:17:07
I'm working on an app that uses google play services. On Some phones, the client returns null for location. This happens because the locaiton option is not enabled on google setting as in the pic attached. How to programatically check if google settings location is enabled in an android app ? http://www.cnet.com/how-to/explaining-the-google-settings-icon-on-your-android-device/ LocationManager lm = null; boolean gps_enabled,network_enabled; if(lm==null) lm = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); try{ gps_enabled = lm.isProviderEnabled(LocationManager.GPS

Why does the LocationManager does not have a lastKnown location?

纵饮孤独 提交于 2019-12-04 05:12:08
问题 I want the location of user and that too just once after that user navigates on his own locationManager = (LocationManager)this.getSystemService(LOCATION_SERVICE); location = locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER); if (location != null) { System.out.println(location.toString()); lat=location.getLatitude(); lng=location.getLongitude(); } p = new GeoPoint((int) (lat * 1E6), (int) (lng * 1E6)); However i am not able to get the location of the user is it because of