... | @@ -6,45 +6,45 @@ https://maps.heigit.org/osm-wms/service/WMSServer?SERVICE=WMS&Version=1.3.0&REQU |
... | @@ -6,45 +6,45 @@ https://maps.heigit.org/osm-wms/service/WMSServer?SERVICE=WMS&Version=1.3.0&REQU |
|
|
|
|
|
```
|
|
```
|
|
The URL of the WMS Server itself:
|
|
The URL of the WMS Server itself:
|
|
https://maps.heigit.org/osm-wms/service/WMSServer
|
|
'_https://maps.heigit.org/osm-wms/service/WMSServer_'
|
|
|
|
|
|
Specifying that we want to send a request to the WMS-Server:
|
|
Specifying that we want to send a request to the WMS-Server:
|
|
_?SERVICE=WMS_
|
|
'_?SERVICE=WMS_'
|
|
|
|
|
|
Specifying the Version we need to use, we found out which Version to use by looking at the capabilities:
|
|
Specifying the Version we need to use, we found out which Version to use by looking at the capabilities:
|
|
_&Version=1.3.0_ -> set version
|
|
'_&Version=1.3.0_'
|
|
|
|
|
|
Specifying that we want to receive a Map-Image:
|
|
Specifying that we want to receive a Map-Image:
|
|
_&REQUEST=GetMap_ -> request map image
|
|
'_&REQUEST=GetMap_'
|
|
|
|
|
|
Setting the Projection through the EPSG-Code (even though WGS84 is the default in this case, it had to be specified accordingly.
|
|
Setting the Projection through the EPSG-Code (even though WGS84 is the default in this case, it had to be specified accordingly.
|
|
_&CRS=EPSG:4326_
|
|
'_&CRS=EPSG:4326_'
|
|
|
|
|
|
Selecting the layer, as specified in the assignment:
|
|
Selecting the layer, as specified in the assignment:
|
|
_&layers=osm_auto:all_
|
|
'_&layers=osm_auto:all_'
|
|
|
|
|
|
Selecting the Bounding Box for the coordinates:
|
|
Selecting the Bounding Box for the coordinates:
|
|
(We ran into some issues here, as the order in which the coordinates have to be presented changed between Versions and the reference often does not specify which version it refers to...)
|
|
(We ran into some issues here, as the order in which the coordinates have to be presented changed between Versions and the reference often does not specify which version it refers to...)
|
|
The bounding box is constructed through presenting a minimum x-value, a minimum y-value, a max x-value and finally a max y-value.
|
|
The bounding box is constructed through presenting a minimum x-value, a minimum y-value, a max x-value and finally a max y-value.
|
|
|
|
|
|
_&BBOX=42.32,-71.13,42.42,-71.03_
|
|
'_&BBOX=42.32,-71.13,42.42,-71.03_'
|
|
|
|
|
|
In order to set the size of the image presented we specified the with and the height of the image, note that a new "block" of the request starts with the addition of &styles, which is followed by all the attributes concerning the style of the map produced. Depending on the size chose the detail of the map varies greatly, for example a map with the size 780x780px is far more primititve than one with a size above 1000 px, although the api only allows to request images up to a certain size (4000px) until it sends an error message that tells you thatthe size you requested is too big.
|
|
In order to set the size of the image presented we specified the with and the height of the image, note that a new "block" of the request starts with the addition of &styles, which is followed by all the attributes concerning the style of the map produced. Depending on the size chose the detail of the map varies greatly, for example a map with the size 780x780px is far more primititve than one with a size above 1000 px, although the api only allows to request images up to a certain size (4000px) until it sends an error message that tells you thatthe size you requested is too big.
|
|
|
|
|
|
_&styles=&WIDTH=780&HEIGHT=780_ -> set size of map, if different dimension projection skewed
|
|
'_&styles=&WIDTH=780&HEIGHT=780_'
|
|
|
|
|
|
We set the format that is supposed to be requested to png.
|
|
We set the format that is supposed to be requested to png.
|
|
|
|
|
|
_&FORMAT=image/png_ -> set image format
|
|
'_&FORMAT=image/png_'
|
|
|
|
|
|
We then set the background to be transparent.
|
|
We then set the background to be transparent.
|
|
|
|
|
|
_&TRANSPARENT=TRUE_ -> set transparent bg
|
|
'_&TRANSPARENT=TRUE_'
|
|
|
|
|
|
### Comparison file size of the WMS-Image:
|
|
### Comparison file size of the WMS-Image:
|
|
smaller size (780x780 px) vs. max size (4000x4000px):
|
|
smaller size (780x780 px) vs. max size (4000x4000px):
|
|
|
|
|
|
<img src="uploads/4740d09dd088125a00a0478d614c6600/mapimg.png" width="400"><img src="uploads/a5b992a146e3b9781064aeacde8078bd/mapimg2.png" width="400">
|
|
<img src="uploads/4740d09dd088125a00a0478d614c6600/mapimg.png" width="400"> <img src="uploads/a5b992a146e3b9781064aeacde8078bd/mapimg2.png" width="400">
|
|
|
|
|
|
|
|
|
|
|
|
|
... | @@ -53,13 +53,18 @@ smaller size (780x780 px) vs. max size (4000x4000px): |
... | @@ -53,13 +53,18 @@ smaller size (780x780 px) vs. max size (4000x4000px): |
|
We decided to use the more detailed bigger version of the image, as it is much more clear, although it could be considered to decrease the size if you want to save on ressources, as the larger image takes more time to download obviously.
|
|
We decided to use the more detailed bigger version of the image, as it is much more clear, although it could be considered to decrease the size if you want to save on ressources, as the larger image takes more time to download obviously.
|
|
|
|
|
|
<!--- minx,miny,maxx,maxy -> -71.13,42.32,-71.03,42.42; axis order is set as X=longitude (easting) and Y=latitude (northing), negative values are long --->
|
|
<!--- minx,miny,maxx,maxy -> -71.13,42.32,-71.03,42.42; axis order is set as X=longitude (easting) and Y=latitude (northing), negative values are long --->
|
|
|
|
|
|
# Integration of the WMS Image into Google Earth:
|
|
# Integration of the WMS Image into Google Earth:
|
|
https://docs.geotools.org/latest/userguide/extension/wms/wms.html
|
|
|
|
|
|
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:
|
|
|
|
|
|
|
|
|
|
|
|
## 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
|
|
|
|
|
|
# Creating a ground overlay to display the image in google earth:
|
|
|
|
```
|
|
```
|
|
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
|
|
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2">
|
|
|
|
|
... | @@ -71,7 +76,7 @@ https://docs.geotools.org/latest/userguide/extension/wms/wms.html |
... | @@ -71,7 +76,7 @@ https://docs.geotools.org/latest/userguide/extension/wms/wms.html |
|
<href>C:\User\Downloads\testimg.png</href>
|
|
<href>C:\User\Downloads\testimg.png</href>
|
|
</Icon>
|
|
</Icon>
|
|
<gx:LatLonQuad>
|
|
<gx:LatLonQuad>
|
|
<coordinates>-71.13,42.32 -71.03,42.32 -71.03,42.42 -71.13,42.42</coordinates> <!-- four lon,lat tuples -->
|
|
<coordinates>-71.13,42.32 -71.03,42.32 -71.03,42.42 -71.13,42.42</coordinates>
|
|
</gx:LatLonQuad>
|
|
</gx:LatLonQuad>
|
|
</GroundOverlay>
|
|
</GroundOverlay>
|
|
|
|
|
... | @@ -83,7 +88,7 @@ To create the kml structure that displayed the WMS-Image as a ground overlay in |
... | @@ -83,7 +88,7 @@ To create the kml structure that displayed the WMS-Image as a ground overlay in |
|
Below you can see how the WMs-image is shown as a ground overlay with 30% opacity.
|
|
Below you can see how the WMs-image is shown as a ground overlay with 30% opacity.
|
|

|
|

|
|
|
|
|
|
#References used:
|
|
# References used:
|
|
|
|
|
|
* https://docs.geoserver.org/2.21.x/en/user/services/wms/reference.html
|
|
* https://docs.geoserver.org/2.21.x/en/user/services/wms/reference.html
|
|
* https://docs.geoserver.org/main/en/user/services/wms/basics.html -> Crs/EPGS code
|
|
* https://docs.geoserver.org/main/en/user/services/wms/basics.html -> Crs/EPGS code
|
... | | ... | |