Share via


Uploading a Data Source Using the Command Line

IMPORTANT: MapPoint Web Service was retired on November 18, 2011. Please see https://msdn.microsoft.com/en-us/library/dd877180.aspx for a list of current Bing Maps APIs.

You can upload a location or polygon data source file to MapPoint Web Service by using the Data Upload Client sample (DataUploadCS.exe), a command-line tool that you can run on a one-time basis or as a scheduled task. To run the Data Upload Client tool, navigate to the directory containing DataUploadCS.exe, and then type DataUploadCS.exe, followed by the options and flags described in this topic. You can also create a batch file containing the command line and schedule a task to run it.

You can also upload data source files to MapPoint programmatically by using the Customer Data Service upload API (the best option for automating regular uploads). For more information about the Customer Data Service upload methods and to download DataUploadCS.exe, see the MapPoint Web Service SDK.

You can run a maximum of 50 data jobs in a 24-hour period, and you can have a maximum of 25 data sources on the MapPoint servers at a time. A data job consists of uploading or replacing a polygon or location data source, copying a polygon or location data source from one environment to the other, or creating a downloadable file from a location data source.

The following sections describe the syntax, options, and flags for DataUploadCS.exe. The options and flags are capitalized for readability. They are not case-sensitive.

Syntax

DataUploadCS.exe /UserName %1 /Password %2 /ChunkSize "#" /DataSource "yourdatasource" /EntityType "yourentitytype" /Environment "environment" /GeocodeLevel "level" /RejectAmbiguousGeocodes /IsPolygon "value" /WaitForJobCompletion /Verbose /FilePath "yourfilepath.txt"

Options

UserName Your user name for Bing Maps.

Password Your password for Bing Maps.

ChunkSize The size of data, in bytes, that you want to upload at one time. If you omit this option, the chunk size defaults to 1,000,000 bytes.

DataSource The name of the data source to which you are uploading your data. At minimum, this must be the name of the default source name that was included in the Bing Maps Account Information e-mail message that you received when you became a Bing Maps customer. The name of the default data source is in the form AccountName.AccountID, where both AccountName and AccountID are assigned to you by Bing Maps. Optionally, you can append an additional field to the name to further identify the data source. By doing so, you can maintain multiple data sources, perhaps with different types of data. For example, the Fourth Coffee Company has an account name of FourthCoffee and an account ID of 310. Their data sources might be named FourthCoffee.310.espresso, FourthCoffee.310.restaurants, and so on.

EntityType The entity type for the entities in the data source. The entity type is the category you want to associate with your data. The entities in a data source must be assigned an entity type and all entities within a data source must be of the same type. You can use any name as long as it is a valid XML name (it cannot contain spaces or reserved characters). For example, Stores, Distributors, or ArtGalleries are all valid entity types.

Environment The environment to which to upload the data. Valid values are service for the production environment and staging for the staging environment.

GeocodeLevel The maximum level of geocoding. Valid values are street, postalcode, city, subdivision, and countryregion. The geocoder works through the geocoding hierarchy in that order to get a match for the entity until it reaches the level that you specify with this option. If you omit this option, the level defaults to city.

FilePath The path to the custom data file.

Flags

RejectAmbiguousGeocodes Rejects any ambiguous geocodes during the upload process. Sometimes the geocoder returns multiple results for an address. By default, the geocoder uses the latitude and longitude coordinates of the first result in the list. Use this flag if you do not want coordinates added to the data source for entities that have more than one possible match. After uploading the data, you can use the Edit Entity ID page to choose the correct matches for these entities manually.

IsPolygon Indicates whether the file contains polygon data. Valid values are true and false. If you set the value to true, the MaximumGeocodingLevel option and the RejectAmbiguousGeocodes option are ignored if they are included. The default value of this flag is false.

WaitForJobCompletion Waits for your upload job to complete and reports the status.

Verbose Writes the status of the upload job to the console.

Example

The following example uploads a data source for the Fourth Coffee Company. The default values for ChunkSize and GeocodingLevel are used because those options are omitted. The first match from a list of ambiguous geocoded results is used because the RejectAmbiguousGeocodes flag is not set.

DataUploadCS.exe /UserName %1 /Password %2 /DataSource "FourthCoffee.310.espresso" /EntityType "driveup" /Environment "staging" /WaitForJobCompletion /Verbose /FilePath "C:/data/espresso.txt"

Note

Data that you upload for use with MapPoint is replaced if you subsequently upload another data source file with the same name to the same environment.

See Also

Concepts

Deleting a Data Source (MapPoint)
Job Status
Replacing a Data Source
Uploading a Data Source Using the CSS
What is Geocoding?