Geocode Data Flow API Reference

May 18, 2017 ยท View on GitHub

Namespace: BingMapsSDSToolkit.GeocodeDataflowAPI

This API provides the ability to batch forward or reverse geocode up to 200,000 entities in a single request.

MSDN API Documentation

The following classes and enumerators are used by the Geocode Data Flow API.

Address Class

Properties

NameTypeDescription
AddressLineStringA string specifying the street line of an address. The AddressLine property is the most precise, official line for an address relative to the postal agency that services the area specified by the Locality, PostalTown, or PostalCode properties.
AdminDistrictStringA string specifying the subdivision name within the country or region for an address. This element is also commonly treated as the first order administrative subdivision; but in some cases, it is the second, third, or fourth order subdivision within a country, a dependency, or a region.
AdminDistrict2StringA string specifying the higher level administrative subdivision used in some countries or regions.
CountryRegionStringA string specifying the country or region name of an address.
FormattedAddressStringA string that contains a full formatted address.
LandmarkStringA string specifying a landmark associated with an address.
LocalityStringA string specifying the populated place for the address. This commonly refers to a city, but may refer to a suburb or a neighborhood in certain countries.
NeighborhoodStringA string specifying the neighborhood for an address.
PostalCodeStringA string specifying the post code, postal code, or ZIP Code of an address.
PostalTownStringA string specifying the post town of an address.

BaseRequest Class

Properties

NameTypeDescription
ConfidenceFilterConfidenceFilterA string specifying the minimum confidence required for the result.
CultureStringA string specifying the culture.
IncludeNeighborhoodBooleanA boolean value that specifies whether to return neighborhood information in the address.
MaxResultsInt32An integer from 1 to 20 specifying the maximum number of results to return.

BatchFileFormat Enumerator

The data format of a batch geocode file.

NameDescription
CSVComma seperated (comma delimited) file format.
PIPEPipe (|) delimited file format.
TABTab delimited file format.
XMLXML file that matches the schema required for batch geocoding files in the Bing Spatial Data Services.

BatchGeocodeManager Class

A tool for doing batch geocoding and reverse geocoding using the Bing Spatial Data Services.

Constructor

BatchGeocodeManager()

BatchGeocodeManager(int statusUpdateInterval)

  • statusUpdateInterval - Interval used to check the status of the batch job in ms.

Methods

NameReturn TypeDescription
Geocode(GeocodeFeed dataFeed, String bingMapsKey)Task<BatchGeocoderResults>Method to geocode a set of data.

Events

NameTypeDescription
StatusChanged(string x) => {}An event that provides update messages during the batch geocode process.

BatchGeocoderResults Class

An object used to store the results of a batch geocoding job.

Properties

NameTypeDescription
ErrorStringError message if unable to process batch geocode job.
FailedGeocodeFeedAll the locations the data that failed to be geocoded.
SucceededGeocodeFeedAll the locations the data that was geocoded successfully.

BoundingBox Class

A set of geographical coordinates in degrees that define an area on the Earth that contains the location.

Properties

NameTypeDescription
EastLongitudeDoubleThe eastern most longitude.
NorthLatitudeDoubleThe northern most latitude.
SouthLatitudeDoubleThe southern most latitude.
WestLongitudeDoubleThe western most longitude.

CalculationMethodTypes Enumerator

The types of calculations methods used for location coodinates.

NameDescription
InterpolationThe geocode point was matched to a point on a road using interpolation.
InterpolationOffsetThe geocode point was matched to a point on a road using interpolation with an additional offset to shift the point to the side of the street.
ParcelCentroidThe geocode point was matched to the center of a parcel.
RooftopThe geocode point was matched to the rooftop of a building.

ConfidenceFilter Class

A string specifying the minimum confidence required for the result.

Properties

NameTypeDescription
MinimumConfidenceStringA string specifying the minimum confidence required for the result.

ConfidenceTypes Class

The confidence types of a geocode result.

Constants

NameTypeDescription
HighStringHigh confidence.
LowStringLow confidence.
MediumStringMedium confidence.

