maps

Names of the countries on the plot with rworldmap

天涯浪子 提交于 2019-12-06 03:04:53
Good morning, I have spent a lot of time to figure out how can I add a country names directly on plot not like a part of legend, but like part of map. Im using package rworldmap, tried to use identifyCountries () - but it something for interaction (when a user clicks on the map), than I have found a such solution Administrative regions map of a country with ggmap and ggplot2 but it's for ggplot2, and too complicated. Im trying to do it with mapCountryData() . Hope for your help, thanks. data <- data.frame(Country=c('Russia','Cyprus', 'Belize', 'Austria' ,'Virgin Islands', 'Italy','United

When should I use geom_map?

℡╲_俬逩灬. 提交于 2019-12-06 02:59:32
I'm making a choropleth map with added points in ggplot. So, following the last example of the geom_map help docs I came up with this: require(ggplot2) require(maps) set.seed(47) county_map <- map_data("county", "washington") names(county_map)[5:6] <- c("state", "id") countyData <- data.frame(id = unique(county_map$id), value = rnorm(39)) map1 <- ggplot(countyData, aes(map_id = id)) + geom_map(aes(fill = value), map = county_map, colour = "black") + coord_map() + expand_limits(x = county_map$long, y = county_map$lat) print(map1) which works great for the choropleth map. (Aside that I'm

How can I automatically plot markers for addresses on a Google or OpenStreetMap?

故事扮演 提交于 2019-12-06 01:24:44
I have a list of UK addresses and would like to plot them on a google or openstreetmap (I dont mind which). Is there a way to render a batch of addresses on a map with dots to represent the location (rather then the standard marker). To make things slightly more complex, I would like to change the colour and size of some markers. The data source is a street address including postcode and a marker type (size, color). Does anyone know of a site, script, process to achieve this? The geographic region will be a suburb so it is quite a small area. You can use the Google Geocoding service to spin

How can I get the polygon object in google maps, when a path changed?

非 Y 不嫁゛ 提交于 2019-12-06 01:03:27
I have a lot of polygons created dynamically on a Google Maps, using API v3. I don't have a global array of them. I assign event for each after creation, because I need to track the changes made to them by the user. Everything work fine, except one thing. path = polygon.getPath(); //Note, that polygon isn't a global variable //DragEnd google.maps.event.addListener(polygon, "dragend", function(){ SavePolygonToDb(this); }); //Edited google.maps.event.addListener(path, "set_at", function() { //Now 'this' is the path array, not the polygon SavePolygonToDb(????); }); Somehow I need to get the

How to create an event when pressing on a leaflet popup in R?

社会主义新天地 提交于 2019-12-06 00:52:50
I would like to make the tabPanel change in Shiny when I click on a Leaflet polygon. I have a couple of ideas on how to do this, but I can't find the information I need to implement them. I have the leaflet in a tabPanel, but I would like to switch to another tab when a polygon is clicked on. leaflet(llmap) %>% addTiles() %>% addPolygons(stroke = F, fillOpacity = .8, smoothFactor = .5, color=~pal(x), popup = pop) I thought of making popup=updateTabsetPanel(session="New Tab") , but that doesn't work. My other idea is to call updateTabsetPanel(session="New Tab") anytime the user clicks on a new

.Net windows application WebBrowser / Google Maps API v3

故事扮演 提交于 2019-12-06 00:11:28
I'm developing an application in which the user will be able to enter a desired address and then press a button. This address will be found on the WebBrowser control in a .net windows application. I know that you can run javascripts on WebBrowser by using the WebBrowser1.DocumentText , and the calling the script by WebBrowser1.Document.InvokeScript ... I'm having little issues with this and I was wondering if someone could show me the right way in order to do it. CODE: Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click Dim AddressMap As String

Plotting a map with matplotlib basemap - horribly slow

只愿长相守 提交于 2019-12-05 20:52:20
Plotting a very, very simple map of only europe in matplotlib / basemap takes so much time ( around 10 seconds! ). This is just unreal!? Setting of resolution is only "l" (low). Here is the very simple code: import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from mpl_toolkits.basemap import Basemap m = Basemap(projection='stere',lon_0=5,lat_0=90.0,rsphere=6371200.,\ llcrnrlon=-25.0,urcrnrlon=72.0,llcrnrlat=26.0,urcrnrlat=65.0,resolution='l') m.drawcoastlines(linewidth=0.2) m.drawcountries(linewidth=0.2) plt.savefig('/var/www/map.png') I need to plot hundreds of these maps

Fast and Frequent location Update in android..?

余生颓废 提交于 2019-12-05 20:07:12
public void getUserLocation() { Location location; TextView lon = (TextView) findViewById(R.id.textView2); TextView lat = (TextView) findViewById(R.id.textView3); boolean GpsEnable = false, NetworkEnabled = false; locationManager = (LocationManager) this.getSystemService(Context.LOCATION_SERVICE); // String locationProvider = LocationManager.GPS_PROVIDER; GpsEnable = locationManager .isProviderEnabled(LocationManager.GPS_PROVIDER); NetworkEnabled = locationManager .isProviderEnabled(LocationManager.NETWORK_PROVIDER); // locationManager.requestLocationUpdates(locationProvider,0,0

feature maps尺寸的计算

徘徊边缘 提交于 2019-12-05 19:37:39
默认feature maps的宽和高相等。 常规卷积 输入的feature maps尺寸为i,卷积核的尺寸为k,stride为s,padding为p,则输出的feature maps的尺寸o为 当padding为 VALID 时,p 值等于 0,代入相应的 i,k,p,s 就可以相应的计算出 o 值了。 当padding为 SAME 时,步长 s 为 1 时,输出的 o == i,我们则可以计算出相应的 p 值为 p = (f-1) / 2 空洞卷积(Dilated convolutions) 这里引入了一个新的超参数 d,(d - 1) 的值则为塞入的空格数,假定原来的卷积核大小为 k,那么塞入了 (d - 1) 个空格后的卷积核大小 n 为: 输入的feature maps尺寸为i,stride为s,padding为p,则输出的feature maps的尺寸o为 来源: https://www.cnblogs.com/Peyton-Li/p/11941953.html

Determine if a string is a valid geographic location

南笙酒味 提交于 2019-12-05 19:04:43
I've got a bunch of "locations" - some are accurate (gaborone, botswana), some are geocodes (40.75,-73.997) and some are completely useless (#siliconcape). I need to find a way to run through the list and determine the City and Country of each string and geocode, and return nulls for the invalid locations. Is there some sort of library/service/api/method that can be used to determine whether or not a given string represents a valid geographical location? While accounting for typos, ordering errors, etc? Probably the easiest method would be to use something like the Google Geocoding API . It'll