geospatial

Get business type/industry from Bing Phonebook API

别等时光非礼了梦想. 提交于 2019-12-18 09:22:22
问题 The below example shows how I'm building the query string that will return a bunch of addresses for the search parameters defined in the query string (in this case, Starbuck's)...I'm wondering if it's possible to use the Bing Phonebook API to define a type of entity that you're looking for e.g. Cafe, Gas Station, Software Company, etc...? function Search(position) { // note a bunch of this code uses the example code from // Microsoft for the Phonebook API var requestStr = "http://api.bing.net

R plot grid value on maps

拥有回忆 提交于 2019-12-18 04:27:26
问题 I have several file with the following format: lat,lon,value. I would like to plot a colored grid map with such value for each one of the lat,lon point and overlapping it over the EU map. Thanks for support. 回答1: There are roughly two options: one using the lattice and sp package and the other using the ggplot2 package: lattice / sp First you have to transform your data to a SpatialPixelsDataFrame (provided by the sp-package), assuming your data is called df : require(sp) gridded(df) = c("lat

MYSQL Geo Search having distance performance

元气小坏坏 提交于 2019-12-17 22:43:58
问题 I have a mysql select statement for a search on my website which is having performance problems when the site gets really busy. The query below searches for adverts from a table with over 100k records, within 25 miles of the given lat and lon and sorts by distance. The number of miles can differ as it is selected by the user. The problem is that I think it is slow because it does the calculations for all records in the table rather than ones that are within 25 miles of the lat and lon. Is it

Is the Haversine Formula or the Vincenty's Formula better for calculating distance?

自闭症网瘾萝莉.ら 提交于 2019-12-17 21:57:00
问题 Which is better for calculating the distance between two latitude/longitude points, The Haversine Formula or The Vincenty's Formula? Why? The distance is obviously being calculated on Earth. Does WGS84 vs GCJ02 coordinates impact the calculation or distance (The Vincenty's formula takes the WGS84 axis into consideration)? For example, in Android, the Haversine Formula is used in Google Map Utils, but the Vincenty Formula is used by the android.Location object ( Location.distanceBetween() ).

Geographical distance by group - Applying a function on each pair of rows

白昼怎懂夜的黑 提交于 2019-12-17 20:51:48
问题 I want to calculate the average geographical distance between a number of houses per province. Suppose I have the following data. df1 <- data.frame(province = c(1, 1, 1, 2, 2, 2), house = c(1, 2, 3, 4, 5, 6), lat = c(-76.6, -76.5, -76.4, -75.4, -80.9, -85.7), lon = c(39.2, 39.1, 39.3, 60.8, 53.3, 40.2)) Using the geosphere library I can find the distance between two houses. For instance: library(geosphere) distm(c(df1$lon[1], df1$lat[1]), c(df1$lon[2], df1$lat[2]), fun = distHaversine) #11429

How to find the overlap of polylines in order to draw the common segment as shaded on google maps

≡放荡痞女 提交于 2019-12-17 19:54:20
问题 I am working on a small project to show inefficiency of routes based on overlap of route segments. So for example, I put together a JSFIDDLE here showing a pink and blue line overlapping between D and E. How can I determine that this stretch of road has an overlap in their routes? Routes would be drawn by a user manually, this example just provides an example of an overlap I am trying to detect: var map; var directionsService; function loadRoute1() { var request = { origin: new google.maps

Python, GEOS and Shapely on Windows 64

混江龙づ霸主 提交于 2019-12-17 19:32:52
问题 When trying to install Shapely on my Windows 64bit computer, I cannot get the GEOS library to work. So far, I have run the OSGeo4W installer from which I installed GDAL (I believe the geos library is included in that package). After that, I checked and I have geos_c.dll on my C:\OSGeo4W\bin directory, but either I have missed some configuration steps or the library does not work. I need Shapely to work, so I also ran pip install shapely after installing GDAL, and it apparently worked

shapefile and matplotlib: plot polygon collection of shapefile coordinates

拥有回忆 提交于 2019-12-17 18:34:05
问题 I'm trying to plot filled polygons of countries on the world map with matplotlib in python. I've got a shapefile with country boundary coordinates of every country. Now, I want to convert these coordinates (for each country) into a polygon with matplotlib. Without using Basemap. Unfortunately, the parts are crossing or overlapping. Is there a workarund, maybe using the distance from point to point.. or reordering them ? 回答1: Ha! I found out, how.. I completely neglected, the sf.shapes[i]

Developing Geographic Thematic Maps with R

北战南征 提交于 2019-12-17 14:59:26
问题 There are clearly a number of packages in R for all sorts of spatial analysis. That can by seen in the CRAN Task View: Analysis of Spatial Data. These packages are numerous and diverse, but all I want to do is some simple thematic maps. I have data with county and state FIPS codes and I have ESRI shape files of county and state boundaries and the accompanying FIPS codes which allows joining with the data. The shape files could be easily converted to other formats, if needed. So what's the

R Plot Filled Longitude-Latitude Grid Cells on Map

别来无恙 提交于 2019-12-17 09:42:09
问题 I have a data frame containing a number of (x,y,z) data points, (x,y) is the lower-right coordinate of a longitude-latitude cell of size w (e.g. a 1-degree grid). The z value has been averaged over this cell. I'd like to plot these points in R so that the entire grid cell is filled with some colour derived from z . The result would look something like one of these images: The projection itself (e.g. Lambert conformal conic, equirectangular) isn't important, just the grid cell plotting. My