Methods

NameReturn TypeDescription
IsValid(String confidence)BooleanChecks a string confidence filter to see if it is a valid value.

GeocodeEntityType Class

The different entity types a geocode result can have.

Constants

NameTypeDescription
AddressStringA physical address of a location.
AdminDivision1StringA first-order, initial political subdivision of a Sovereign, such as a state, a province, a department, a region, or a prefecture.
AdminDivision2StringA second-order political subdivision of a CountryRegion, a division of an AdminDivision1 or a Dependent.
AdminDivision3StringA third-order political subdivision of a CountryRegion, a division of an AdminDivision2.
AdministrativeBuildingStringA building that contains governmental offices or facilities.
AdministrativeDivisionStringAn administrative division of a CountryRegion, undifferentiated as to administrative level.
AgriculturalStructureStringA Structure used for agricultural purposes.
AirportStringA place where aircraft regularly land and take off, with runways, navigational aids, and facilities for handling passengers and/or cargo.
AirportRunwayStringAn improved surface suitable for landing airplanes.
AmusementParkStringA facility that contains rides and other attractions, such as a theme park.
AncientSiteStringA place where archeological remains, old structures, or cultural artifacts are located.
AquariumStringA place where marine life is displayed to the public.
ArchipelagoStringA logical grouping of Islands.
AutorailStringA Railway that carries automobiles.
BasinStringA low-lying area mostly or wholly surrounded by higher ground.
BattlefieldStringA site of a land battle of historical importance.
BayStringAn area of water partially enclosed by an indentation of shoreline.
BeachStringA Coast with a surface of sand, pebbles, or small rocks.
BorderPostStringA post or station at an international boundary for regulating the movement of people and goods.
BridgeStringA structure erected across an obstacle, such as a stream or road, that is used by vehicles and pedestrians.
BusinessCategoryStringA category that identifies a kind of business.
BusinessCenterStringA place where a number of businesses are located.
BusinessNameStringA name that identifies a business.
BusinessStructureStringA Structure used for commercial purposes.
BusStationStringA place where buses pick up and discharge passengers.
CampStringA site occupied by tents, huts, or other shelters for temporary use.
CanalStringAn artificially constructed watercourse.
CaveStringAn underground passageway or chamber, or a cavity on the side of a cliff.
CelestialFeatureStringA spherical body in space.
CemeteryStringA burial place or a burial ground.
Census1StringOne of the set of the most detailed, lowest-level CensusDistricts.
Census2StringOne of the set of second-order CensusDistricts composed by aggregating Census1s.
CensusDistrictStringA district defined by a national census bureau and used for statistical data collection.
ChannelStringA body of water between two landmasses.
ChurchStringA building for public Christian worship.
CityHallStringA building that contains the administrative offices of a municipal government.
CliffStringA high, steep-to-perpendicular slope that overlooks a lower area or a water body.
ClimateRegionStringAn area of homogenous climactic conditions, as defined by modified Koeppen classes.
CoastStringAn area of land adjacent to a WaterFeature.
CommunityCenterStringA facility for community recreation and meetings.
ContinentStringA very large landmass, surrounded by water and larger than an Island, that forms one of the primary divisions of land on a CelestialFeature.
ConventionCenterStringA large meeting hall for conventions and other meetings, and shows.
CountryRegionStringA primary PoliticalUnit.
CourthouseStringA building in which courts of law are held.
CraterStringA generally circular, saucer-shaped, or bowl-shaped depression caused by volcanic or meteorite explosive action.
CulturalRegionStringAn area of land with strong local identity, but no political status.
CurrentStringA large area of ocean where surface water flows in a certain constant general direction.
DamStringA barrier constructed across a stream to impound water.
DeltaStringAn area where a River divides into many separate water channels as it enters a Sea or a Lake.
DependentStringA PoliticalUnit that is politically controlled by a Sovereign, but separate geographically, and to some degree politically, such as a territory, a colony, or a dependency.
DesertStringA large area with low rainfall and little or no vegetation.
DisputedAreaStringAn area in political dispute that is not considered part of any CountryRegion.
DrainageBasinStringA land region where all surface water drains into one specific WaterFeature.
DuneStringA wave form, a ridge, or a star-shaped feature composed of sand.
EarthquakeEpicenterStringA place where the destructive force of a specific earthquake is centered.
EcoregionStringA region with a homogeneous ecosystem, flora, and/or fauna.
EducationalStructureStringA place for providing instruction.
ElevationZoneStringAn area where the surface elevation of all land is within a defined range.
FactoryStringA building or set of buildings where goods are manufactured, processed, or fabricated.
FerryRouteStringA route used by a boat, or by other floating conveyances regularly used to transport people and vehicles across a WaterFeature.
FerryTerminalStringA structure and associated facilities where a ferry boat docks and takes on passengers, automobiles, and/or cargo.
FishHatcheryStringA place for hatching fish eggs or raising fish.
ForestStringA large area of trees.
FormerAdministrativeDivisionStringAn AdministrativeDivision that no longer exists.
FormerPoliticalUnitStringA PoliticalUnit that no longer exists.
FormerSovereignStringA Sovereign that no longer exists.
FortStringA defensive structure or earthwork.
GardenStringAn enclosure for displaying selected plant life.
GeodeticFeatureStringAn invisible point, line, or area on the surface of a CelestialFeature that is used for geographic reference.
GeoEntityStringA single thing that has spatial extent and location.
GeographicPoleStringOne of the two points of intersection of the surface of a CelestialFeature and its axis of rotation.
GeyserStringA HotSpring that intermittently shoots water into the air.
GlacierStringA mass of ice, usually at high latitudes or high elevations, with sufficient thickness to flow away from the source area.
GolfCourseStringA recreational field where golf is played.
GovernmentStructureStringA Structure typically owned and operated by a governmental entity.
HeliportStringA place where helicopters land and take off.
HemisphereStringA half of the surface of a Celestial Feature, usually specified as northern, southern, eastern, or western.
HigherEducationFacilityStringA place where students receive advanced or specialized education, such as a college or a university.
HistoricalSiteStringA place of historical importance.
HospitalStringA building in which the sick or injured, especially those confined to bed, are medically treated.
HotSpringStringA place where hot water emerges from the ground.
IceStringA large area covered with frozen water.
IndigenousPeoplesReserveStringAn area of land set aside for aboriginal, tribal, or native populations.
IndustrialStructureStringA Structure used for industrial or extractive purposes.
InformationCenterStringA place where tourists and citizens can obtain information.
InternationalDatelineStringThe line running between geographic poles designated as the point where a calendar day begins.
InternationalOrganizationStringAn area of land composed of the member PoliticalUnits of an official governmental organization composed of two or more Sovereigns.
IslandStringAn area of land completely surrounded by water and smaller than a Continent.
IsthmusStringA narrow strip of land connecting two larger landmasses and bordered by water on two sides.
JunctionStringA place where two or more roads join.
LakeStringAn inland water body, usually fresh water.
LandAreaStringA relatively small area of land exhibiting a common characteristic that distinguishes it from the surrounding land.
LandformStringA natural geographic feature on dry land.
LandmarkBuildingStringA Structure that is a well-known point of reference.
LatitudeLineStringAn imaginary line of constant latitude that circles a CelestialFeature, in which every point on the line is equidistant from a geographic pole.
LibraryStringA place where books and other media are stored and loaned out to the public or others.
LighthouseStringA tall structure with a major navigation light.
LinguisticRegionStringAn area of land where most of the population speaks the same language or speaks languages in the same linguistic family.
LongitudeLineStringAn imaginary line of constant longitude on a CelestialFeature that runs from one geographic pole to the other.
MagneticPoleStringA point on the surface of a CelestialFeature that is the origin for lines of magnetic force.
MarinaStringA harbor facility for small boats.
MarketStringA place where goods are bought and sold.
MedicalStructureStringA Structure in which the sick or injured are medically treated.
MetroStationStringA place where urban rapid transit trains pick up and drop off passengers, often underground or elevated.
MilitaryBaseStringA place used by an armed service for storing arms and supplies, for accommodating and training troops, and as a base from which operations can be initiated.
MineStringA place where mineral ores are extracted from the ground by excavating surface pits and subterranean passages.
MissionStringA place characterized by dwellings, school, church, hospital, and other facilities operated by a religious group for the purpose of providing charitable services and to propagate religion.
MonumentStringA commemorative structure or statue.
MosqueStringA building for public Islamic worship.
MountainStringAn elevated landform that rises, often steeply, above surrounding land on most sides.
MountainRangeStringA group of connected Mountains.
MuseumStringA building where objects of permanent interest in one or more of the arts and sciences are preserved and exhibited.
NauticalStructureStringA Structure used for nautical purposes.
NavigationalStructureStringA Structure used for navigational purposes.
NeighborhoodStringA section of a PopulatedPlace, usually homogenous and/or well-known, but often with indistinct boundaries.
OasisStringAn area in a Desert that contains water and plant life.
ObservationPointStringA wildlife or scenic observation point.
OceanStringA vast expanse of salt water, one of the major Seas covering part of the earth.
OfficeBuildingStringA building that contains offices.
ParkStringAn area maintained as a place of scenic beauty, or for recreation.
ParkAndRideStringA parking lot reserved for mass transit commuters.
PassStringA break in a MountainRange used for transportation from one side of the mountain range to the other.
PeninsulaStringAn elongated area of land projecting into a body of water and surrounded by water on three sides.
PlainStringAn extensive area of comparatively level to gently undulating land, lacking surface irregularities.
PlanetStringA CelestialFeature that orbits a star.
PlateStringA section of a planetary crust that is in motion relative to other tectonic plates.
PlateauStringAn elevated plain with steep slopes on one or more sides.
PlayingFieldStringA tract of land used for playing team sports and/or other athletic events.
PoleStringA point on the surface of a CelestialFeature that marks an important geographical or astronomical location.
PoliceStationStringA building in which police are stationed or posted.
PoliticalUnitStringAn area of land with well-defined borders that is subject to a specific political administration.
PopulatedPlaceStringA concentrated area of human settlement, such as a city, a town, or a village.
PostcodeStringA district used by a postal service as an aid in postal distribution and having a unique identifying code.
Postcode1StringOne of the set of lowest-level and most detailed set of PostCodes in a Sovereign.
Postcode2StringOne of the set of second-order (one level up from the lowest level) Postcodes in a Sovereign, composed by aggregating Postcode1s.
Postcode3StringOne of the set of third-order Postcodes in a Sovereign, composed by aggregating Postcode2s.
Postcode4StringOne of the set of fourth-order Postcodes in a Sovereign, composed by aggregating Postcode3s.
PostOfficeStringA public building in which mail is received, sorted, and distributed.
PowerStationStringA facility for generating electric power.
PrisonStringA facility for confining persons convicted or accused of crimes.
PromontoryStringA small, usually pointed Peninsula that often marks the terminus of a landmass.
RaceTrackStringA track where races are held.
RailwayStringA permanent twin steel-rail track on which trains move.
RailwayStationStringA place comprised of ticket offices, platforms, and other facilities for loading and unloading train passengers and freight.
RecreationalStructureStringA Structure used for watching or participating in sports or other athletic activities.
ReefStringA partly submerged feature, usually of coral, that projects upward near the water"s surface and can be a navigational hazard.
RegionStringA large area of land where a specific characteristic of the land or its people is relatively homogenous.
ReligiousRegionStringAn area of land where the population holds relatively homogenous religious practices.
ReligiousStructureStringA structure where organized, public religious services are held.
ResearchStructureStringA Structure used for scientific purposes.
ReserveStringA tract of public land set aside for restricted use or reserved for future use.
ResidentialStructureStringA house, a hut, an apartment building, or another structure where people reside.
RestAreaStringA designated area, usually along a major highway, where motorists can stop to relax.
RiverStringA stream of running water.
RoadStringAn open way with an improved surface for efficient transportation of vehicles.
RoadBlockStringA road.
RoadIntersectionStringA junction where two or more roads meet or cross at the same grade.
RuinStringA destroyed or decayed structure that is no longer functional.
SatelliteStringA CelestialFeature that orbits a Planet.
SchoolStringA place where people, usually children, receive a basic education.
ScientificResearchBaseStringA scientific facility used as a base from which research is carried out or monitored.
SeaStringA large area of salt water.
SeaplaneLandingAreaStringA place on a water body where floatplanes land and take off.
ShipWreckStringA site of the remains of a wrecked vessel.
ShoppingCenterStringA collection of linked retail establishments.
ShrineStringA structure or place that memorializes a person or religious concept.
SiteStringA place most notable because of an event that occurred in that location.
SkiAreaStringA place developed for recreational Alpine or Nordic skiing.
SovereignStringAn independent nation-state, the highest level of political authority in that location.
SpotElevationStringA point on a CelestialFeature"s surface with a known elevation.
SpringStringA place where water emerges from the ground.
StadiumStringA structure with an enclosure for athletic games with tiers of seats for spectators.
StatisticalDistrictStringAn area of land defined as a district to be used for statistical collection or service provision.
StructureStringA building, a facility, or a group of buildings and/or facilities used for a certain common purpose.
TectonicBoundaryStringA line that forms the border between two Plates.
TectonicFeatureStringA Landform related to Plates and their movement.
TempleStringAn edifice dedicated to religious worship.
TimeZoneStringA large area within which the same time standard is used.
TouristStructureStringA Structure typically used by tourists.
TrailStringA path, a track, or a route used by pedestrians, animals, or off-road vehicles.
TransportationStructureStringA Structure used for transportation purposes.
TunnelStringA subterranean passageway for transportation.
UnderwaterFeatureStringA feature on the floor of a WaterFeature.
UrbanRegionStringAn area of land with high population density and extensive urban development.
ValleyStringA low area surrounded by higher ground on two or more sides.
VolcanoStringA Mountain formed by volcanic action and composed of volcanic rock.
WallStringAn upright structure that encloses, divides, or protects an area.
WaterfallStringA vertical or very steep section of a River.
WaterFeatureStringA geographic feature that has water on its surface.
WellStringA cylindrical hole, pit, or tunnel drilled or dug down to a depth from which water, oil, or gas can be pumped or brought to the surface.
WetlandStringAn area of high soil moisture, partially or intermittently covered with shallow water.
ZooStringA zoological garden or park where wild animals are kept for exhibition.

