Page tree
Skip to end of metadata
Go to start of metadata

Overview

The parser imports data from https://api.portofrotterdam.com/v1/weather-tide/observations.  To be able to access the API, you need to have a client key. 

Data Example I

Url: https://api.portofrotterdam.com/v1/weather-tide/observations?from-time=2018-11-05T12:00:00.000Z&to-time=2018-11-05T14:00:00.000Z&location=Amaliahaven&procedure=Height%20of%20tide%2010%20minutes%20POR
 
{
    "_embedded": {
        "observations": [
            {
                "parameterType": {
                    "type": "HTIDE",
                    "description": "Height of tide"
                },
                "procedure": {
                    "name": "Height of tide 10 minutes POR",
                    "description": "Height of tide 10 minutes POR",
                    "parameters": [
                        {
                            "name": "H10",
                            "description": "Height of tide 10 minutes",
                            "uom": "cm",
                            "reference": "NAP"
                        }
                    ]
                },
                "featureOfInterest": {
                    "id": "9E1F30AA-2FE0-47B6-86F4-6F63F90B5BB0",
                    "location": "Amaliahaven",
                    "geometry": {
                        "type": "Point",
                        "coordinates": [
                            59315,
                            442446,
                            4.771
                        ],
                        "spatialReference": {
                            "wkid": "28992"
                        }
                    }
                },
                "result": [
                    {
                        "phenomenonTime": "2018-11-05T12:00:00Z",
                        "parameters": [
                            {
                                "name": "H10",
                                "value": 128.633333333333
                            }
                        ]
                    },
                    {
                        "phenomenonTime": "2018-11-05T12:10:00Z",
                        "parameters": [
                            {
                                "name": "H10",
                                "value": 122.949152542373
                            }
                        ]
                    },
                    {
                        "phenomenonTime": "2018-11-05T12:20:00Z",
                        "parameters": [
                            {
                                "name": "H10",
                                "value": 115.4
                            }
                        ]
                    },
                    {
                        "phenomenonTime": "2018-11-05T12:30:00Z",
                        "parameters": [
                            {
                                "name": "H10",
                                "value": 110.05
                            }
                        ]
                    },
                        ]
                    }
                ]
            }
        ]
    },
    "_links": {
        "self": {
            "href": "https://api.portofrotterdam.com/v1/weather-tide/observations?location=Amaliahaven&procedure=Height%20of%20tide%2010%20minutes%20POR&from-time=2018-11-05T12:00:00.000Z&to-time=2018-11-05T14:00:00.000Z"
        },
        "location": {
            "href": "https://api.portofrotterdam.com/v1/weather-tide/locations/Amaliahaven"
        },
        "procedure": {
            "href": "https://api.portofrotterdam.com/v1/weather-tide/procedures/Height%20of%20tide%2010%20minutes%20POR"
        }
    }
}

 

Some phenomenons have two different parameters (such as wind direction and wind speed). You can choose to parse either or both of them. If you need both values, two different time series should be configured using the same qualifierId.

Data example II:

{
    "_embedded": {
        "observations": [
            {
                "parameterType": {
                    "type": "TDSTR",
                    "description": "Tidal stream"
                },
                "procedure": {
                    "name": "Predicted tidal stream 10 minutes depth averaged OSR",
                    "description": "Predicted tidal stream 10 minutes depth averaged OSR",
                    "parameters": [
                        {
                            "name": "PTSDDA10",
                            "description": "Predicted tidal stream direction 10 minutes depth averaged",
                            "uom": "deg",
                            "reference": "Ntrue"
                        },
                        {
                            "name": "PTSRDA10",
                            "description": "Predicted tidal stream rate 10 minutes depth averaged",
                            "uom": "m/s"
                        }
                    ]
                },
                "featureOfInterest": {
                    "id": "89F8AE3B-C7E5-4DBB-809A-950DD63953CD",
                    "location": "Bolnes",
                    "geometry": {
                        "type": "Point",
                        "coordinates": [
                            99124,
                            435302.7
                        ],
                        "spatialReference": {
                            "wkid": "28992"
                        }
                    }
                },
                "result": [
                    {
                        "phenomenonTime": "2019-03-10T19:00:00Z",
                        "parameters": [
                            {
                                "name": "PTSRDA10",
                                "value": 0.62
                            },
                            {
                                "name": "PTSDDA10",
                                "value": 103.9
                            }
                        ]
                    },
                    {
                        "phenomenonTime": "2019-03-10T19:10:00Z",
                        "parameters": [
                            {
                                "name": "PTSRDA10",
                                "value": 0.6
                            },
                            {
                                "name": "PTSDDA10",
                                "value": 103.9
                            }
                        ]
                    },
                    {
                        "phenomenonTime": "2019-03-10T19:20:00Z",
                        "parameters": [
                            {
                                "name": "PTSRDA10",
                                "value": 0.56
                            },
                            {
                                "name": "PTSDDA10",
                                "value": 103.9
                            }
                        ]
                    },
                    {
                        "phenomenonTime": "2019-03-12T19:00:00Z",
                        "parameters": [
                            {
                                "name": "PTSRDA10",
                                "value": 0.84
                            },
                            {
                                "name": "PTSDDA10",
                                "value": 104.7
                            }
                        ]
                    }
                ]
            }
        ]
    },
    "_links": {
        "self": {
            "href": "https://api.portofrotterdam.com/v1/weather-tide/observations?location=Bolnes&procedure=Predicted%20tidal%20stream%2010%20minutes%20depth%20averaged%20OSR&from-time=2019-03-10T19:00:00.000Z&to-time=2019-03-12T19:00:00.000Z"
        },
        "location": {
            "href": "https://api.portofrotterdam.com/v1/weather-tide/locations/Bolnes"
        },
        "procedure": {
            "href": "https://api.portofrotterdam.com/v1/weather-tide/procedures/Predicted%20tidal%20stream%2010%20minutes%20depth%20averaged%20OSR"
        }
    }
}

 

