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());
}
}