GeocodeEntity Class

An eneity in the the geocode feed to be geocoded or reverse geocoded.

Constructor

GeocodeEntity()

GeocodeEntity(String query)

Properties

NameTypeDescription
FaultReasonStringInformation about an error that occurred during the geocode dataflow job. This value is provided only for data that was not processed successfully. Do not set this property.
GeocodeRequestGeocodeRequestThe geocode request being made.
GeocodeResponseGeocodeResponse[]The results of the geocoding/reverse geocoding process. Do not set this property.
IdStringA string that contains a unique ID to assign to the entity.
ReverseGeocodeRequestReverseGeocodeRequestThe reverse geocode request being made.
StatusCodeStringA string that provides information about the success of the operation. Do not set this property.
TraceIdStringAn id used to trace the request through the Bing servers. Do not set this property.

GeocodeFeed Class

An object that contains the data that is to be geocoded, or has been geocoded.

Constructor

GeocodeFeed()

Properties

NameTypeDescription
EntitiesList<GeocodeEntity>A list of all entities in the geocode feed.
VersionStringThe Geocode Dataflow API version to use. This always returns version 2.

Methods

NameReturn TypeDescription
GetEntityById(String id)GeocodeEntitySearches for the first entity that has the specified id value.
ReadAsync(Stream stream)Task<GeocodeFeed>Deserializes a GeocodeFeed from an XML stream.
ReadAsync(Stream stream, BatchFileFormat fileFormat)Task<GeocodeFeed>Deserializes a GeocodeFeed from a file stream.
WriteAsync(Stream outputStream)TaskSerializes a GeocodeFeed into an XML stream.

