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

Fix NDBC geometry parsing #30

Open
mwengren opened this issue Aug 27, 2018 · 2 comments
Open

Fix NDBC geometry parsing #30

mwengren opened this issue Aug 27, 2018 · 2 comments

Comments

@mwengren
Copy link
Member

Per ioos/catalog#69: sensorml2iso needs to be updated to properly parse all types of NDBC SOS geometries in DescribeSensor responses.

NDBC SOS documentation: https://sdf.ndbc.noaa.gov/sos/

@emiliom
Copy link
Contributor

emiliom commented Aug 27, 2018

Just a clarification that at this time it doesn't appear to be certain that a solution will be found with sensorml2iso alone. There are one or two options in the DescribeSensor and GetCapabilities responses that should be explored (while crossing fingers), but it may well be that both are equally plagued by the spatial coordinate errors described in ioos/catalog#69

@mwengren
Copy link
Member Author

Just copying over info from the IOOS Catalog issue that spawned this one:

When I was working on this module originally, I made a list of issues to follow up on (mostly wrt NDBC) after the first Catalog version came out, that at a minimum had a record for every provider's stations.
This is what I have in my notes for NDBC issues, so I found this as well back then:

  • NaN Geographic extent values passed from SensorML

Here's the code in sensorml2iso that parses lat/lon values: https://github.com/ioos/sensorml2iso/blob/master/sensorml2iso/sensorml2iso.py#L289-L298. There's already some special handling for NDBC since they use a different approach than 52N.

But, if I had to guess NDBC's SOS includes some DescribeSensor responses that don't include numbers in the locations we're expecting. Here's an example to show their formatting for most stations:

    <sml:location>
        <gml:Point gml:id="stationLocation51028" srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
          <gml:coordinates>0 -153.913</gml:coordinates>
        </gml:Point>
      </sml:location>

At the moment, RPS runs a process to generate NDBC's SOS metadata for them. We've reached out to them in the past about running sensorml2iso themselves and managing their own waf, but I don't know if it's on a roadmap for this FY or not.

I looked at some examples of the NaN errors in the Harvest Registry, and tracking down the corresponding DescribeSensor request for one, it looks like the position info is encoded in varying ways. We just haven't accommodated for the different possibilities.

		<!-- Station Location -->
		<sml:positions>
			<sml:PositionList>
				<sml:position name="stationPosition">
					<swe:Position>
					<swe:location>
						<swe:Vector gml:id="stationLocation" definition="urn:ogc:def:property:OGC:location">
							<swe:coordinate name="latitude">
								<swe:Quantity axisID="Y">
									<swe:uom code="deg"/>
									<swe:value>48.04000</swe:value>
								</swe:Quantity>
							</swe:coordinate>
								<swe:coordinate name="longitude">
								<swe:Quantity axisID="X">
									<swe:uom code="deg"/>
									<swe:value>163.49001</swe:value>
								</swe:Quantity>
							</swe:coordinate>
							<swe:coordinate name="altitude">
								<swe:Quantity axisID="Z">
									<swe:uom code="m"/>
									<swe:value>0</swe:value>
								</swe:Quantity>
							</swe:coordinate>
						</swe:Vector>
					</swe:location>
					</swe:Position>
				</sml:position>
				<sml:position name="bprPosition">
					<swe:Position>
					<swe:location>
						<swe:Vector gml:id="bprLocation" definition="urn:ogc:def:property:OGC:location">
							<swe:coordinate name="latitude">
								<swe:Quantity axisID="Y">
									<swe:uom code="deg"/>
									<swe:value>48.12167</swe:value>
								</swe:Quantity>
							</swe:coordinate>
								<swe:coordinate name="longitude">
								<swe:Quantity axisID="X">
									<swe:uom code="deg"/>
									<swe:value>163.32834</swe:value>
								</swe:Quantity>
							</swe:coordinate>
							<swe:coordinate name="altitude">
								<swe:Quantity axisID="Z">
									<swe:uom code="m"/>
									<swe:value>-5788.6</swe:value>
								</swe:Quantity>
							</swe:coordinate>
						</swe:Vector>
					</swe:location>
					</swe:Position>
				</sml:position>
			</sml:PositionList>
		</sml:positions>

So, seems like we either go through and try to find each variation and account for it, or perhaps we can get in contact with someone at NDBC who knows this service well enough to describe the different possibilities. They describe some here: https://sdf.ndbc.noaa.gov/sos/.

If anyone wants to tackle any of this, have at it..... I won't be able to get into it for awhile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants