GetStreetLocation()

Summary

Gets a description of the street location of a coordinate.

Syntax

desc = GetStreetLocation(string street_field_spec, coord c, double threshold)

Argument Contents
street_field_spec The field spec for the string column containing the names of the streets
c The search coordinate
threshold The threshold, in current map units, which determines whether the coordinate is at an intersection

Returns

The description as a string. The string returned can be one of the following formats:

  • StreetName1

  • StreetName1 near StreetName2

  • StreetName1 & StreetName2

  • StreetName1 between StreetName2 & StreetName3

Notes

  • street_field_spec must be a field spec with the format LayerName.FieldName.

  • The street layer must be a standard (.dbd) or compact (.cdf) line geographic file.

  • The street layer and the corresponding intersection node layer must be in the current map.

  • The distance threshold determines whether the output string includes the phrase "Street1 & Street2" or "Street1 near Street2".

Example

// Before running the example, create a map by opening manhastr.cdf
// in the Tutorial folder.
SetLayer("Streets")
c=Coord(-73845917, 40807680)
// Assumes current map units are miles
loc=GetStreetLocation("Streets.NAME", c, 0.002)
ShowMessage(loc)

Error Codes

Error Type Meaning
Error An invalid parameter was specified or the street layer was not found