Logo Lanfrica

AfriGIS-South-Africa/afrigis-services-java

Domaine:

digital infrastructuregeospatial

Type de record:

software
Créateur:
Afr
Hôte:
A Java library to help you consume services provided by AfriGIS (Pty) Ltd # Introduction # Getting Started Before you do anything with the AfriGIS Services, you will need to sign up for an account.. ## Java ### Download Binaries are distributed via mvnrepository.com. ### Building from source This is a Maven based project. In order for the unit tests to pass, you will need to provide valid AfriGIS Services credentials via your environment variables. OR you can skip the tests. Both options demonstrated below. #### Building with valid credentials: `mvn -Dag.services.test.key=xxx -Dag.services.test.secret=yyy clean package` It is also possible to provide the credentials through your operating systems specific environment mechanisms. #### Building by skipping tests: `mvn -Dmaven.test.skip=true -DskipTests clean package` The compiled JAR files will be found under the relevant `target` folders. ### Quick start The basic workflow goes like this: - Obtain a `ServiceCallFactory` instance: `AfriGISServices.instance("Key","Secret");` - Use the `ServiceCallFactory` instance to access AfriGIS Services - easy, no? The factory and services instances are intended to be kept around for the duration of your application. BUT, if you do not want do to that, you don't HAVE to, but performance will be better if you do. More concrete example (Geocoding aka "Search"): Add the dependency: ```xml com.afrigis.services geocode 3.0.2 ``` ```java import java.util.concurrent.ExecutionException; import java.util.concurrent.Future; import com.afrigis.services.AfriGISServices; import com.afrigis.services.ServiceCallFactory; import com.afrigis.services.geocode.AddressRequest; import com.afrigis.services.geocode.AddressResponse; import com.afrigis.services.geocode.GeocodeGroupOption; import com.afrigis.services.geocode.LocationResult; public static void main(String[] args) throws InterruptedException, ExecutionException { String key = " "; String secret = " "; // Construct the services factory - keep this instance around! ServiceCallFactory factory = …

Licenses