Cruisers Forum
 


Join CruisersForum Today

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 10-02-2019, 08:01   #1
Registered User

Join Date: May 2012
Posts: 533
UKTides_pi using the UKHO API

UKHO have published an API which allows the downloading of HW/LW times/heights for up to 7 days in the future. Over 600 UK locations are included.

There are already a number of websites which offer this data but this new plugin keeps everything within OpenCPN, which may help route planning.

At the moment the installer is only for OpenCPN 5.0:

https://github.com/Rasbats/UKTides_pi/releases/tag/v0.1

Get the beta for OpenCPN 5.0 here:
OpenCPN Version 5 Beta Starts

I found that wxCurl gave problems with HTTP GET and moved to curl/curlcpp. CMakeLists.txt would need editing for Linux work, but this is beyond me!

Although the present plugin duplicates data available elsewhere I hope that any future enhancements of the API will offer more functionality.

Mike
__________________

Rasbats is online now   Reply With Quote
Old 10-02-2019, 08:18   #2
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,747
Re: UKTides_pi using the UKHO API

Mike...
What exactly were the problems you saw? The chartdownloader plugin is using HTTP GET to download all the charts and we have never heard about it being problematic. I would definitely prefer all the plugins using the centralised HTTP support provided by the OpenCPN core over million copies of cURL all over the place...

Pavel
__________________

nohal is offline   Reply With Quote
Old 10-02-2019, 08:29   #3
Registered User

Join Date: May 2012
Posts: 533
Re: UKTides_pi using the UKHO API

Pavel ...

Probably my lack of skill! I will have look at ChartDownloader and see if it helps.

Mike
Rasbats is online now   Reply With Quote
Old 10-02-2019, 10:23   #4
Registered User

Join Date: May 2012
Posts: 533
Re: UKTides_pi using the UKHO API

Pavel ...

Reminded myself what the problem was, using ofc_pi as a template.

This is the response from wxCurl:

Code:
<FeatureCollection xmlns:i="http://www.w3.org/2001/XMLSchema-instance"xmlns="http://schemas.datacontract.org/2004/07/GeoJSON.Net.Feature">
<BoundingBoxes xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/GeoJSON.Net" />
<CRS i:nil="true" xmlns="http://schemas.datacontract.org/2004/07/GeoJSON.Net" />
</FeatureCollection>
This is the same response that comes from FireFox. But ... MS Internet Explorer does retrieve the file of tidal stations! For this reason I left wxCurl and went straight to curl/curlcpp. Could the way that the API/UKHO server is setup be the cause of this?

Simple json comes through but not when it includes a FeatureCollection.

Mike
Rasbats is online now   Reply With Quote
Old 10-02-2019, 14:38   #5
Registered User

Join Date: Feb 2010
Location: On the go. Not in Prague.
Posts: 4,747
Re: UKTides_pi using the UKHO API

Mike...

This is obviously not JSON but XML, so I would kind of suspect a misconfiguration on the server side here if JSON was the actual expected answer... May I ask for the URL you are querying?

Pavel
nohal is offline   Reply With Quote
Old 11-02-2019, 09:05   #6
Registered User

Join Date: May 2012
Posts: 533
Re: UKTides_pi using the UKHO API

Pavel ...

I have sent you a PM.

Mike
Rasbats is online now   Reply With Quote
Old 11-02-2019, 09:08   #7
Registered User

Join Date: Jan 2018
Location: Dunkirk, France
Boat: Fisher 34
Posts: 50
Images: 3
Re: UKTides_pi using the UKHO API

Hello,

I recently installed the version 4.99.1408 in parallel with version 4.88.

I then installed your UKtides plugin specifying the installation path.

However the plugin did not install naturally but created a new OpenCPN folder in which is just this plugin.
So I copied / pasted the plugin data into the original plugins folder and it works fine, thanks ...

This detail should be made clear to everyone who installed OCN 4.99 in parallel with the 4.88 version.
Attached Thumbnails
Click image for larger version

Name:	OCN4.99.jpg
Views:	17
Size:	149.3 KB
ID:	185665  
Schnapsy is offline   Reply With Quote
Old 11-02-2019, 10:05   #8
Registered User

Join Date: May 2012
Posts: 533
Re: UKTides_pi using the UKHO API

Thanks Schnapsy.

Yes, the installer adds "OpenCPN" onto the file path when you use the browse option. I normally use the spacebar to add a space after the basic version, which gives me a list of the OpenCPN versions that are installed. Install works correctly after that. No OpenCPN is then added after the root folder.

I think you would find the same problem with other plugins when doing a parallel installation. Logbookkonni had the same problem for me when tested.

Not sure if the installer could be adjusted for this but I will try and include a note in the manual for my plugins.


Mike
Rasbats is online now   Reply With Quote
Old 11-02-2019, 10:42   #9
bcn
Registered User

Join Date: May 2011
Location: underway whenever possible
Boat: Rangeboat 39
Posts: 3,188
Re: UKTides_pi using the UKHO API

In the case of a parallel install under Windows one has always to select the target version.
By default the programs\opencpn directory will be used.
If you have only one version it will live in this directory (if one does not force a different name).

And the way to place the cursor in the selector dropdown list when asked for the install directory and adding "space" will show all parallel installs. Works for almost(?) all plug-ins under Windows.
bcn is online now   Reply With Quote
Old 12-02-2019, 10:56   #10
Registered User

Join Date: May 2012
Posts: 533
Re: UKTides_pi using the UKHO API

Version 0.2 now uses OpenCPN base code for curl, via the API.
TODO: Compile with Linux.

Mike
__________________

Rasbats is online now   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
2016 Edition UKHO For Navigation Charts (Windows) Ribbit OpenCPN 1 09-02-2016 05:53
Technical: API to query heading(s)? bushtor OpenCPN 4 03-06-2013 08:38
Plugin api coding rooiedirk OpenCPN 6 03-04-2013 09:49
UKHO's Total Tides Software Chantal Navigation 11 30-10-2011 12:15



Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -7. The time now is 04:50.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2019, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.