Shading a certain distance from country borders in google maps - border

Is it possible to shade an area on a map that lies within a certain distance (say 100km) from a country's border? I anticipate this would be using the polygon tool in some form.
For example, I would like to create a map that shades the area in France that lies within 100km of the border with Germany.
Thank you.

Related

Google maps zoom level overlay

I need to attach marker for many cities on the map. My problem is that due high density of cities around Europe and UK markers and labels overlay each other and entire visualisation looks terrible.
First thing that I can do is to use a smaller markers. But what should I do with label? My idea was to show just subset of some cities every time user zooms in display more and more.
But how do I make sure labels never overlay each other?
Thanks for any help!

Heat map visualization for discrete values on Google Maps

I'm working on the following scenario: I have a geographical location and I need to create a heat-map visualization of travel times (by car) from that location to anywhere around. I'm planning on using Google Distance Matrix API for getting travel duration. But, since it has a limit on the no of API calls, I need to somehow limit the calls.
My plan, so far, is the following: compute the travel duration (basically a numeric value) to a set of points evenly distributed on a grid around the given position (e.g. 0.5km east, 0.5 km east-0.5km north, 0.5 km east-1 km north etc.). This points would represent the centers of square-shaped areas and I will consider the travel duration to the center as the travel duration to anywhere in the area. Display these areas as colored squares on a Google Maps in a heatmap style.
A good example of something that looks alike is this: http://project.wnyc.org/transit-time/#40.72280,-73.95464,12,709 .
So, my questions are:
Does it seem like a good strategy?
Is there a better visualisation strategy for something like this?
How can I create those square-shaped colored areas on Google Maps?
Thanks!
Calculating duration would surely involve traffic flow rather than simply distance. If your calculations are purely on distance you could use the Google Maps direction requests to calculate the distance to each point.
I'm not sure a heat map is the way forward for this scenario.
There a number of way you could achieve this. Here's a few:
a. Use a custom overlay
(https://developers.google.com/maps/documentation/javascript/examples/overlay-simple)
b. Draw polygons on the map and give them different colours based on
the journey duration. This would involve taking the area in question and slicing it up in to polygons however you need to. These polygons could take the same shape as your example. You would need to be rather precise with your latlng. SQL's spacial querys would help you here depending on the tech your using. (https://developers.google.com/maps/documentation/javascript/examples/polygon-arrays)
c. Depending on how specific you wanted to be you could draw circles with different radius value and different colours.
d. You could make custom markers in the shapes you require and add them to the map in the correct latlng in order to fill an area. You could have different markers for different duration and add them accordingly.
I'm sure there are other options as well.

Google Maps - Create a polygon around existing markers

I dont know if this is possible but I use a google map to plot out positions of entities via markers on an overlay. I would like to be able to create a polygon or some other sort of overlay object around all the created markers, highlighting the extent of the markers, sort of a catchment area diagram. I wont know before all the markers are retrieved from the database and mapped what the extent is.
Anyone have any ideas how to approach this..?
Thanks
I think you are looking for the Convex Hull of the points
In mathematics, the convex hull or convex envelope of a set X of points in the Euclidean plane or Euclidean space is the smallest convex set that contains X. For instance, when X is a bounded subset of the plane, the convex hull may be visualized as the shape enclosed by a rubber band stretched around X.
Example using the Google Maps API v3 on a random set of points

Mapping GPS coordinates to an image

I have attempted to map some GPS coordinates (longitude / latitude pairs) onto an image of the region of the world that they correspond to. The math was not complicated simply offsetting and then transforming the numbers with a multiplier. However this worked fine for points in Australia, but not for points in New Zealand.
The result is that the points seem to drift south near the middle of the image then slowly correct before the bottom.
Is there some extra math which needs to be taken into consideration for plotting points on a map?
Note:
during my diagnostic excercise I placed my map over google maps and noticed that my version of Australia was different to google maps, but New Zealand was the same as google maps. But the plotting for Australia works but for New Zealand does not.
Longitude/Lattitude is spherical coordinatesystem and will only work if you have a globe to show your map on. In your case you have a flat map and need to project the coordinates onto a flat surface. The maps that Google uses is created with an Mercator-like projection.
What kind of projection you want to use depends on how big area your map consist of. Most countries have their own projection that fit best for their purposes.
Those transformations are quite tricky to work out by hand if your not a mathematician but there are good libraries for transformations like Dotspatial and GDal.

How to create a grid overlay of earth? (I.e., ignoring the circular shape of earth when calculate coordinates)

I am working with an application that dumps the latitude/longtitude coordinates into my database. My goal is to apply a grid layout to the earth (using Google Maps), group the coordinates together and update the correct grid cell. However, I am stuck with regards to how to create the grid overlay.
All the formulas I have found (for example here or the Google Maps computeOffset) take the earths shape into consideration. When using these formulas to calculate the coordinates for the grid cells, the lines naturally becomes skewed as the distance increases. My question is therefore, is there a formula for calculating latitude/longtitude that ignores the shape of the earth (where the input is a set of coordinates, bearing and length in meters)? I.e., what I want to achieve is:
If I have a point (0,0) and I want to find the position that is 100m to the east, I want the formula to return (latitude_offset_100m,0). Using a formula which considers the circular shape of the earth, this might give for example (latitude_offset_100m,longtitude_offset_5m).
I finally figured out how to achieve what I wanted. By using rhumb lines, you can get "straight" lines on a Mercator projected map (like Google maps).