Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🎉 Fetching server dates #32

Merged
merged 14 commits into from
May 9, 2020
Merged

🎉 Fetching server dates #32

merged 14 commits into from
May 9, 2020

Conversation

mamadOuologuem
Copy link
Contributor

@mamadOuologuem mamadOuologuem commented Apr 28, 2020

What is done

  • Fetching availableDates from the specified servers in src/config/prism.json

Notes

@ericboucher
Copy link
Collaborator

Access to fetch at 'mng-wfp.ovio.org:8443/geoserver/prism/wms?request=GetCapabilities' from origin 'http://localhost:3000' has been blocked by CORS policy

I think that's because the server is down atm... Will check on it

@ericboucher
Copy link
Collaborator

The layers returned by the server are squared. We may investigate if we can make then fit on the country boundaries.

This is fine for now and probably part of the how tilling works in the data cube

@@ -1,5 +1,9 @@
{
"country": "Mongolia",
"serversUrls": {
"wcs": ["http://185.30.8.6:5000"],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So technically in Mongolia we have 2 servers with base URLS:

geoserver: https://mng-wfp.ovio.org:8443/geoserver/prism/
openDataCube: http://185.30.8.6:5000/

They can both return WMS & WCS layers using /wms?... or /wcs?... . The difference is that they don't return GetCapabilities the same way for WMS, which is why the python function I shared with you was a bit convoluted.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will be using geoserver only for WMS though and openDataCube for both.
I think we should restructure the layers in layers.json to take:

  • server_id instead of the server_uri
  • server_type
  • server_layer
  • server_style (optional)

So that we can build URLs like this one programmatically -> http://185.30.8.6:5000/wms?styles=ndvi&layers=ModisIndices

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts @bencpeters ?

@ericboucher ericboucher added this to In progress in PRISM Frontend via automation Apr 29, 2020
@ericboucher
Copy link
Collaborator

@mamadOuologuem mng-wfp.ovio.org should be back up

@ericboucher
Copy link
Collaborator

Let's make sure the top links for About and GitHub look activated:

Screen Shot 2020-05-05 at 2 46 40 PM

src/components/MapView/DateSelector/index.tsx Outdated Show resolved Hide resolved
src/config/types.ts Outdated Show resolved Hide resolved
src/components/MapView/Layers/index.tsx Outdated Show resolved Hide resolved
src/components/MapView/index.tsx Outdated Show resolved Hide resolved
src/context/mapStateSlice.ts Show resolved Hide resolved
src/utils/server-utils.ts Outdated Show resolved Hide resolved
* @returns an object shape like { [layerId]: availableDates }
*/
function formatCapabilitiesInfo(
rawLayers: any,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't really need to explicitly define any types - that's the default. In general, you should try to do stronger typing than any, but if it's not possible (or worth it), you don't need to actually type them as any

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think it's not worth giving a type to rawLayers because it comes from the server and it is formatted as soon as we received it.

Should I turn off the strict mode on tsconfig.json?
The strict mode automatically turn on noImplicitAny
image

I kinda prefer explicit any.

src/utils/server-utils.ts Outdated Show resolved Hide resolved
src/utils/server-utils.ts Outdated Show resolved Hide resolved
src/utils/server-utils.ts Outdated Show resolved Hide resolved
@mamadOuologuem mamadOuologuem changed the title 🎉 (WIP) Fetching server dates 🎉 Fetching server dates May 7, 2020
@ericboucher ericboucher dismissed bencpeters’s stale review May 9, 2020 00:54

Comments have been addressed

@mamadOuologuem mamadOuologuem merged commit 7091cf4 into master May 9, 2020
PRISM Frontend automation moved this from In progress to Done May 9, 2020
@ericboucher ericboucher deleted the wms-get-date branch May 19, 2020 03:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants