See: Description
Addressing addressing = new AddressingBuilder()
.withConfiguration(new AddressingConfigurationBuilder()
.withResources(Paths.get("{directory}/ga-sdk-dist-{version}/resources")) // runtime resources location bundled in release distribution
.withData(new SpdDataSourceBuilder()
.withSpdPaths(Paths.get("/data")) // location where software should scan for SPD data
.withNumberOfExtractors(3)
.withExtractedPath(Paths.get("/data")) // location where data should be extracted
.build())
.build())
.build();
RequestAddress address = new RequestAddress();
address.setCountry("USA");
address.setAddressLines(Arrays.asList("1 Global View Troy NY 12180"));
Preferences preferences = new PreferencesBuilder()
.withReturnAllInfo(true)
.withFactoryDescription(new FactoryDescriptionBuilder()
.withLabel("ggs")
.build())
.build();
Response response = addressing.geocode(address, preferences);
if(Status.OK == response.getStatus()) {
// take action on address
}
GeocodingAPI geocoder = new GeocoderBuilder()
//path to ggs runtime resources, this will be located under ggs distribution
.withConfiguration(Paths.get("{directory}/ga-sdk-dist-{version}/resources"))
// This is where you can set default preferences. If this is not set, the default preferences would be used from
// configuration file: {directory}/ga-sdk-dist-{version}/resources/config/geocodePreferences.xml
.withPreferences(new GeocoderPreferences())
.build();
Copyright © 2024. All rights reserved.