Skip to main content

Validate City Names and Street Addresses

Contents

PC*Miler Connect includes several functions you can use to look up city/state pairs, postal and ZIP codes, and addresses. (Street-level data must be licensed and installed for addresses.) You may also want to spell check and validate city names before committing the engine to run the route.

  • PCMSLookup creates a list of matching cities and returns how many match your input.
  • PCMSGetMatch passes the index of the match wanted and a buffer to store the name.
  • PCMSGetFmtMatch formats the length of the place name before returning it.
  • PCMSGetFmtMatch2 formats the length of the place name before returning it, and also returns the address, city, state, ZIP code, and county.
  • PCMSGetFmtMatch3 returns the information in PCMSGetFmtMatch2 as well as the time zone in GMT offset format and whether it is in Daylight Savings Time.
  • PCMSGetFmtMatch4 returns the information in PCMSGetFmtMatch2 as well as the decimal latitude and longitude.

TIP: To validate place names with addresses, addresses must be separated from place names by a semi-colon in your input file; for example: 08540 Princeton, NJ;457 North Harrison St.

To look up a city and print the list of all matching cities, use code like this:

char buffer[255];

/* Lookup all cities that match */
matches = PCMSLookup(trip, "PRI*, NJ", 0);
printf ("%d matching cities to 'PRI*, NJ'\n", matches);

/* Show all the matching cities. Note: You could use variable ‘matches’ below instead, since PCMSNumMatches() == matches.*/

for (i = 0; i < PCMSNumMatches(trip); i++)
{
  PCMSGetMatch(trip, i, buffer, 25);
  printf ("[%s]\n", buffer);
}

Custom Places

(Feature Available in Version 32 and Higher)

Custom places such as your important business locations or customer sites can be created in the ContentTools web tool and shared with PC*Miler for use in route planning.

Go here for more information on how to create and sync custom places using Content Tools and the PC*Miler user interface.

Once you have created Custom Places, they can be called by name when entering stops to create a route.

The following PC*Miler Connect functions can be used to search for all cities, postal codes, custom places, or POIs (points of interest) within a specified radius of any city/state or ZIP code.

  • PCMSNumPOICategories gets the number of available POI categories in the database.
  • PCMSPOICategoryName gets a POI category name given its index.
  • PCMSLocRadLookup performs a search within the specified radius.
  • PCMSGetLocRadItem gets an item found in the location radius query.
Last updated July 9, 2025.
Contents