TAMU GeoServices
About Services Pricing Support News
Log In Sign Up
  • Address Processing
  • Geocoding
  • Geocode Correction
  • Census Intersection
  • k-Nearest Search
    • Platform Details
    • Interactive
    • Batch Processing
    • Web APIs
  • Reverse Geocoding
  • Drag & Drop Mapping
  • Privacy & Security
  • Terms of Use
  • Get Started Now!
    v 5.0.0 API
    • Overview
    • REST
    • SOAP
    • Examples
    Previous Versions
    • v 4.01
    • v 3.01
    • v 2.95

k-Nearest Neighbor Geographic Feature Search

Services › k-Nearest Search › Web Services

The Texas A&M University Geoservices k-Nearest Neighbor Geographic Features Service identifies the k closest geographic features to an input coordinate. This service can be used from desktop and/or web applications via the Web Service interfaces listed below. The only required information is the API key, which is available in your account profile page. You may want to read the technical details.

API Version - 5.0.0

Available API Endpoints


API #1 - .Net k-Nearest Neighbor Geographic Feature Search Web Service


  • API that can be used from scripts, http, and SOAP compatible clients
  • API URL

    https://geoservices.tamu.edu/Api/KNearest/V5/Soap/


API #2 - HTTP k-Nearest Neighbor Geographic Feature Search Web Service


  • API that can be used from scripts and http
  • API URL

    https://geoservices.tamu.edu/Api/KNearest/V5/?

    API Input Fields

    Parameter Required Description Example Possible Values
    apiKey true click here for your API key api-key-value text string
    version true the version of the parser to use 5.0.0 5.0.0
    lat true the latitude of the input coordinate 34.0726207 double
    lon true the longitude of the input coordinate -118.397965 double
    k true the number of serach results to find 1 integer value
    table true the geographic feature table to search within 1 one value from the following:
    AQMDs
    MammographyClinics
    RadiationFacilities
    format false output format csv csv, tsv, xml
    notStore false indicates if the transaction details should not be historically stored in your account true true, false

    API Output Fields and Index (for non-XML output)

    Position Field Required Description Possible Values
    0 Transaction Id true Query Id Unique Id
    1 API Version true Vesion of the API used 5.0.0
    2 Query Status Code true Result code See list
    3 Time Taken true Processing time Milliseconds
    4 Error Message true Any errors that occurred Text
    5 k-Nearest Geographic Features true A bar (|) separated list of values which include the following fields separated by a semi-colon (;): id;latitude;longitude;distance Text
  • API Examples

    Example 1 - 34.0726207994348, -118.397965182076, 17, MammographyClinics, store (XML)

    Example 2 - 34.0726207994348, -118.397965182076, 5, AQMDs, store (CSV)

    Example 3 - 34.0726207994348, -118.397965182076, 20, RadiationFacilities, notStore (CSV)

Texas A&M University © 2022 · GeoInnovation Service Center · B-GSVCSWEB | Version-20240612.5 | Release-122
About Contact Careers Security Policy Privacy Policy