Code GeoTAX into an Application - geotax_sdk - 2.2

GeoTAX SDK Developer Guide

Product type
Software
Portfolio
Locate
Product family
Geo Addressing
Product
GeoTAX SDK
Version
2.2
Language
English
Product name
GeoTAX SDK
Title
GeoTAX SDK Developer Guide
Copyright
2024
First publish date
2023
Last updated
2024-08-30
Published on
2024-08-30T02:47:25.239250

This section describes how to create an application.

Define data sources

Instantiate the FileDataSource class to provide the location of a database.

dataSourceList.add(new FileDataSource(
     Paths.get("GTXAPI-Data-location")));

Define location of resources

Build the TaxRateLookupConfigures and tell the application where the GeoTAX SDK resources folder is located. The resources folder is part of the distribution and contains platform libraries.

configuration = new TaxRateLookupConfigurationBuilder()
      .withData(dataSourceList)
      .withResources(
      Paths.get("path to geotax-dist-version\\taxing-resources"))

At the same time, we define the runtime path to the platform specific libraries.

     .withRuntimeLib(Paths
        .get("path to geotax-dist-version\\taxing-resources\\bin\\win64"))
        .build();

Define the lookup object

Use the configuration to create the lookup object.

lookup = new TaxRateLookupBuilder().withConfiguration(configuration)
  .build();

Lookup tax information for an address

Specify the address for which you want to get tax information.

Preferences preferences = new PreferencesBuilder().build();
  TaxRateAddress address = new TaxRateAddress();
  address.setAddressLines(Arrays.asList("201 N ALTAS PALMAS DR HARLINGEN, TX"));

Then perform the lookup.

TaxResponse response = lookup.lookupByAddress(address, preferences);

Results

When your run the code, the lookup returns detailed information including:

  • The confidence value for the address
  • Tax information
  • Detailed jurisdiction state, county and place information
  • Detailed address and location information
  • Census information
  • Coordinates and match level (such as roof top)

How to produce an output

This example demonstrates how to specify parameters for output.
if (response.getStatus() == Status.OK) {
            for (Result result : response.getResults()) {
                printField("confidence", result.getConfidence());
                printField("gnisCode", result.getGnisCode());
                printField("jurisdictionState", result.getJurisdiction().getState());
                printField("jurisdictionCounty", result.getJurisdiction().getCounty());
                printField("jurisdictionPlace", result.getJurisdiction().getPlace());
                printField("matchedAddress", result.getMatchedAddress());
                printField("census", result.getCensus());
                printField("latLongFields", result.getLatLongFields());
            }
        }