Install, build and debug a react native app in WSL2 (Windows Subsystem for Linux) and Ubuntu.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
''' | |
get-winds.py | |
- get the latest data from nomads.ncep.noaa.gov unless we have it already | |
- generate file /maps/wms/data/windy.json | |
- generate windy.latest file with time stamp | |
''' |
There are a bunch of reasons why this is convoluted, mostly in building the URL to make the request:
- You have to rely on an AJAX request, this example uses jQuery
- To make a GetFeatureInfo request, you must provide a BBOX for a image, and the pixel coordinates for the part of the image that you want info from. A couple of squirrely lines of Leaflet code can give you that.
- Output formats. The
info_format
parameter in the request. We don't know a priori which will be supported by a WMS that we might make a request to. See Geoserver's docs for what formats are available from Geoserver. That won't be the same from WMS to WMS, however. - WMS services return XML docs when there's a mistake in the request or in processing. This sends an HTTP 200, which jQuery doesn't think is an error.