![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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/1.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/2.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/3.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/4.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/5.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/6.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/7.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/8.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/9.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/10.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/11.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/12.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/13.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/14.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/15.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/16.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/17.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/18.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/19.jpg)
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](https://reader033.vdocument.in/reader033/viewer/2022052001/60143c713f1093078603b3bc/html5/thumbnails/20.jpg)
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