GeocodePoint Class

Inherits from the GeodataLocation class

An object that stores the coordinate information.

Properties

NameTypeDescription
CalculationMethodStringThe method used to calculate the coordinate.
TypeStringThe Entity Type of the location result.
UsageTypesStringThe recommended usage based on the calculation type.

GeocodeRequest Class

Inherits from the BaseRequest class

Request information for geocoding a location.

Constructor

GeocodeRequest()

GeocodeRequest(String query)

Properties

NameTypeDescription
AddressAddressThe address to geocode.
IncludeQueryParseBooleanA boolean value that specifies whether to return parsing information.
IncludeQueryParseSpecifiedBooleanA boolean indicating if the information on how the query propery was parsed should be returned.
QueryStringA query string that contains address information to geocode. Can be used instead of an address.

GeocodeResponse Class

Response information for geocoding a location.

Properties

NameTypeDescription
AddressAddressThe geocoded address result.
BoundingBoxBoundingBoxA bounding box for viewing the location.
ConfidenceStringThe confidence of the geococded results.
EntityTypeStringThe geocode entity type of the geocoded location.
GeocodePointGeocodePoint[]An array of coordinates for the resulting locaiton.
MatchCodesStringA comma seperated string of match codes. Use the MatchCodeTypes.ParseMatchCodes method to parse into an array of strings.
NameStringThe name of the geocoded location.
PointGeodataLocationA coordinate for the geocoded location.
QueryParseValueQueryParseValue[]An array of the parsed query properties.

