... | ... | @@ -57,20 +57,55 @@ Scanner askContinue = new Scanner(System.in); |
|
|
```
|
|
|
|
|
|
|
|
|
## Creating a Central Class from which to Execute the Whole Programme
|
|
|
## Step 1: Creating a Central Class from which to Execute the Whole Programme
|
|
|
|
|
|
To make the whole programme run smoothly without the user having to figure out which classes to execute and in which order, we simply applied our previously gained knowledge about modularity and decided to create a set of non-executable classes that will be called from the main class in the correct order.
|
|
|
The corresponding .java file for this class can be found [here](https://git.sbg.ac.at/s1080384/EoT/-/blob/main/.java%20Files/execute_programme.java).
|
|
|
|
|
|
|
|
|
## Download WMS from Web
|
|
|
## Step 2: Web Map Service
|
|
|
|
|
|
Another key component of our project is to access, download and integrate a Web Map Service (WMS) of Boston. This task was divided into two sub-steps:
|
|
|
|
|
|
### 2.1: Connecting and Downloading WMS
|
|
|
|
|
|
First, we created a non-executable class that contains a method **getMap()** that:
|
|
|
> 1. creates a WebMapServer object
|
|
|
> 2. tests the URL
|
|
|
> 3. retrieves the WMSCapabilities and information about the service
|
|
|
> 4. sends a fully configured GetMapRequest
|
|
|
> 5. asks the user if they would like to see information on the service (and either shows it or moves on)
|
|
|
> 6. writes the image in .png to the local directory
|
|
|
|
|
|
When this method is called from the main class, the user will be kept updated and will see the following on the console:
|
|
|
|
|
|
```
|
|
|
Accessing WMS and downloading .png of Boston to local directory at: C:\Users\Christina\Documents\EoT\boston.png...
|
|
|
Testing Heigit's wms service URL...
|
|
|
URL vaid.
|
|
|
No errors in communicating with the server.
|
|
|
Would you like additional information on the WMS service while the programme runs? Type Y for yes or anything else for no and hit enter.
|
|
|
y
|
|
|
The WMS capabilities are being retreived from a server called: OGC:WMS
|
|
|
And the server's title is :OSM-WMS Uni Heidelberg.
|
|
|
|
|
|
The requested image will be stored as a .png with dimensions of 1000 x 1000 pixels.The coordinate reference system is set to ESPG:4326
|
|
|
|
|
|
|
|
|
Requested URL: http://maps.heigit.org/osm-wms/service?REQUEST=GetMap&FORMAT=image%2Fpng&SRS=EPSG:4326&BBOX=-71.13,42.32,-71.03,42.42&VERSION=1.1.1&STYLES=default&SERVICE=WMS&WIDTH=1000&HEIGHT=1000&TRANSPARENT=TRUE&LAYERS=osm_auto%3Aall
|
|
|
Image was successfully saved at: C:\Users\Christina\Documents\EoT\boston.png
|
|
|
Step 1 completed.
|
|
|
|
|
|
```
|
|
|
|
|
|
bla blab bla text on how we did it
|
|
|
The corresponding .java file for this non-excutable class can be found [here](url).
|
|
|
|
|
|
|
|
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Further Information
|
|
|
|
|
|
For further information on this project, don't hesitate to contact the authors:
|
... | ... | |