Google Maps Engine Cookbook Simple recipes for common map types

Google Maps Engine Cookbook

Copyright © 2014, Google, Inc. 9/3/14

Google Maps Engine Cookbook

Cookbook contents

Before you begin: Quick tour of the app The ABCs of building a map Recipes 1. Map with point data 2. Map with polygon data 3. Base map with raster image 4. Adding a legend Glossary

Google Maps Engine Cookbook

Page 3

Before you begin: Quick tour of the app

Open Google Maps Engine and click each heading in the left column to become familiar with the subheadings.

(1) Upload data

(3) Create a map and add layers. (2) Create a layer and add data.

Google Maps Engine Cookbook

Page 4

The ABCs of building a map

In Google Maps Engine, you always follow these three basic steps to make a map: A.

Upload data

Advantages of this flexible, modular setup This modular setup creates a flexible and efficient system. Data can be used in more than one layer. Similarly, a layer can be used in more than one map.

Vector, image, terrain, or KML

B.

Prepare a layer with the data If it’s vector data, you can style it.

C.

Add the layer to a map A map consists of one or more layers.

Map Map

After you complete the recipe ABCs, serve your map—view, publish, and share it!

Google Maps Engine Cookbook

Page 5

Recipe 1 | Map with point data

Ingredients

About the example files



A shapefile containing the point data (.shp extension).



Associated files containing additional metadata. These files have the same name as the shapefile but with different file extensions. Click to download big_cities.zip, then unzip it.

This example uses a shapefile that contains data on the population of major world cities. You can add styling rules to highlight different attributes of this data (for example, relative size of the cities).

Recipe ABCs A.

Upload the data

Upload the data files View the uploaded data

B.

Prepare a layer

Create the layer Style the layer Create display rules for styling Add filters to a display rule

C.

Add layer to map

Add the layer to a map

D.

Serve

View, publish, and share the map

Google Maps Engine Cookbook

Page 6

Recipe 1 | Map with point data: Upload the data cont.

Upload the data files 1.

Click the Up arrow to select Files .... The Upload dialog appears.

2.

Click Browse and find the shapefile (.shp) and associated files (these are often referred to as sidecar files). Select all files and click Open.

3.

