->

26 August 2009

Google Map Static Map Upgrade (v2)

Google Map Static Map Upgrade (v2)

New Features Encoded Paths, Polygons & Geocoding

update:
here is a useful tip or two using 'MyMaps' created features:
http://imagine-it.org/google/staticmap/encodemymap.php
(thanks to @pamelafox)

Google have made some changes - many top requested features have been included, but due to these feature requests there are some changes required for you code.

  • Locations (in center, markers, or path parameters) can now be specified as addresses instead of latitude/longitude coordinates.
  • Paths can be specified as encoded polylines.
  • Paths can be filled and rendered as polygons.
  • Colours can now be specified as any 24-bit or 32-bit colour.

Use of the Google Static Maps API is unchangedwith a query limit of 1000 unique (different) image requests per viewer per day

Google Static Maps v2
encoded polygon in Google Static Maps v2

http://maps.google.com/maps/api/staticmap?size=400x400&path=fillcolor:0xAA000033|color:0000ff|enc:ykfyHln@bBtLhJkI|JyGdChAzHiL
|BfBvH}IlEvCl@tG%60@rGYjIXbLpApEbC_@a@kJ~@cUpB_@tH~D~FzG%60Eg@
qAeK[iGvBgEeDwB%60A}EuFwA|AqGvG_D?_QdDiJgAiElCuOkGuC_I_Is@iK|
AuFz@_GYuGuEj@{PtG_CTbA~OsJKa@sFcH?XrVQhGi%60@dj@zDdVwRdPrCbO
&key=YOUR API KEY&sensor=false


Note: The fastest way to create an encoded polygon is to create a polygon in Google Earth then right click the polygon and copy & paste into this site

http://facstaff.unca.edu/mcmcclur/GoogleMaps/EncodePolyline/encodeForm.html
check your polygon is located correctly. The click then 'Show Code'
The line {points:
contains the encoded polygon. use this for your static map.

Having been re-written The Static Maps API v2 changes are:

red=old green=new
  • Instead of specifying maptype=mobile, specify the desired map type (like maptype=hybrid) and the parameter mobile=true. This way, we can provide mobile optimised tiles for every map type.

  • The colour for a path is now specified using "color", not "rgba":

    For example:
    &path=rgba:0x0000FF80,weight:5|37.40303,-122.08334|37.39471,-122.07201|37.40589,-122.06171
    becomes:
    &path=color:0x0000FF80|weight:5|37.40303,-122.08334|37.39471,-122.07201|37.40589,-122.06171

  • Similar to how the path styles were specified before, the marker styles are now specified using key:value pairs, separated by pipes [|]. Marker labels are now denoted using uppercase alpha characters instead of lowercase alpha characters.

    For example:
    midreda
    becomes:
    size:mid|color:red|label:A

  • Instead of specifying the marker style after each marker parameter, specify the style at the beginning of the markers= parameter, and that style will apply to all of the markers proceeding. If you want to show markers with different styles, just supply a new markers= parameter for each one.

    For example:
    markers=37.400465,-122.073003,midreda|37.437328,-122.159928,midreda|37.369110,-122.096034,smallblue
    becomes:
    markers=size:mid|color:red|label:E|37.400465,-122.073003|37.437328,-122.159928&markers=size:small|color:blue|37.369110,-122.096034

  • Marker labels now require uppercase alphanumeric characters in the label parameter. This will allow us to later supply lowercase characters if we wish.

    For example:
    markers=37.400465,-122.073003,midreda
    becomes:
    markers=size:mid|color:red|label:E|37.400465,-122.073003

  • Instead of using the span=parameter to make sure that your static map shows a particular viewport, use the visible= parameter instead, and specify a list of coordinates that must be shown.

    For example:
    center=0,0&span=20,20
    becomes:
    visible=10,-10|-10,10

  • The frame parameter is no longer supported.

After upgrading your existing functionality, you might be interested in adding some of the new API functionality to your website.

Tools: Make A Static Map Wizard (V2)

http://gmaps-samples.googlecode.com/svn/trunk/simplewizard/makestaticmap.html

Source:

http://code.google.com/apis/maps/documentation/staticmaps/upgrade.html

Labels: , , , , , , ,

02 July 2008

Satbeams Map

Satbeams Map

Satbeams Generates Transparent Polygons
Satbeams generates transparent polygons on the fly for each selected satellite 'beam'.

Satbeams Signal Strength Map
This example shows signal strength (useful for finding out receiver dish/antenna size)
http://www.satbeams.com/footprints?beam=5223


"The site allows to view the Satellite Coverage maps for most of the satellites all over the globe in Google Maps format. At the same time it is possible to place markers on the map stating which frequencies/channels one can receive at the specific location and view what others can receive from the selected satellite in different places of the world."
Alexander -Satellite Coverage Maps

Current stats (subject to expanding numbers)

Number of Satellites: 226
Coverage maps: 641

Number of receivers: 4933
Number of Antennas: 289
Number of LNBs: 416


Registered Users have more
  • Save markers on the map and report which satellites and beams one can receive there
  • See the markers saved by other members (perhaps there is someone already receiving selected Satellite/Beam in the neighbourhood)
  • Add Satellite equipment to the reception report including the antenna model, receiver and Lnbs (Low-noise Block Converter)
  • Report different news - frequencies, channels and even new equipment (i.e. receivers, dishes, Lnbs...)
As a result, the more people place markers with their reports the more accurate information is available to Sat-TV users all over the globe.

Mapperz notes there was a lot of work done on the website - it took
several months of several people to make the website.
More features to come in a 2-3 months from now. So stay tuned.
Congratulations to the team for creating a useful mapping tool.

related:
http://www.dishpointer.com/
http://mapperz.blogspot.com/2007/08/satellite-finder-map-updated.html

Labels: , , , , ,

13 February 2008

Spreadsheet Mapper 2.0

A Google tutorial shows you how to enter data in an on-line spreadsheet to generate a set of markers in Google Earth and Maps and Google Maps API. Google Docs' web-based, collaborative editing allows your team members to simultaneously enter data and instantly publish updates.

"Using this tool you could: showcase your organization's projects, program sites or partners; map your offices, volunteers, or resources; or visualize your data on local, regional or global scales."



Time to create Lines and Polygons...
Lines

Excel to KML (now with Line and Arrows from GPS track logs) http://www.earthpoint.us/ExcelToKml.aspx


Polygons

http://code.google.com/articles/support/ezdigitizer.htm
(copy and paste the code into excel or notepad and save as kml)

Official Link:

http://earth.google.com/outreach/tutorial_mapper.html

source: http://freegeographytools.com/

Labels: , , , , ,

23 January 2008

The Weather Cam Map (UK)

The Weather Cam Map (UK)

Weather Cam MapWeather Cam Map Accuracy
Webcams show you the weather live - Coloured Polygons show you an accuracy ratio

  • Nice clean map
  • Easy to use and update
  • Informative and up-to-date
Note:
This is not intended to show how weather forecasting can be inaccurate, but more to show which areas are served well by a general weather forecast.

Map created by beats! design

Suggestions?
Maybe a georss overlay from the Met Office?
(as google maps api supports georss)

Example is BlueGhost UK Weather

Labels: , , , , ,

08 September 2007

Google Maps API Clickable Lines & Polygons

modified by Mapperz)

In the latest release (v2.88) of the Google Maps API, Lines (Polylines) and Polygons are now clickable events to GPolyline and GPolygon, much to the enthusiasm of developers in the Google Maps API Group Forum. Since a few developers started speculating on how this is being implemented in the API, all the juicy details right here. Warning: Algorithms ahead!

Polyline Hit Detection

As polylines have no intrinsic width, detecting clicks on polylines is something of a judgement call. To detect polyline clicks, this method needs to determine two things

  • Whether clicks are close enough to a polyline to count as a click
  • Which segment of the polyline is the closest to the click.

Overview of the Algorithm

Click detection begins by measuring the distance (in pixels) between the clicked point and the polyline. For each segment of the polyline, the computed distance between the clicked point and the nearest point along that segment. Then take the minimum of these distances as the closest segment; if the distance is then small enough, it is declared as click on the polyline.

Reducing the Sample Set

Note that the simple algorithm has to look at every segment of the polyline. It can be quite slow for big polylines i.e. driving directions). There are a few heuristics which drastically improve the simple algorithm:

  • Given the bounds of the currently visible map viewport, discarded points which are off screen. This can drastically reduce the number of points to consider.
  • Zooming out from a detailed polyline, generalising the segments of the polyline into a simpler group of segments without noticeably changing its shape. In the example below, a simplify a polyline from 9 points at the highest zoom level to 4 points at a more zoomed-out level.

Using Bounds Trees

If a clicked point is far away from a segment, it is discarded from consideration. Taking advantage of this fact by pre-computing the bounds of groups of segments; if a clicked point is far from these bounds, it skips distances for all of the enclosed polylines. By recursively combining these bounds for larger and larger groups of segments, "bounds tree" that allows to skip most of the segments when performing hit detection.

This dramatically speeds up polyline hit detection. For example, detecting clicks for complicated polylines like the Camden Cycling Map.

Camden Cycle_Map - Clickable Lines

Polygon Hit Detection

Detecting whether a clicked point is within a polygon is more straightforward, and less open to interpretation. We first draw a straight line from the clicked point to the right of the screen. Each time this test line crosses a segment of the polygon, it changes state from being inside to outside or vice-versa. If the test line crosses an odd number of segments then the point is determined to be inside the polygon, whereas if the test line crosses an even number of segments then the point must be outside.

Many of the same improvements for polylines in polygon detection, using the map viewport and zoom level to drastically reduce the number of segments to consider, and using a bounds tree to avoid performing unnecessary intersection tests.


Original Post modified here by Mapperz

Camden Cycle Campaign is one of the very first to use this functionality in full effect. Well done.

"Our primary aim is to get more people to cycle and to improve things for those who already do so."

Labels: , , , , ,

02 August 2007

My Maps in your Blog

My Maps in your Blog

With clickable, points lines and polygons!



This demonstrates how easy it is to add Google 'My Maps' to your blog

This is the code at does it available from http://www.mymapsplus.com/



Click the small black arrow to close the legend to view the map in the post here.

*please note this a fictitious scenario for example purposes

Labels: , , , , , ,

13 February 2007

ArcGIS 9.2 Simplify Polygons

ArcGIS 9.2 Simplify Polygons (Generalization)

"Simplifies a polygon by removing small fluctuations or extraneous bends from its boundary while preserving its essential shape."

Simplify Polygon (Data Management) (ArcInfo only)

The process produces two output feature classes, a polygon feature class and a point feature class. The polygon output will stores the simplified polygons. The point output will store points, if any, representing polygons that are collapsed to zero-area.
This point feature class is used to transfer the attributes of the polygon.

Generalize Polygons Original
The process is hidden but the polygon is transfered to a line then the simplification/generalization is applied to a line. The new polygon is the result of the simplified lines rebuilt into polygons with the point used as the attribute container between the process.


Generalizing Polygons ArcGIS 9.2



Generalizing Polygons ArcGIS 9.2 Result
Pre ArcGIS 9.2 Generalizing Polygons
This method was created in ArcGIS 9.x prior to 9.2 using this exact method.
note the Append tool is used. This is because a Geodatabase template (with pre-defined Subtypes) is used. This method deletes all features then add (appends) all new generalised features back in to the correct subtypes. Therefore maintaining database control if topology rules are to be applied.
Tip: Save out Topology rules (.rul) delete all topology as this prevents editing feature classes that have topology. Load topology rules back into the Geodatabase and validate to complete the process.

Web help
Simplifying and smoothing features

Mapperz uses this frequently

Labels: , , , ,