Как загрузить большую карту с Google maps
Недавно я начал планировать свое путшествие по испании на машине. Очень удобно заниматься сим непотребством используя гугл мэпс. Но у гугл мэпс есть один существенный недостаток — проделаную работу(маршрут поездки) нельзя сохранить в хорошем разрешении картинкой. Порывшись в интернете, я нашел замечательный способ сохранять гугл мэпс карты с проложеными маршрутами или без. Данной технологией я и спешу поделится с хабрасообществом.
Итак, в начале будет подготовка.
Для сего действа нам нужны:
1.) Огненный лис
2.) Плагин для огненного лиса под названием screengrab. Его можно свободно найти по имени на странице эдонов.
3.) Обычный виндосовский блокнот(или любой другой текстовый редактор).
Утановив screengrab и открыв огненного лиса — приступим.
Шаг первый:
Открываем гугл мапс и составляем маршрут(опционально, можно просто открыть карту в нужном месте).
Шаг второй:
Приближаем карту до нужного разрешения(Мне, например, нужно было видеть второстепенные дороги). И устанавливаем карту примерно в центр нужного участка(Например, если вы хотите карту города, то нужно наскролить центр города).
Шаг третий:
Нажимаем на «Ссылка» (находится в правом верхнем углу карты). И копируем текст из поля «Вставьте код HTML для использования на сайте».

Шаг четвертый:
Сохраняем этот текст в файле карта.html
Шаг пятый, очень ответственный:
Меняем значения ширины и высоты карты в пикселях на нужные вам (например width=«2500» height=«5000»).
Тут главное — сильно не жадничать=)
Шаг шестой:
Открываем этот файл в том же огненом лисе и ждем пока скачается вся карта.
Шаг последний:
Когда вся карта загрузилась, тыркаем кнопку screengrab и выбираем save->complete Page/Frame, тем самым указывая ему, что нужно сохранить не видимую область, а весь загруженный фрэйм.