Choose a name for your data source (for example, Populated Places) and enter a short description (for example, From Natural Earth Data; http://www. naturalearthdata.com/).

4.

Click Upload. Wait until the data is fully processed (this takes some time). Check the status message at the top of the page to see when it’s finished.

Google Maps Engine Cookbook

Page 7

Recipe 1 | Map with point data: Upload the data cont.

View the uploaded data ★

Press Click to view vector table and you’ll see blue placemarks.

Google Maps Engine Cookbook

If you have trouble uploading your data file: Check that you’ve uploaded all of the supporting sidecar files: same name as . shp file but with .shx and .dbf file extensions.

Page 8

Recipe 1 | Map with point data: Prepare a layer cont.

Create the layer 1.

Press the browser ⬅ to return to the Data Details page.

2.

In the left column, click Create styled layer.

3.

Enter a name for the layer (for example, Cities of the World).

4.

Click Create.

Google Maps Engine Cookbook

Page 9

Recipe 1 | Map with point data: Prepare a layer cont.

Before applying the filter

Style the layer This will make the orange dots for the largest cities: 1.

Click Add rule.

2.

Type Largest Cities as the display rule name.

3.

Click the blue dot to display the palette of point icons.

4.

Click the large red dot.

5.

Click Add filter. ● For the attribute, select scalerank. ● For the operator, select <. ● For the string, select 1.

6.

Click the red Apply button.

After applying the filter

Wait … something’s not right. When we applied the Largest Cities filter, a lot of the placemarks disappeared.

Google Maps Engine Cookbook

Page 10

Recipe 1 | Map with point data: Prepare a layer cont.

Order of display rules is important! Display rules are applied to the data in the order they appear on the page. Be sure you have a default case that applies to the “leftover” pieces of data that aren’t covered by the previous rules.

More on styling a vector layer, from the Google Maps Engine help center: ● ● ● ●

Selecting features for styling Tips for styling a layer Styling points Styling lines

You can create additional display rules and filters for other cities. Just be sure to include the generic, “catch-all” rule as the final one.

Google Maps Engine Cookbook

Page 11

Recipe 1 | Map with point data: Prepare a layer cont.

To fix the problem in the example To fix the problem, recreate the default display rule that specifies a blue dot (without any filter). Now you have the two display rules shown here--and all the data is shown on the map.

Google Maps Engine Cookbook

If you don’t see all placemarks: Check the logic of your filters to see that they cover the complete range of your data. Be sure to include a “catch-all” filter at the end to account for data that doesn’t match the earlier filters.

Page 12

Recipe 1 | Map with point data: Prepare a layer cont.

Dealing with dense data

Add another rule:

Next, experiment with creating different display rules for different zoom levels. When the user is zoomed out (for example, zoom levels 1 through 8), it’s a good idea to show less data than when the viewer is zoomed in. 1. 2.

Try adding the display rule shown at the right as the second display rule for this layer (green arrows indicate changes). To reorder display rules, hover next to the rule title and click the three dots that appear, then drag the display rule box to the desired location.

Google Maps Engine Cookbook

Page 13

Recipe 1 | Map with point data: Prepare a layer cont.

Changing the zoom level



As you zoom in to the map, the zoom level number increases. For the “catch-all” filter (the last one), change the lower Zoom level to 5, so that these placemarks are not shown when the user first views the map (level 0). To change the zoom level, drag the end of the rule to the desired zoom level. You may need to experiment to find the best zoom level for different data sets. Click Apply to see the results.

Google Maps Engine Cookbook

Page 14

Recipe 1 | Map with point data: Add layer to map cont.

Add the layer to a map 1.

Click Exit to return to the Data Details page.

2.

In the left column under Layers, click Add to map.

3.

Click Create new and enter Cities of the World as the map name.

4.

Click Add to map, which publishes the layer.

Google Maps Engine Cookbook

Page 15

Recipe 1 | Map with point data: Serve cont.

View and publish the map 1.

In the upper-right corner of the map preview window, click Publish map.

2.

In the drop-down menu, click View published map.

3.

Click Map and then select Satellite to see what your map looks like in Satellite view.

Share the map 1.

Click the Sharing icon

2.

Next to Published version sharing, click Change.

3.

Next to Specific people can access, click Change.

4.

Now, you can publish your map: a. b. c.

5.

.

To anyone on the web (it appears in searches) Only to users with the link (it won’t be indexed for searching) To specific users and groups.

Click Done.

Google Maps Engine Cookbook

Page 16

Recipe 2 | Map with polygon data

Ingredients

About the example files



Shapefile (.shp extension) with polygon data



Associated sidecar files that contain additional metadata. These files have the same name as the shapefile but with different file extensions. Click to download statehood.zip, then unzip it.

This example uses a shapefile that contains data on states in the USA. You can add styling rules to highlight different attributes of this data (for example, year admitted to the Union).

Recipe ABCs A.

Upload the data

Upload the polygon data

B.

Prepare a layer

Create the layer Add styles to polygons Add more display rules and filters Choose meaningful colors

C.

Add layer to map

Add the layer to a map

D.

Serve

View, publish, and share the map

Google Maps Engine Cookbook

Page 17

Recipe 2 | Map with polygon data: Upload the data cont.

Upload the polygon data 1.

Click the Up arrow to select Files ....

2.

Click Browse and find the shapefile (.shp) and associated sidecar files. Select all files and click Open.

3.

Choose a name for your data source and enter a short description.

4.

Click Upload. Processing the vector table data takes some time. Check the status message at the top of the page to see when it’s finished.

5.

Press Click to view vector table and you’ll see blue outlines for each polygon (state), filled in light blue.

Google Maps Engine Cookbook

Page 18

Recipe 2 | Map with polygon data: Prepare a layer cont.

Create the layer 1.

Press the browser ⬅ to return to the Data Details page.

2.

In the left column, click Create styled layer.

3.

Enter a name for the layer (for example, Statehood).

4.

Click Create.

Google Maps Engine Cookbook

More on styling a vector layer, from the Google Maps Engine help center: ● ● ● ●

Selecting features for styling Tips for styling a layer Styling points Styling lines

Page 19

Recipe 2 | Map with polygon data: Prepare a layer cont.

Add styles to polygons Next, create a set of filters to color groups of states according to when they were admitted to the Union. 1.

Click Add rule.

2.

Type a name for this display rule (for example, Earliest States).

3.

Move the left end of the zoom level slider to level 3.

4.

For your polygon style, specify a fill color, border color, and border width.

5.

Click Add filter. a. For the attribute, select YEAR_ADM. b. For the operator, select <. c. For the string, select 1800.

6.

Click the red Apply button.

Google Maps Engine Cookbook

Example of display rule YEAR_ADM < 1800 applied. All states admitted before the year 1800 are now shown in purple (or whatever color you chose in Step 4). Tip: Use the + button to zoom in to at least level 3 on the map.

Page 20

Recipe 2 | Map with polygon data: Prepare a layer cont.

Add a second display rule with filters 1.

To add a second display rule, repeat steps 1–4 in the previous procedure, Add styles to polygons. Use a bright blue color.

2.

Click Add filter. a. For the attribute, select YEAR_ADM. b. For the operator, select >=. c. For the string, select 1800.

3.

Click Add filter again. a. For the attribute, select YEAR_ADM. b. For the operator, select <. c. For the string, select 1850.

4.

Click the red Apply button.

Google Maps Engine Cookbook

First (YEAR_ADM < 1800) and second (YEAR_ADM >=1800, YEAR_ADM < 1850) display rules applied.

Page 21

Recipe 2 | Map with polygon data: Prepare a layer cont.

Add two more display rules 1.

Use a light blue for the next set of states. Add a third display rule, with these filters: ● ●

2.

YEAR_ADM >= 1850 YEAR_ADM < 1900

For the final display rule, specify a very pale color (for example, pink/lavender) for the fill and black outlines. This rule applies to the remaining states, so you don’t need to specify a filter for it.

Google Maps Engine Cookbook

Page 22

Recipe 2 | Map with polygon data: Prepare a layer

Choose meaningful colors Notice that the sample map at the start of this recipe used a variety of colors for the different groupings of states: yellow, green, blue, and red. Though attractive, the colors have no relation to the data being presented. In the step-by-step example, we’ve suggested a range of colors from dark to light, with the darkest states being the earliest admitted to the union, to the lightest being the last admitted. If possible, choose a color palette that suggests something about the map data.

Google Maps Engine Cookbook

First, second, and third (YEAR_ADM >=1850, YEAR_ADM < 1900) display rules applied.

Page 23

Recipe 2 | Map with polygon data: Add layer to map cont.

Add the layer to a map 1.

Click Exit to return to the Data Details page.

2.

In the left column under Layers, click Add to map.

3.

Click Create new and enter and a name for your map (for example, Statehood).

4.

Click Add to map, which publishes the layer.

Google Maps Engine Cookbook

Page 24

Recipe 2 | Map with polygon data: Serve cont.

View, publish, and share the map 1.

In the upper-right of the map preview window, click Publish map. In the drop-down menu, click View published map.

2.

Click Map and then select Satellite to see what your map looks like in Satellite view.

Google Maps Engine Cookbook

Page 25

Recipe 2 | Map with polygon data: about info windows cont.

Info windows Clicking on a state shows the vector data associated with that state in an info window. By default, the Maps Engine style editor adds every attribute of the vector data into a layer’s info window code, but you can edit the code in the style editor, as long as the code adheres to the limits specified in HTML supported in info windows.

Google Maps Engine Cookbook

Page 26

Recipe 3 | Base map with raster image

This technique is useful for uploading images that are not georeferenced—for example, aerial photographs, architectural plans, and historical maps. Use an image that covers a relatively small geographical area.

About the example files This example uses a .png image of a golf course map.

Ingredient Raster image (use an image that covers a relatively small geographical area, such as this one.) Click to view and save sample image. Recipe ABCs A.

Upload the data

Upload the data Align the image to the base map

B.

Prepare a layer

Create the layer

C.

Add layer to map

Add the layer to a map

D.

Serve

View, publish, and share the map

Google Maps Engine Cookbook

Image courtesy of Sequoia Woods Golf Course, Arnold, CA.

Page 27

Recipe 3 | Base map with raster image: Upload the data cont.

Upload the data 1.

Click the Up arrow to select Files ....

2.

Click Browse, select the raster image, and click Open.

3.

Choose a name for your data and enter a short description.

4.

Enter the proper attribution for the map’s creator. If applicable, specify the date the imagery was acquired.

5.

Check Manually align this image.

6.

Click Upload. Processing the image takes some time. Check the status message at the top of the page to see when it’s finished.

Google Maps Engine Cookbook

About raster images Raster images commonly come in these formats: PNG (.png) JPEG (.jpg, .jpeg) JPEG 2000 (.jpeg2) TIFF (.tif, .tiff) MrSID (.sid)

Page 28

Recipe 3 | Base map with raster image: Align the image cont.

Align the image to the base map, part 1 1.

After the image is processed, it’s displayed with three red anchor points. Drag each point to a location on the image that will help you align it to the base map.

In the example, we moved the anchor points to the edges of the three “arms” of the golf course.

2.

Click the blue Next button in the upper right.

3.

In the search box, enter a location on the base map where you want to place the image. In this example, enter “Sequoia Woods Country Club, Arnold, Ca.”

4.

Click the blue Move to View button.

Google Maps Engine Cookbook

If you receive an error message that processing has failed: Click the View Errors line. It may say: Image is missing geo transform. ●

You may have forgotten to check the Manually align this image box.



Delete the image , check the box, and start the upload again.

Page 29

Recipe 3 | Base map with raster image: Align the image cont.

Align the image to the base map, part 2 Unfortunately, in this example, the golf course map is rotated almost 90 degrees from the correct position, and it’s quite small. Next, you need to move the three anchor points to align correctly with the base map. You can toggle between Map and Satellite view on the base map to help you align the image with known features on the base map. Move the transparency slider to view the underlying map as you align the image.

Google Maps Engine Cookbook

Page 30

Recipe 3 | Base map with raster image: Align the image cont.

Rotating and positioning the image

If you want to change the position of the anchor points or start over... Positioning the image manually is a trialand-error process. To reposition the anchor points on the image, go to the Image metadata section on the Data source page and click the open align tool link:

Google Maps Engine Cookbook

Page 31

Recipe 3 | Base map with raster image: Prepare a layer cont.

Create the layer 1.

Press the browser ⬅ to return to the Data Details page.

2.

In the left column, click Create styled layer.

3.

Enter a name for the layer (for example, Course Map).

4.

Click Create.

Google Maps Engine Cookbook

Page 32

Recipe 3 | Base map with raster image: Add layer to map cont.

Add the layer to a map 1.

Click Exit to return to the Data Details page.

2.

In the left column under Layers, click Add to map.

3.

Click Create new and enter Sequoia Woods Golf as the map name.

4.

Click Add to map, which publishes the layer.

Google Maps Engine Cookbook

Page 33

Recipe 3 | Base map with raster image: Serve cont.

View, publish, and share the map 1.

In the upper-right corner of the map preview window, click Publish map.

2.

In the drop-down menu click View published map.

Google Maps Engine Cookbook

Use the Layers dialog to turn layers on and off and to change the base map.

Page 34

Recipe 4 | Adding a legend

This recipe offers a simple technique for adding a legend as a KML layer.

Legend image

Ingredients ● ● ●

Maps Engine map, such as the map with polygon data created in Recipe 2. A .png or .jpg image that contains the legend image. A KML text file that references the legend image. Click to view and save sample files.

+ KML file (doc.kml)

Recipe ABCs A.

Prepare and upload the data

Create a KMZ archive that contains the legend image and a KML file that references the image. Upload as KML.

= KMZ archive (legend.kmz)

B.

Prepare a layer

Create the KML layer with the legend.

C.

Add layer to map

Add the layer to the map.

D.

Serve

View, publish, and share the map

Google Maps Engine Cookbook

Page 35

Recipe 4 | Adding a legend: Prepare the data cont.

Create the legend 1. 2.

Use a simple drawing application such as Google Slides or Powerpoint to create the legend. Save the image and note its filename (for example, statehoodLegend.png ).

For more about the KML file format, see the Google Developers website: http://developers.google.com/kml

Create the KML .doc file 1. 2. 3.

Create the KML file using the supplied template file. Modify the field to refer to your image file. Save the file as doc.kml. (For more about the KML template, see next page.)

Read about the element, which is used in this recipe’s KML file.

Zip the files together 1. 2.

Use the Zip utility (free on all common platforms) to compress the image and KML files into a .zip archive. Change the .zip suffix to .kmz. That’s it!

Google Maps Engine Cookbook

Page 36

Recipe 4 | Adding a legend: About KML cont. 1 statehoodLegend.png

Google Maps Engine Cookbook

KML is a file format used to display geographic data in an Earth browser, such as Google Earth, Google Maps, and Google Maps for mobile. KML is an international standard maintained by the Open Geospatial Consortium, Inc. (OGC). The sample KML file at the left adds a KML screen overlay to the upper-right corner of the screen. You can modify the X and Y values in the file to position the image at a different location on the screen. (0,0) is the lower-left and (1,1) is the upper-right corner of the screen.

Page 37

Recipe 4 | Adding a legend: Upload the data cont.

Upload the KMZ archive 1. 2. 3. 4.

Click the red up arrow and browse to the KMZ archive you created in the previous step. Select the radio button that says to upload the file as a KML file. Fill in the other fields, such as the Description and search Tags. Press Upload and wait for the data to process.

Google Maps Engine Cookbook

Page 38

Recipe 4 | Adding a legend: Prepare the layer cont.

Add the data to a new layer 1. 2. 3.

Click Add to layer and the Create new layer dialog appears. Fill in a name for the layer. The KML type is preselected for you. Click Create.

Process the layer 1. 2. 3. 4.

After the layer has been created, click View details. Click Process now. When the layer finishes processing click Publish layer. Share it with the appropriate groups and individuals.

Google Maps Engine Cookbook

Page 39

Recipe 4 | Adding a legend: Add layer to map cont.

Add the layer to a map 1.

Click Add to map.

2.

Select the Statehood map you created in Recipe 2 (or the map described by your legend).

3.

Click Add to map, which adds the KML layer to the existing map.

Google Maps Engine Cookbook

Page 40

Recipe 4 | Adding a legend: Serve cont.

View, publish, and share the map 1. 2. 3.

Click Publish new map (upper-right corner). Preview the map and share it with the appropriate groups and individuals. Select View published map from the drop-down menu and check that the legend and other data display properly.

The Google Maps Gallery Participant Program Policies include the following guidelines for legends: Maps may include one KML screen overlay that contains the map legend. The overlay should be on the righthand side of the map. We recommend that overlays do not exceed 300 x 500 px or 500 x 300 px. The screen overlay may contain an optional logo, but the logo may not exceed 150 x 150 px. The KML screen overlay may not be used for promotional or advertising purposes. The legend should not be added as part of the map description since the description cannot contain images.

Google Maps Engine Cookbook

Page 41

Glossary | A–L

anchor point In Maps Engine, the anchor points are red markers that you position on the image so that you can align it with known reference points on the base map. (recipe 3) attribute A piece of data that applies to a feature. An attribute has a name (for example, Population) and a type (for example, Number). (recipe 2) base map The built-in map that supplies the “canvas” for your data, layers, and maps. (recipe 2 and recipe 3) choropleth map A map that uses a color scale to reflect gradations in statistical data. If you’re interested in learning more about cartography and design, check out some samples on the web, then see if you can apply some of them to your data. (recipe 2) CSV    Stands for comma-separated values. This is a method of presenting vector data, where each column in the table is delimited by a comma.

feature A vector object (point, line, polygon) or a combination of vector objects (multipoint, multiline, multipolygon). (recipe 2) filter A logical statement that describes a subset of your data (for example, name=Smith or population>9000. The string values are typically attributes (column headings) in your data set. (recipe 1) georeference To include data in an image about its geographical location. (recipe 3) icon A very small image used as the placemark for a point. (recipe 1) layer In Maps Engine, a layer is a collection of data that is added to a map. (all recipes) legend An inset in a map that explains the colors and symbols used in the map. (recipe 4)

display rule Specifies style attributes such as color, line pattern, and label names. To apply a particular style to a subset of your data, create a filter. (recipe 1, recipe 2)

Google Maps Engine Cookbook

Page 42

Glossary | M–Z

raster image An image that is composed of a grid of pixels. Also called a bitmap. A raster image can be imported into Google Maps Engine, but it can’t be styled. (recipe 3) style The set of colors, line patterns, icons, and labels applied to your data or a subset of your data. Custom styles are specified in display rules. (recipe 1, recipe 2)

vector A point, line, or polygon (also collections: multi-points, multi-lines, and multi-polygons) (recipe 1, recipe 2) vector table The format Maps Engine uses to store vector data after it’s uploaded. It’s like a spreadsheet, with rows, columns, and headings. See article on vector tables (recipe 1, recipe 2)

shapefile A standard vector data file format, originally developed by Esri. File extension is .shp. Shapefiles are accompanied by additional files containing metadata about the information in the shapefile. Shapefiles must be accompanied by .shx files (describe the indexes in the shapefile) and .dbf files (describe attributes of the data). (recipe 2) sidecar files The set of files that accompany the shapefile. For shapefiles, .shx and .dbf files must be provided. Your data may also have additional optional sidecar files with related data. (recipe 2)

Google Maps Engine Cookbook

Page 43

Google Maps Engine Cookbook

Sep 3, 2014 - In Google Maps Engine, you always follow these three basic steps to make a map: A. Upload data ... Check the status message at the top of the page to see when it's finished. Recipe 1 | Map with point .... outlines for each polygon (state), filled in light blue. Recipe 2 | Map with polygon data: Upload the data.

4MB Sizes 0 Downloads 333 Views

Recommend Documents

pdf-20152\electronic-engine-tuning-writing-engine-maps-for-road ...
Try one of the apps below to open or edit this item. pdf-20152\electronic-engine-tuning-writing-engine-maps-for-road-and-race-cars-by-cathal-greaney.pdf.

Google Maps Engine Approach to IT Security
Google's base map and create custom maps and applications. It incorporates Google ... which is generated by a mobile app or hardware token, in addition to a ...

Google Maps Engine Approach to IT Security
A GME project is a unique account generated for a customer ... the same system used by products such as Google Apps and .... customer support tickets.

Online PDF Unreal Engine VR Cookbook
PDF online, PDF new Unreal Engine VR Cookbook: Developing Virtual Reality with UE4 (Game Design), Online PDF Unreal Engine VR Cookbook: Developing ...