simple geometries in netcdfcfconventions.org/meetings/2017-workshop/2_3_simplegeometries.… · has...

20
Tim Whiteaker – The University of Texas at Austin 2017 Advancing NetCDF Workshop Boulder, CO Simple Geometries in NetCDF NSF Award #1541031 - EarthCube IA: Advancing netCDF-CF for the Geoscience Community Slide template courtesy of ALLPPT.com

Upload: others

Post on 27-Sep-2020

3 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

Tim Whiteaker – The University of Texas at Austin2017 Advancing NetCDF WorkshopBoulder, CO

Simple Geometries in NetCDF

NSF Award #1541031 - EarthCube IA: Advancing netCDF-CF for the Geoscience Community Slide template courtesy of ALLPPT.com

Page 2: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

Motivation

Page 3: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

Geometry TypesIncluded Not Included

https://en.wikipedia.org/wiki/Well-known_text

Page 4: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

Geometry TypesIncluded Compatible With

• Well-known Text geometry primitives

• OGC Simple Features• GeoJSON• Shapefile• Various geospatial

databases

https://en.wikipedia.org/wiki/Well-known_text

Page 5: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

Some examples

Two locations where temperature is measured:

(0, 0) – at equator

(0, 90) – at north pole

Page 6: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

How it works -- a point example

NetCDF Filetime

lon

lat

temperaturegeometry =

geometry_container

geometry_containergeometry_type

node_coordinates

x

y= point= x y

Legend

Old Stuff

Geometry Stuff

0, 0

0, 90

Page 7: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

Two Line Features

A

B

Page 8: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

How to deal with different node counts

A

B Feature A Feature B

a1 b1

a2 b2

a3

a4

a5

X Variable (2 by 5 array)

This is inefficient

a1 a5

b1b2

a2

a3

a4

Page 9: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

Contiguous Ragged Arrays

X

a1

a2

a3

a4

a5

b1

b2

Node Count

5

2

Values Counts

A

B

a1 a5

b1b2

a2

a3

a4

Page 10: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

Line example

NetCDF Filetime

lon

lat

temperaturegeometry =

geometry_container

x

y

node_count

geometry_containergeometry_type

node_coordinatesnode_count

= line= x y= node_count

5, 2

0, 1, 2, 3, 4, 0, 2

2, 3, 1, 3, 2, 8, 7

Page 11: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

Two Multilines

A

B two parts

one part

Page 12: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

Multiline example

NetCDF Filetime

lon

lat

temperaturegeometry =

geometry_container

x

y

node_count part_node_count

geometry_containergeometry_type

node_coordinatesnode_count

part_node_count

= multiline= x y= node_count= part_node_count

5, 2, 25, 4

Page 13: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

A Polygon

The hole is actually a second part to the polygon

exterior ring(part #1)

interior ring(part #2)

Page 14: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

Polygon example (with holes)

NetCDF Filetime

lon

lat

temperaturegeometry =

geometry_container

x

y

node_count part_node_count

interior_ring(yes or no)

geometry_containergeometry_type

node_coordinatesnode_count

part_node_countinterior_ring

= polygon= x y= node_count= part_node_count= interior_ring

0, 1

Page 15: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

Wouldn’t it be cool if this was in the

CF Conventions

Page 16: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

Timeline for Getting into CF (1.8)

May, 2016 September February, 2017 April June August

GitHub repo forsimple geomsin netCDF

Has wiki andPython example

Uses coordinateindex like UGRID

A second repofor R also created

Request for feedbacksent to CF-Metadatamailing list

AGU poster

Proposal sent toCF-Metadatamailing list

Major revisions inour GitHub repobased on feedback

Dropped coordinateindex variable

Pull request tocf-conventions onGitHub

Chapter 7 - cells

EC All-hands poster

2nd pull requestto accommodateGitHub workflow

Each sentenceon its own line

trac ticket#164

https://github.com/cf-convention/cf-conventions/pull/115

Page 17: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

Next Steps

Persevere Update Explore

tracNetCDFEnhanced

Limbo screenshot from Jesse Radonski on Flickr; GitHub images courtesy of GitHub

Page 18: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

Geometry and the Enhanced Data Model

• VLEN• Eliminates need for contiguous ragged arrays • Eliminates node count variable

• Groups• Could store each feature in its own group• Could store parts as VLENs, eliminating node counts and part node

counts

{0,1,2,3,4},{0,2}

{2,3,1,3,2},{8,7}

x

y

Page 19: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

Acknowledgments

Dave BlodgettBen Koziol

Bob SimonsMark Hedley

Bert Jagers

CF Community

Jonathan GregoryDavid Hassell

Gray Beal Martin Juckes

Chris Little

Page 20: Simple Geometries in NetCDFcfconventions.org/Meetings/2017-workshop/2_3_SimpleGeometries.… · Has wiki and Python example Uses coordinate index like UGRID A second repo for R also

Want To Contribute?

• Wiki and Python implementationhttps://github.com/twhiteaker/netCDF-CF-simple-geometry

• R implementationhttps://github.com/dblodgett-usgs/NCDFSG

• Pull request to cf-conventionshttps://github.com/cf-convention/cf-conventions/pull/115

[email protected]