MatchCodeTypes Class

Match codes used to indicate the level of match a geocode result has to the original address.

Constants

NameTypeDescription
AmbiguousStringThe location is one of a set of possible matches. For example, when you query for the street address 128 Main St., the response may return two locations for 128 North Main St. and 128 South Main St. because there is not enough information to determine which option to choose.
GoodStringThe location has only one match or all returned matches are considered strong matches. For example, a query for New York returns several Good matches.
UpHierarchyStringThe location represents a move up the geographic hierarchy. This occurs when a match for the location request was not found, so a less precise result is returned. For example, if a match for the requested address cannot be found, then a match code of UpHierarchy with a RoadBlock entity type may be returned.

Methods

NameReturn TypeDescription
ParseMatchCodes(String matchCodes)string[]Takes in a comma seperated string of match codes and parses them into an array of string.

QueryParsePropertyTypes Class

The different property names of a QueryParse object.

Constants

NameTypeDescription
AddressLineStringA string specifying the street line of an address. The AddressLine property is the most precise, official line for an address relative to the postal agency that services the area specified by the Locality, PostalTown, or PostalCode properties.
AdminDistrictStringA string specifying the subdivision name within the country or region for an address. This element is also commonly treated as the first order administrative subdivision; but in some cases, it is the second, third, or fourth order subdivision within a country, a dependency, or a region.
AdminDistrict2StringA string specifying the higher level administrative subdivision used in some countries or regions.
CountryRegionStringA string specifying the country or region name of an address.
LandmarkStringA string specifying a landmark associated with an address.
LocalityStringA string specifying the populated place for the address. This commonly refers to a city, but may refer to a suburb or a neighborhood in certain countries.
PostalCodeStringA string specifying the post code, postal code, or ZIP Code of an address.

QueryParseValue Class

A parsed query value.

Properties

NameTypeDescription
PropertyStringThe property name of the parsed query. See QueryParsePropertyTypes for possible values.
ValueStringThe value of parsed property.

ReverseGeocodeRequest Class

Request information for reverse geocoding a location cooridinate.

Properties

NameTypeDescription
IncludeEntityTypesStringA list of Geocode Entity Types to return. This parameter only returns a geocoded address if the entity type for that address is one of the entity types you specified.
LocationGeodataLocationThe location coordinate to reverse geocode.