[null,null,["最后更新时间 (UTC):2025-08-31。"],[[["\u003cp\u003eThis document outlines prerequisites, best practices, and common errors for working with datasets in Google Cloud's Maps Datasets API.\u003c/p\u003e\n"],["\u003cp\u003eDatasets support CSV, GeoJSON, and KML file formats with a maximum file size of 500 MB, and require unique display names within a Google Cloud project.\u003c/p\u003e\n"],["\u003cp\u003eFor optimal performance, it's recommended to simplify geometries, minimize feature properties, and use simple data types when preparing data for upload.\u003c/p\u003e\n"],["\u003cp\u003eCommon errors during data uploads can arise from issues with GeoJSON types, unsupported KML features, or missing or incorrect values in CSV files.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the documentation for detailed guidance on GeoJSON, KML, and CSV requirements, as well as best practices for visualizing data using datasets and BigQuery.\u003c/p\u003e\n"]]],[],null,["# Before you begin\n\nThis document describes the prerequisites, best practices, and common errors\nwhen working with datasets.\n\nPrerequisites\n-------------\n\nWhen creating a dataset:\n\n- Display names must be unique within your Google Cloud project.\n- Display names must be less than 64 bytes (Because these characters are represented in UTF-8, in some languages each character can be represented by multiple bytes).\n- Descriptions must be less than 1000 bytes.\n\nWhen uploading data:\n\n- The supported file types are CSV, GeoJSON, and KML.\n- The maximum supported file size is 500 MB.\n- Attribute column names cannot begin with the string \"?_\".\n- Three-dimensional geometries are not supported. This includes the \"Z\" suffix in the WKT format, and the altitude coordinate in the GeoJSON format.\n\n| **Note:**Depending on the size of the data file, the upload can take minutes or even hours to complete. If there is an error with the upload, you will get an error message. Don't attempt to delete the dataset until it has returned a response from the upload operation.\n| **Note:**Map tiles created with data uploaded using the Maps Datasets API may drop or simplify dense or complex data at low zoom levels. For example, when a user zooms out to a state or country (for example, zoom level 5-12), the tiled data may look different than when zoomed into a city or neighborhood (for example, zoom level 13-18). This happens in order to keep tiles slim and performant using the tiles with a map renderer.\n| **Tip:**If your data file is large and has many attributes in it that you don't need for styling, and you would like to optimize rendering performance, edit the file to remove the unneeded attributes. Reducing the number of attributes reduces the size of the map's tiles, thereby improving rendering performance.\n\n### Data preparation best practices\n\nIf your source data is complex or large, such as dense points, long linestrings or polygons\n(often source file sizes larger than 50 MB fall into this category), consider simplifying your data\nbefore uploading to achieve the best performance in a visual map.\n\nHere are some best practices for preparing your data:\n\n1. **Minimize feature properties** . Only keep feature properties needed to style your map, for example \"id\" and \"category\". You can join additional properties to a feature in a client application using data-driven styles on a unique identifier key. For example, see [See your data in real time with Data-driven styling](/maps/architecture/dds-real-time).\n2. **Use simple data types** for property objects where possible, such as integers, to minimize tile size and improve map performance.\n3. **Simplify complex geometries** prior to uploading a file. You can do this in a geospatial tool of your choice, such as the open source [Mapshaper.org](https://mapshaper.org/) utility, or in BigQuery using [ST_Simplify](https://cloud.google.com/bigquery/docs/reference/standard-sql/geography_functions#st_simplify) on complex polygon geometries.\n4. **Cluster very dense points** prior to uploading a file. You can do this in a geospatial tool of your choice, such as the open source [turf.js cluster functions](https://turfjs.org/docs/#clustersDbscan), or in BigQuery using [ST_CLUSTERDBSCAN](https://cloud.google.com/bigquery/docs/reference/standard-sql/geography_functions#st_clusterdbscan) on dense point geometries.\n\nSee additional guidance about datasets best practices in\n[Visualize your data with Datasets and BigQuery](/maps/architecture/bigquery-datasets-visualization#design_considerations).\n\n### GeoJSON requirements\n\nMaps Datasets API supports the current\n[GeoJSON specification](https://datatracker.ietf.org/doc/html/rfc7946).\nMaps Datasets API also support GeoJSON files that contain any of the following object types:\n\n- **Geometry objects**. A geometry object is a spatial shape, described as a union of points, lines, and polygons with optional holes.\n- **Feature objects**. A feature object contains a geometry plus additional name/value pairs, whose meaning is application-specific.\n- **Feature collections**. A feature collection is a set of feature objects.\n\nMaps Datasets API does not support GeoJSON files that have data in a coordinate reference system\n(CRS) other than [WGS84](https://epsg.io/4326).\n\nFor more information on GeoJSON, see\n[RFC 7946 compliant](https://www.rfc-editor.org/rfc/rfc7946).\n\n### KML requirements\n\nMaps Datasets API has the following requirements:\n\n- All URLs must be local (or relative) to the file itself.\n- Point, line, and polygon geometries supported.\n- All data attributes are considered strings.\n\nThe following KML features are not supported:\n\n\u003c!-- --\u003e\n\n- Icons or `\u003cstyleUrl\u003e` defined outside of the file.\n- Network links, such as `\u003cNetworkLink\u003e`\n- Ground overlays, such as `\u003cGroundOverlay\u003e`\n- 3D geometries or any altitude-related tags such as `\u003caltitudeMode\u003e`\n- Camera specifications such as `\u003cLookAt\u003e`\n- Styles defined inside the KML file.\n\n### CSV requirements\n\nFor CSV files, the supported column names are listed below in order of priority:\n\n- `latitude`, `longitude`\n- `lat`, `long`\n- `x`, `y`\n- `wkt` [(Well-Known Text)](https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry)\n- `address`, `city`, `state`, `zip`\n- `address`\n- A single column containing all address information, such as `1600 Amphitheatre Parkway Mountain View, CA 94043`\n\nFor example, your file contains columns named `x`, `y`, and `wkt`.\nBecause `x` and `y` have a higher priority, as determined by the order of\nsupported column names in the list above, the values in the `x` and `y` columns\nare used and the `wkt` column is ignored.\n\nIn addition:\n\n- Each column name must belong to a single column. That is, you cannot have a column named `xy` that contains both x and y coordinate data. The x and y coordinates must be in separate columns.\n- Column names are case-insensitive.\n- The order of the column names does not matter. For example, if your CSV file contains `lat` and `long` columns, they can occur in any order.\n\nHandle data upload errors\n-------------------------\n\nWhen uploading data to a dataset, you might experience one of the common errors described in this\nsection.\n\n### GeoJSON errors\n\nCommon GeoJSON errors include:\n\n- Missing `type` field, or the `type` is not a string. The uploaded GeoJSON data file must contain a string field named `type` as part of each Feature object and Geometry object definition.\n\n### KML errors\n\nCommon KML errors include:\n\n- The data file must not contain any of the unsupported KML features listed above, otherwise the data import might fail.\n\n### CSV errors\n\nCommon CSV errors include:\n\n- Some rows are missing values for a geometry column. All rows in a CSV file must contain non-empty values for the geometry columns. The geometry columns include:\n - `latitude`, `longitude`\n - `lat`, `long`\n - `x`, `y`\n - `wkt`\n - `address`, `city`, `state`, `zip`\n - `address`\n - A single column containing all address information, such as `1600 Amphitheatre Parkway Mountain View, CA 94043`\n\n | **Note:**This error is often described by a message in the form \"Unable to convert ' ' to a double\" or \"Could not parse input to geography.: Geography value is missing\".\n- If `x` and `y` are your geometry columns, ensure that the units are longitude and latitude. Some public datasets use different coordinate systems under the headers `x` and `y`. If the wrong units are used, the dataset might import successfully, but the rendered data can show the dataset points in unexpected locations."]]