|
|
# Creating the wms request
|
|
|
In order to create the request for the WMS-Server we started by looking at the information at hand and also requested the capabilities, mainly to get an overview over the possible settings and files. We used the given specifications as well as the wms-documentation to write out the request, below each of the elements is broken down and their function explained:
|
|
|
In order to create the request for the WMS-Server we started by looking at the information at hand and also requested the capabilities, mainly to get an overview over the possible settings and files. We used the given specifications as well as the WMS-documentation to write out the request, below each of the elements is broken down and their function explained:
|
|
|
|
|
|
```
|
|
|
https://maps.heigit.org/osm-wms/service/WMSServer?SERVICE=WMS&Version=1.3.0&REQUEST=GetMap&CRS=EPSG:4326&layers=osm_auto:all&BBOX=42.32,-71.13,42.42,-71.03&styles=&WIDTH=4000&HEIGHT=4000&FORMAT=image/png&TRANSPARENT=TRUE
|
... | ... | @@ -47,10 +47,7 @@ smaller size (780x780 px) vs. max size (4000x4000px): |
|
|
<img src="uploads/4740d09dd088125a00a0478d614c6600/mapimg.png" width="600"> <img src="uploads/a5b992a146e3b9781064aeacde8078bd/mapimg2.png" width="600">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
We decided to use the more detailed bigger version of the image, as a smaller image has a smaller resolution as well, which causes the ground overlay to look pixelatzed an "muddy". Although it could be considered to decrease the size if you want to save on resources, as the larger image takes more time to download obviously.
|
|
|
We decided to use the more detailed bigger version of the image, as a smaller image has a smaller resolution as well, which causes the ground overlay to look pixelated an "muddy". Although it could be considered to decrease the size if you want to save on resources, as the larger image takes more time to download obviously.
|
|
|
|
|
|
|
|
|
# Integration of the WMS Image into Google Earth:
|
... | ... | @@ -58,11 +55,11 @@ We decided to use the more detailed bigger version of the image, as a smaller im |
|
|
In order to integrate the WMS Image into Google Earth we wrote a method that requests the WMS Image from the Server, saves it locally and another method that then integrates the image into the KML structure as a Ground-Overlay.
|
|
|
|
|
|
## Retrieving the image from the server and saving it locally:
|
|
|
|
|
|
The image is retrieved from the server by sending a request that requests the necessary parameters. The process of sending the request is pretty straight forward, one issue we ran into was that the layer name could not be retrieved by just requesting the string, so we added a 'getCapabilities()'-request and put the capabilites into the 'getNamedLayers()'-function of the geotools-WMS-extension, that retrieves all named layers from the server and add them to a list, the Layer we need ('osm_auto:all') was the first so when building the request weask for the first item in the list. We then use the BufferedImage and ImageIO imports to create an image output stream and write it into a file, which will later be accessed by the filePath variable within the kml-structure.
|
|
|
|
|
|
## Creating a ground overlay to display the image in google earth:
|
|
|
|
|
|
To integrate the inage of the map we first built a blueprint of the necessary structures
|
|
|
To integrate the image of the map we first built a blueprint of the necessary structures
|
|
|
|
|
|
```
|
|
|
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
|
... | ... | @@ -86,6 +83,8 @@ To create the kml structure that displayed the WMS-Image as a ground overlay in |
|
|
|
|
|
We used the gx:LatLonQuad tag to specify the bounding box because we could use the coordinates as i, and didnt have to do any conversions, which would have been necessary if we used the standard LatLonBox.
|
|
|
|
|
|
Later we integrated the ground overlay into the kml-structure as we did in class, by adding on to the string and using 'filPath' as a variable for the filePath of the ground overlay image.
|
|
|
|
|
|
Below you can see how the WMs-image is shown as a ground overlay with 30% opacity.
|
|
|

|
|
|
|
... | ... | |