← All procedures

geo.addressPoint

Find the point of a street address of the United States on its address range (the Census Geocoder). The point is on the street line, near the road, not in the lot

CLI
Package
@procedures/geo · README
Path
["geo","addressPoint"]
CLI
mark geo addressPoint --street <string> --userAgent <string>
As data
{"$proc":["geo","addressPoint"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/geo/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["geo","addressPoint"], { street: "<street>", userAgent: "<userAgent>" });
console.log(JSON.stringify(result));

From the command line

$ mark geo addressPoint --street <string> --userAgent <string>

As data, in a program

{
  "$proc": ["geo", "addressPoint"],
  "input": { "street": "<street>", "userAgent": "<userAgent>" }
}

Input

FieldTypeRequiredDefaultDescription
streetstringyesThe house number and the street name, for example 12 Main St
citystringnoThe city or the town
statestringnoThe state, as a code (for example VT) or as a name
zipstringnoThe ZIP code
userAgentstringyesThe User-Agent that names your application and a contact. The policies of the public servers require it
timeoutMsintegernoThe time limit of the request, in milliseconds (default: 30000)

Output

FieldTypeRequiredDefaultDescription
matchesobject[]yesThe matches of the geocoder. The point is on the street line, not in the lot. An empty list: no address range holds the address
attributionstringyesThe citation of the data of the Census Geocoder
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "street": {
        "type": "string",
        "minLength": 1,
        "maxLength": 200,
        "description": "The house number and the street name, for example 12 Main St"
      },
      "city": {
        "description": "The city or the town",
        "type": "string",
        "minLength": 1,
        "maxLength": 200
      },
      "state": {
        "description": "The state, as a code (for example VT) or as a name",
        "type": "string",
        "minLength": 1,
        "maxLength": 200
      },
      "zip": {
        "description": "The ZIP code",
        "type": "string",
        "pattern": "^d{5}(-d{4})?$"
      },
      "userAgent": {
        "type": "string",
        "minLength": 3,
        "maxLength": 300,
        "pattern": "^[\\x20-\\x7e]+$",
        "description": "The User-Agent that names your application and a contact. The policies of the public servers require it"
      },
      "timeoutMs": {
        "description": "The time limit of the request, in milliseconds (default: 30000)",
        "type": "integer",
        "exclusiveMinimum": 0,
        "maximum": 120000
      }
    },
    "required": [
      "street",
      "userAgent"
    ]
  },
  "output": {
    "type": "object",
    "properties": {
      "matches": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "lat": {
              "type": "number",
              "description": "The latitude of the point on the address range, in degrees"
            },
            "lon": {
              "type": "number",
              "description": "The longitude of the point on the address range, in degrees"
            },
            "matchedAddress": {
              "type": "string",
              "description": "The address that the geocoder matched"
            },
            "side": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": [
                    "L",
                    "R"
                  ]
                },
                {
                  "type": "null"
                }
              ],
              "description": "The side of the street line that holds the number"
            },
            "tigerLineId": {
              "description": "The id of the TIGER/Line edge of the address range",
              "type": [
                "string",
                "null"
              ]
            }
          },
          "required": [
            "lat",
            "lon",
            "matchedAddress",
            "side",
            "tigerLineId"
          ],
          "additionalProperties": false
        },
        "description": "The matches of the geocoder. The point is on the street line, not in the lot. An empty list: no address range holds the address"
      },
      "attribution": {
        "type": "string",
        "description": "The citation of the data of the Census Geocoder"
      }
    },
    "required": [
      "matches",
      "attribution"
    ],
    "additionalProperties": false
  }
}