Fews Configuration

As a qualifier ID of each time series the name (or description) from the procedure should be configured. This field is necessary to constuct the URL. The field should be the same as the value of "procedure" in the URL.  Strings of "%20" can be replaced by a space.

Example:

procedure=Height%20of%20tide%2010%20minutes%20POR
"procedure": {
                    "name": "Height of tide 10 minutes POR",
                    "description": "Height of tide 10 minutes POR",
                    "parameters": [

A qualifier id must be configured in exactly one place: either in the module config (see bellow) or in the id mapping.

 

Some phenomenons have two different parameters (such as wind direction and wind speed). You can choose to parse either or both of them. If you need both values, two different time series should be configured using the same qualifierId. See Example II.

 

Example:

<?xml version="1.0" encoding="UTF-8"?>
<timeSeriesImportRun xmlns="http://www.wldelft.nl/fews"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/timeSeriesImportRun.xsd">
   <import>
      <general>
         <importType>RotterdamPort</importType>
         <serverUrl>https://api.portofrotterdam.com/v1/weather-tide/observations</serverUrl>
		<!-- the client key should be set as user -->
         <user>client key</user>
         <password>YYYY</password>
         <relativeViewPeriod unit="hour" start="-36" end="12" startOverrulable="true" endOverrulable="true"/>
	     <idMapId>RotterdamPortIdMapper</idMapId>
         <importTimeZone>
            <timeZoneOffset>+00:00</timeZoneOffset>
         </importTimeZone>
      </general>
      <timeSeriesSet>
         <moduleInstanceId>RotterdamPort</moduleInstanceId>
         <valueType>scalar</valueType>
         <parameterId>Tide</parameterId>
		<!-- Do not configure a qualifierId here if you are using id-mapping -->
		 <qualifierId>Height of tide 10 minutes POR</qualifierId>
         <locationId>Amaliahaven</locationId>
         <timeSeriesType>external historical</timeSeriesType>
         <timeStep unit="minute" multiplier="10"/>
         <readWriteMode>add originals</readWriteMode>
      </timeSeriesSet>
   </import>
</timeSeriesImportRun>

 

Example II

<?xml version="1.0" encoding="UTF-8"?>
<timeSeriesImportRun xmlns="http://www.wldelft.nl/fews"
					 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
					 xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/timeSeriesImportRun.xsd">
	<import>
		<general>
			<importType>RotterdamPort</importType>
			<serverUrl>https://api.portofrotterdam.com/v1/weather-tide/observations</serverUrl>
			<user>User</user>
			<password>YYYY</password>
			<relativeViewPeriod unit="hour" start="-36" end="12" startOverrulable="true" endOverrulable="true"/>
			<idMapId>RotterdamPortIdMapper</idMapId>
			<importTimeZone>
				<timeZoneOffset>+00:00</timeZoneOffset>
			</importTimeZone>
		</general>
		
		<timeSeriesSet>
			<moduleInstanceId>RotterdamPort</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>PTSRDA10</parameterId>
			<!-- Do not configure a qualifierId here if you are using id-mapping -->
			<qualifierId>Predicted tidal stream 10 minutes depth averaged OSR</qualifierId>
			<locationId>Bolnes</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="minute" multiplier="10"/>
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
		<timeSeriesSet>
			<moduleInstanceId>RotterdamPort</moduleInstanceId>
			<valueType>scalar</valueType>
			<parameterId>PTSDDA10</parameterId>
			<!-- Do not configure a qualifierId here if you are using id-mapping -->
			<qualifierId>Predicted tidal stream 10 minutes depth averaged OSR</qualifierId>
			<locationId>Bolnes</locationId>
			<timeSeriesType>external historical</timeSeriesType>
			<timeStep unit="minute" multiplier="10"/>
			<readWriteMode>add originals</readWriteMode>
		</timeSeriesSet>
	</import>
</timeSeriesImportRun>

 

Configuring the parameter:

 

The id of the parameter (or, if mapping is used, the external id of the parameter)  has to be the same field as the name field in the parameters list, otherwhise the fieled will not be parsed.

"parameters": [
                            {
                                "name": "H10",
                                "value": 97.2
                            }
<parameter id="H10" name="Height of tide 10 minutes POR">
		<shortName>H10</shortName>
		<description>Height of tide 10 minutes POR</description>
</parameter>

 

Using id mapping

Alternatly ID mapping can be used:

<?xml version="1.0" encoding="UTF-8"?>
<idMap version="1.1" xmlns="http://www.wldelft.nl/fews" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wldelft.nl/fews http://fews.wldelft.nl/schemas/version1.0/idMap.xsd">
   <map externalLocation="Amaliahaven" externalParameter="H10" internalLocation="Haven" internalParameter="Tide" externalQualifier="Height of tide 10 minutes POR" />
</idMap> 

 

 

Java does not automatically recognize the certificate of  https://api.portofrotterdam.com/v1/weather-tide/observations. Delft-FEWS is based on JAVA and JAVA does not have by default the PKI Overheid certificate in it's distribution. Unlike popular browsers like Firefox, Chrome or IE. Therefore the PKI Overheid certificate should be made known to JAVA using the following guide:

How to configure secure https connection to Matroos

  • No labels