Recent posts

#91
New Features in CanalPlan / Refueling
Last post by Stephen Atty - Jan 20, 2024, 08:16 PM
Diesel is usually found at boatyards.

We don't mark fuel supplies separately.
#92
New Features in CanalPlan / Refueling
Last post by Mel - Jan 20, 2024, 07:44 PM
I can't find any P or D refuelling symbols on my routes. It would be useful to have these indicated.
#94
Canalplan Site issues / Adding mooring locations to Fr...
Last post by Adrk - Jan 17, 2024, 06:08 PM
How do I add the Halte Fluvial de Moret, which is marked on the background map but is not available in the way point/gazetteer menu.
Likewise Samois sur Seine?
#95
Canalplan Site issues / API to calculate the number of...
Last post by Stephen Atty - Nov 29, 2023, 08:02 PM
That's a good question - I think this needs nick. I think it may well be a JSON structure you need to pass in
#96
Canalplan Site issues / API to calculate the number of...
Last post by Aegidian - Nov 29, 2023, 08:15 AM
I'm futzing around in PHP trying to get the 'mode=plan' section of the API to return a route that will accept exclusions (particularly the Tidal Severn, waterway id: mc07.)

I've been digging around and for some reason recall that you can specify pref=options when building the API call, however I can't seem to stumble on the right format for 'options'.

I've tried sending plaintext pref = 'optcheck_wex_mc07', and pref 'wex_mc07' and an associated array of values pref = { optcheck_wex_mc07 : true }

// fetch POST routine
//
// exclude optcheck_wex_m0c7 - Tidal River Severn
//
$url = 'https://canalplan.uk/cgi-bin/api.cgi';
$opts = ['optcheck_wex_m0c7' => true];
$opts = 'optcheck_wex_m0c7';
$opts = ['wex' => 'm0c7'];
$opts = 'wex_mc07';
//$opts = '';
$data = ['mode' => 'plan', 'start' => $place1['id'], 'end' => $place2['id'] , 'pref' => $opts];

var_dump($data);

// use key 'http' even if you send the request to https://...
$options = [
'http' => [
'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",
'method' => 'POST',
'content' => http_build_query($data),
],
];

$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);


var_dump($result);

How should I be building this part of the query?
#97
New Features in CanalPlan / Locks & reporting
Last post by David Johns - Sep 02, 2023, 12:03 AM
Thanks Stephen, I have done that. One other thing if I may. I totally understand cumulative details but I cannot see any use and don't understand the 'link' items, such as link distances and link times. Is there somewhere that explains this?
#98
New Features in CanalPlan / Locks & reporting
Last post by Stephen Atty - Sep 01, 2023, 08:00 PM
OK so that's a change to the export route functionality - raise it as a feature request via the bugtrracker as leaving it just here as a discussion means it's likely to get lost.
#99
New Features in CanalPlan / Locks & reporting
Last post by David Johns - Sep 01, 2023, 03:39 PM
Hi,
What I really want is the rise or fall of a lock in the export of a planned route. Obviously depending on which way I am travelling it will be a rise or a fall. I wouldn't have thought this would be difficult to implement with a planned route and we should know whether the locks are going up or down.
All I was going to do was look up the lock location by the id 4 letter code and get the rise/fall from the page. The trouble here is that we don't know whether the lock is going up or coming down.  A vast majority of the lock rise/fall data is there and there aren't many that are unknowns. I wouldn't have thought a simple scrape would get me blocked or banned as it would appear someone is browsing the page.
If it is still a problem for you, then could you perhaps be willing to provide the rise/fall data to me in a csv file, or at least point me in the direction of where I could obtain it.
Regards
David Johns
#100
New Features in CanalPlan / Locks & reporting
Last post by Stephen Atty - Sep 01, 2023, 12:35 PM
Please do not scrape the website as this might get picked up by our abuse monitors and get you blacklisted - best thing to do is raise this a a feature request in the bugtracker and the data can be added to the report.

If there are locks that have the data missing then I guess we need to add that to the \"Help Us\" page

I'm not sure what you mean by \"Something that might be helpful is the icon that denotes a lock in the information. Currently it always 'points' up whether the lock is rising or decending.\"  Can you show us an example - again it can be attached to the bug ticket.