Partition a map into uniform regions - google-maps

I'm trying to build a web site for visualization of some statistical information using Google Maps. Effectively, what I'm trying to do is to divide the map into adjacent cells(for example the honeycomb pattern) and for each data point, identify which cell this belongs to and aggregate all points that belong to one cell so that I can display some statistic about that cell on the map. Is there a simple way to get this done using Google maps and d3.js?
Please note that the map we're talking about includes just one city and all my data points are within this city. Also an important step here is to identify which cell on the map a lat/long coordinate belongs to and this is where I'm facing challenges right now.
Thanks in advance.

There is a D3 plugin called hexbin that seems to be exactly what you're looking for. You can see examples of its use here, here, and here. You should be able adapt these for use on any scale map: city, country, or otherwise.

Related

Calculate distance between two points including country borders info

I am trying to find any solution that can calculate distance between point A and point B BUT including information about country's border.. I checked Google Maps and Bing Maps APIs - both of them don't provide such features..
Any suggestion? Thank you in advance
First you can create a database of country boundaries. Country boundaries are easy to find online. Here is one source: http://www.diva-gis.org/Data
You can upload these into SQL 2008/2012 or Azure (express version is free) using the Shp2Sql tool here: http://www.sharpgis.net/page/Shape2SQL.aspx
Then using Bing Maps you can calculate a route and get the route point's. You can use the route points to create a LineString object and do an intersection test against the country data to get all the countries boundaries that line passes through. Then you can go through each resulting country and crop the line to the borders of the country. With the crop line you can then measure it's length. All of this can be done with the spatial tools in SQL. Here are some useful links.
http://msdn.microsoft.com/en-us/library/ff701713.aspx
http://technet.microsoft.com/en-us/library/bb933901.aspx
http://technet.microsoft.com/en-us/library/bb933962.aspx
http://technet.microsoft.com/en-us/library/bb933895.aspx

Drawing districts of large cities using google maps or openstreetmaps APIs

Is it feasible to build a map using the google maps API or Openstreetmaps which has a superimposed layer that displays districts of a city? For example, Manhattan is a region within New York City, and I would like to be able to plot the boundaries of this region, and any neighboring regions on a map.
Where would one obtain the data for these regions (worldwide)?
I guess this can be achieved by using overpass turbo (which in turn uses the Overpass API) and the MapCSS styling feature by querying for all boundary=administrative relations with a certain admin_level=* tag (6 is for US counties). Although I'm not quite sure if the random colorization is actually possible.
Take this example as a start and see if you can improve it.
Is it feasible to build a map using the google maps API or Openstreetmaps which has a superimposed layer that displays districts of a city?
It is possible. Feasible is up to you.
I generated this map at OpenStreetMap.org.
Where would one obtain the data for these regions (worldwide)?
Photoshop would be one place to start.

How to compare Google Maps coordinates on an accurate way?

I have the coordinates(lat, lng) and the information associated to this point in an excel sheet.
I want to compare the coordinates that I have stored on a database(lat, lng) with the excel ones.
My main idea is to show the correct info about the road point on the info window associated to the marker.
My doubt is about how to choose the coordinates on the most accurate way?.
Any suggestion?
So I think I understand what you are doing - capturing the coordinates of a user's location and then you want to find information about what is nearby to that location. If I have that correct, I suggest you take a look at the Places Library.
Google provides a library/service that allows you to send a requestthat includes a location and radius or coordinates that define a rectangular bounds and the service will return information about nearby places of interest. There are many ways to refine the searches to focus on different types of features.
I think this is what you are looking for - if not, provide a little more detail and I will try to help you.

Google Maps Android - set too many markers

My question is, What is the best way to set to many markers on google maps on android program? I have a sqlite database with longitude and latitude for every markers.
For example add all markers 1km around the current location
Get the range of longitude and latitude on moving map and display markers between that range
How can i get the range of longitude and latitude?
Based on the comments from above you will need to do the following:
1) Use the Google Api maps reference for Android to determine the visible area on the map and if one of your points is within the determined area.
2) Carefully remove points added to the map but which are no longer needed. (IE the user has moved the map). Be careful at this point not to remove a point before the map has finished updating, as the user could tap on a point and crash the app.
3) Decide what you're doing about zoom level, if a user zooms right out then you need to do one of the following:
a) Display nothing, give the user feedback to zoom in for points.
b) Use an algorithm to plot a point at an average of a point.
c) Display a marker as with b but centered in a region with the number of points in that region.
I would advise lots of research on stack regarding previous questions as this topic has been covered in some detail.
For c) there has been a good iOS implementation which is now a for-sale library, however the name of the library escapes me at the moment. I am told the implementation is excellent.
I cannot express enough that you need to make sure your map operations are done asynchronously, be wary of this or fall into lots of traps.

Google Maps Store Locator Search field for embedded map

I've embedded a map on a clients site, with their various store locations, using the google saved maps technique: http://passportal.com.au/stockists So basically I don't want store the marker locations in a database, I'm just interested in using the marker positions on the saved map as seen in this demo: http://maps.google.com/help/maps/getmaps/plot-multi.html
I've seen it on plenty of sites and am wondering if there is an easy way to add a search field to find the closest marker to the users address. Something like this: http://www.victoriantextiles.com.au/store-locator
The closest I could find was a google gadget that allows you to type in directions: http://www.google.com/ig/directory?synd=open&hl=en&gl=en&url=http://igwidgets.com/lig/gw/f/islk/89/slkm/ik/s/1329844/87/charles447/google-maps-driving-directions.xml
Any help would be great, thanks!
For this purpose, I use Google Maps API Distance Matrix where I would pass in one origin - user's location and multiple destinations - our dealers. Then I sort the results by distance and take 3 closest to display in a list. Works pretty fast, however, I don't know how you'd achieve this without having some sort of database of your store addresses.