Как сохранить избранную область карты
Исследуйте мир с помощью Google Планета Земля, выбирайте лучшие виды и сохраняйте изображения.
Как сохранить карту в Google Планета Земля
На сохраненной карте появляются все границы, названия, значки и сведения, доступные в Google Планета Земля.
- Откройте приложение «Google Планета Земля». или дважды нажмите на нужный пункт в разделе «Метки» «Мои метки».
- Выберите ФайлСохранитьСохранить изображение в главном меню или нажмите кнопку «Сохранить изображение» на панели инструментов над картой.
- На панели слева дважды нажмите на папку, в которой нужно сохранить файл.
- Откроется новое окно. Введите название карты в поле «Имя файла».
- Нажмите кнопку Сохранить.
- Откройте приложение «Google Планета Земля». или дважды нажмите на нужный пункт в разделе «Метки» «Мои метки».
- Выберите ФайлСохранитьСохранить изображение в главном меню или нажмите кнопку «Сохранить изображение» на панели инструментов над картой.
- В поле «Сохранить как» введите название карты.
- При необходимости выберите папку, используя стрелки вверх и вниз рядом с полем «Где».
- Нажмите кнопку Сохранить.
Как сохранить карту в Google Планета Земля Pro
На сохраненной карте появляются все границы, названия, значки и сведения, доступные в Google Планета Земля Pro.
Вы также можете задать разрешение изображения, добавить обозначения и выбрать размер текста на карте.
Exporting Data
You can export images, map tiles, tables and video from Earth Engine. The exports can be sent to your Google Drive account, to Google Cloud Storage or to a new Earth Engine asset.
The following sections describe each type of export in detail.
Exporting images
You can export images from Earth Engine in GeoTIFF or TFRecord format . See Configuration Parameters for more output options.
Example Setup
Start by defining the image data that will be exported:
Code Editor (JavaScript)
Next define the projection parameters that will be used in the following exports. We use the crs parameter to specify the coordinate system, and the crsTransform parameter to precisely specify the pixel grid. The crsTransform parameter is a list of parameters from an affine transformation matrix in row-major order [xScale, xShearing, xTranslation, yShearing, yScale, yTranslation] . An image’s origin is defined by the xTranslation and yTranslation values, and the image’s pixel size is defined by the xScale and yScale values. See examples of affine matrices .
Code Editor (JavaScript)
As a shortcut, you can specify a scale parameter and Earth Engine will calculate a crsTransform parameter for you. However, simply setting the scale of an image does not specify the origin of the projection, and may result in an image that is shifted relative to another image with the same pixel size!
The reason for the potential shift is that the scale parameter is used to populate the xScale and yScale values of the crsTransform , but the xTranslation and yTranslation values are calculated so that if they are divided by the corresponding xScale and yScale values the remainder will be zero. These parameters specify a pixel grid where the projection’s origin is at the corner of a pixel. This convention differs from the translation parameters used by some data providers, which use grids that are offset from the projection’s origin. For example, Landsat images provided by USGS use translation parameters that are offset by a 1/2 pixel from the projection’s origin (15m offset for the 30m bands) while Sentinel-2 images provided by ESA use translation parameters that are aligned with the projection’s origin. If the crsTransform specified in an export do not match the crsTransform of the original image, the output pixels will be resampled (using nearest neighbor by default), which will make the resulting image be shifted relative to the original image.
To sum up, if you need to match the exported image’s pixels to a specific image, make sure to use the crs and crsTransform parameters for full control of the grid.
to Drive
To export an image to your Drive account, use Export.image.toDrive() . For example, to export portions of a Landsat image, define a region to export, then call Export.image.toDrive() :
Code Editor (JavaScript)
When this code is run, an export task will be created in the Code Editor Tasks tab. Click the Run button next to the task to start it. (Learn more about the Task Manager from the Code Editor section). The image will be created in your Drive account with the specified fileFormat .
to Cloud Storage
To export an image to a Google Cloud Storage bucket, use Export.image.toCloudStorage() . To export the Landsat image in the previous example to Cloud Storage instead of Drive, use:
Code Editor (JavaScript)
As with exports to Drive, start the export from the Tasks tab.
to Asset
To export an image to an asset in your Earth Engine assets folder, use Export.image.toAsset() . To manage your Earth Engine assets, or check how much of your storage quota is in use, use the Asset Manager. The following example illustrates exporting portions of a Landsat image using different pyramiding policies for the same band. The pyramiding policy indicates how Earth Engine computes lower-resolution versions of the asset. Learn more about how Earth Engine handles multiple resolutions in the scale doc.
Code Editor (JavaScript)
You can provide a default pyramiding policy for every band that isn’t explicitly specified by using the ‘.default’ key. You may also pass in just the ‘.default’ key. For example, to make all bands default to the ‘sample’ pyramiding policy, use <'.default': 'sample'>.
Configuration parameters
Observe that the dictionary of configuration parameters passed to Export.image includes scale (in meters) and the export region as an ee.Geometry . The exported image will cover the specified region with pixels at the specified scale. If not explicitly specified, the CRS of the output will be taken from the first band of the image to be exported.
You may also specify the dimensions , crs and/or crsTransform of the exported image. See the glossary for more information on crs and crsTransform . For example, to get a block of pixels precisely aligned to another data source, specify dimensions , crs and crsTransform . To get a block of pixels of predefined size (for example a 256×256 thumbnail image) that covers a region, specify dimensions and region .
You can specify image output format (if the destination is not toAsset() ) with the fileFormat parameter ( ‘GeoTIFF’ by default).
formatOptions parameter
Other configuration options are set with the formatOptions parameter, which should be a dictionary keyed by other format options, specific to each fileFormat as described below.
GeoTiff
to export a cloud optimized GeoTIFF, pass a JavaScript literal for formatOptions in which the cloudOptimized key is set to true. Continuing the previous example:
Code Editor (JavaScript)
Cloud optimized GeoTIFFs can be reloaded from Cloud Storage into an Image . See the Image overview docs for details.
TFRecord
maxPixels
The maxPixels parameter is intended to prevent very large exports from inadvertently being created. If the default value is too low for your intended output image, you can increase maxPixels . For example:
Large file exports
If the output image is large, it will be exported as multiple files. If you are exporting to GeoTIFF(s), the image is split into tiles. The filename of each tile will be in the form baseFilename-yMin-xMin where xMin and yMin are the coordinates of each tile within the overall bounding box of the exported image.
If you are exporting to TFRecord, the files will be appended by -00000 , -00001 . -0000N for N+1 files. Maintaining this order is important if you intend to perform inference on the files and upload the predictions back to Earth Engine as an image. See uploading images as TFRecord files for details.
Exporting images as they appear in the Code Editor
To export imagery as rendered on screen in Earth Engine, create visualization images as demonstrated in the Visualization images and the Compositing and Mosaicking sections. Since the Code Editor uses the ‘EPSG:3857’ CRS, specify a CRS of ‘EPSG:3857’ in the export to get an image in the same projection as that displayed in the Code Editor map. See the section on configuring image exports for details on specifying the resolution and coordinate system of the output.
Exporting tables and vector data
You can export a FeatureCollection as CSV, SHP (shapefile), GeoJSON, KML, KMZ or TFRecord using Export.table . The FeatureCollection may represent vectors or simply a table of data. In the latter case, the features in the collection will have null geometry.
Note some additional constraints when working with some file formats, including:
- KML: A FeatureCollection exported to a KML file will have all the geometries transformed to unprojected (WGS84) coordinates.
- SHP: A FeatureCollection exported to a Shapefile must contain features with the same geometry type and projection and must fit within the Shapefile size limits . Column names are truncated to 10 characters or fewer, and this must not create duplicate column names.
- TFRecord: See this page.
Note that the output format is specified as KML to handle geographic data (SHP would also be appropriate for exporting a table with geometry). To export just a table of data, without any geographic information, export features with null geometry in CSV format. The following demonstrates using Export.table.toDrive() to get the results of a potentially long running reduction:
to Asset
To export a FeatureCollection as an Earth Engine asset, use Export.table.toAsset() . For example, using the features defined previously:
Code Editor (JavaScript)
There are several limitations on the size and shape of Earth Engine table assets:
- Maximum of 100 million features
- Maximum of 1000 properties (columns)
- Maximum of 100,000 vertices for each row’s geometry
- Maximum of 100,000 characters per string value
Exporting video
To export ordered image collections as video, where frames are defined by images in the collection, use Export.video() . You can configure the way the ImageCollection is turned into video by setting frame rate, scale and dimensions. The video will be encoded as an MP4.
to Drive
Export video to your Drive account with Export.video.toDrive() . For example, the following export makes a video from 20 years of Landsat imagery:
Code Editor (JavaScript)
Note that the frame rate and dimensions can be set from a dictionary of parameters passed to the export. Adjust these parameters to customize the video. Also note that the input ImageCollection is required to have 3-band (RGB), 8-bit images. In this example, the 8-bit, 3-band format is explicitly set. Alternatively, map a function which calls image.visualize() over the collection. See the section on Visualization images for details. Video exports can take a significant amount of time to complete, so it’s not unusual to see the export task running for an extended period.
to Cloud Storage
To export a video to Cloud Storage, use Export.video.toCloudStorage() . For example, using the ImageCollection from the previous example:
Note that this creates a new directory in the specified Cloud Storage bucket, named according to the description parameter by default. You can change the name of the directory or specify subdirectories with the path parameter.
To allow public access (and Earth Engine app access) to your tiles, the exported files will be public by default (you are assumed to be the owner of the output bucket). If you are a writer on the specified output bucket (but not the owner), set writePublicTiles to false to use the output bucket’s default object ACL. ACLs and CORS can be set from the writePublicTiles and bucketCorsUris parameters, respectively, or from the export dialog:

The Export.map.toCloudStorage() dialog.
ACLs and CORS options details
- View/download access. If you want access at all (e.g. from the Code Editor or EE Apps), then you will need to make the tiles ‘Publicly accessible.’
- JS access. The bucket into which the map is exported must allow for readability by other web apps if you want the Code Editor or EE Apps to have access to the tiles. These cross-origin request settings (CORS) must be configured at the bucket level (learn more ). For convenience, the Earth Engine export dialog allows you to configure CORS for your bucket at the time of export.
You can share your dataset by sharing the link to the earth.html file, by sharing the Open in Google Earth link, or by sharing the downloaded KML file. The actual data tiles are served from Google Cloud Storage, and Google Earth will read them from there.
Scale and Zoom
| Zoom Level | Pixel Size (at equator) |
|---|---|
| 0 | 156 km |
| 1 | 78 km |
| 2 | 39 km |
| 3 | 20 km |
| 4 | 10 km |
| 5 | 4.9 km |
| 6 | 2.4 km |
| 7 | 1.2 km |
| 8 | 611 m |
| 9 | 305 m |
| 10 | 152 m |
| 11 | 76 m |
| 12 | 38 m |
| 13 | 19 m |
| 14 | 9.6 m |
| 15 | 4.8 m |
| 16 | 2.4 m |
| 17 | 1.2 m |
| 18 | 0.6 m |
| 19 | 0.3 m |
| 20 | 0.15 m |
Observe from the previous table that the maxZoom set in the example corresponds to 19 meters at the equator, smaller at higher latitudes. This is less than the nominal 30 arc-seconds per pixel resolution of the input image. As a result, the map displayed in the output index.html can be zoomed in until pixels in native resolution are visible in the map. To limit the map display to native pixel resolution, set maxZoom to a value that corresponds to the native resolution or less.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.