Más contenido relacionado La actualidad más candente (20) Similar a GeoPackage, Context and POI (and a sprinkle of GeoJSON) (20) GeoPackage, Context and POI (and a sprinkle of GeoJSON)1. ®
®
copyright © 2014 Open Geospatial Consortium
GeoPackage, Context and POI, oh my!
(and a sprinkle of GeoJSON)
new universal geodata formats
Raj Singh, PhD
Open Geospatial Consortium
rsingh@myogc.org
2. OGC
®
copyright © 2014 Open Geospatial Consortium
Why this presentation?
• Good time to survey the field of generic formats
• Great new options for sharing geodata
– GeoPackage: great balance of simplicity and performance
– POI: strong focus on hyperlinks/web connectedness
– GeoJSON: only JSON game in town
• So let’s get started…
4. OGC
®
copyright © 2014 Open Geospatial Consortium
Why GeoPackage?
Shapefiles, as a format, are dinosaurs
web services don’t work without internet access
internet sucks power from a mobile device
5. OGC
®
copyright © 2014 Open Geospatial Consortium
Overview
• A GeoPackage is a platform-independent SQLite database file
• A GeoPackage may contain
– Data in any geographic or projected CRS using any Datum
– Vector Feature User Data Tables
• GP BLOB Geometry Binary Format containing WKB Geometries
• Linear 2D Geometries with optional elevation and measure values
– Tile Matrix Pyramid User Data Tables
• PNG and JPEG Tiles
• Zoom times two (adjacent zoom level pixel sizes)
• First open source implementation
– https://bitbucket.org/luciad/libgpkg
– A SQLite 3 extension that provides a minimal implementation
– distributed under the Apache Software License version 2.0
6. OGC
®
copyright © 2014 Open Geospatial Consortium
GeoPackage Tables for Features
• defines spatial reference systems
gpkg_spatial_ref_sys
• identifies user data tables
gpkg_contents
• ids feature geometries
gpkg_geometry_columns
• contain feature data
user_data_feature_tables
7. OGC
®
copyright © 2014 Open Geospatial Consortium
GeoPackage Tables for Tiles
• defines spatial reference systems
gpkg_spatial_ref_sys
• identifies user data tables
gpkg_contents
• tile pyramid envelope
gpkg_tile_matrix_set
• describes tile zoom levels
gpkg_tile_matrix
• contain tile pyramids
user_data_tiles_tables
8. OGC
®
copyright © 2014 Open Geospatial Consortium
SQLite command line example
• rajsingh$ gpkg World.gpkg
SQLite version 3.8.1 2013-10-17 12:57:35
libgpkg version 0.9.7
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
• GeoPackage> .tables
gpkg_contents gpkg_tile_matrix_metadata
gpkg_data_columns rtree_world_shape
gpkg_extensions rtree_world_shape_node
gpkg_geometry_columns rtree_world_shape_parent
gpkg_metadata rtree_world_shape_rowid
gpkg_metadata_reference world
gpkg_spatial_ref_sys
• GeoPackage> .schema world
CREATE TABLE "world" ( "COUNTRY" TEXT, "CAPITAL" TEXT, "POP_1994" INT, "POP_GRW_RT" DOUBLE, "POP_MALE"
INT, "POP_FEM" INT, "POP_0_14" INT, "POP_15_64" INT, "POP_65PLUS" INT, "MALE_0_14" INT, "MALE_15_64"
INT, "65PLUS" INT, "FEM_0_14" INT, "FEM_15_64" INT, "FEM_65PLUS" INT, "POP_URBAN" INT, "POP_RURAL"
INT, "URB_MALE" INT, "URB_FEM" INT, "RUR_MALE" INT, "RUR_FEM" INT, "ARABLE_PCT" DOUBLE, "LITERACY"
DOUBLE, "RATE" DOUBLE, "RATE0" DOUBLE, "GROWTH" DOUBLE, "CONTINENT" TEXT, "_id" INTEGER PRIMARY KEY
AUTOINCREMENT , "shape" GeometryCollection);
• GeoPackage> select country,capital from world limit 3;
Afghanistan|Kabul
Albania|Tirane
Algeria|Algiers
9. OGC
®
copyright © 2014 Open Geospatial Consortium
Luciad GeoPackage use cases
OGC OWS-9 Aviation
Spot reporting with
location and camera
picture info
Access elevation
data to enable
visibility calculations
Create and edit
annotations in the field
11. OGC
®
copyright © 2014 Open Geospatial Consortium
Sharing a map
Multiple
overlaid
maps
Borders
Elevation Cloud Cover
Cities
13. OGC
®
copyright © 2014 Open Geospatial Consortium
Anatomy of a Context document
• A context document extends the Atom XML
format (or in the future JSON).
• It contains Atom <entries> which have
OGC <offering>s.
• Offerings are data sources. They may be
either services (and particularly OGC
services like WMS, WFS, WMTS and
WCS) or file-based data sets, like GML,
KML and PDF.
• File-based data sets may be specified by
reference with a URL, or included inline.
• OGC service offerings contain a
GetCapabilites request and a request to get
data, such as GetMap, GetTiles,
GetFeature, etc.
• Offerings do not have to be spatial, so
clients implementing Context should handle
non-spatial offerings in a way other than
mapping them.
14. OGC
®
copyright © 2014 Open Geospatial Consortium
Use Cases to date…
• Common Operating Picture
• Describing contents of a GeoPackage
• Describing a GeoPackaging WPS request
• Imagery annotation
16. OGC
®
copyright © 2014 Open Geospatial Consortium
POI work advances on 2 fronts
• Points of Interest Standards Working Group
– just chartered
– seeks to ratify POI data encoding standards for XML and JSON
– picks up dormant W3C work
– all work is public at https://github.com/opengeospatial/poi
• OpenPOIs registry
– an implementation of the POI draft standard
– living laboratory to experiment with
• linked geodata
• persistent services
• distributed geosynchronization
17. OGC
®
copyright © 2014 Open Geospatial Consortium
What is OpenPOIs?
A registry of all the places in the world,
and links to all of their web resources
18. OGC
®
copyright © 2014 Open Geospatial Consortium
What is OpenPOIs?
APIs to get the
information as maps,
XML, JSON, or RDF
http://openpois.net
19. OGC
®
copyright © 2014 Open Geospatial Consortium
the Open-ness in OpenPOIs
• open data: only POI repositories with compatible open
data policies have been indexed by OpenPOIs
• open API: anyone is free to use the read API, and a write
API is being built for any authenticated user to freely add
information
• open code: built on PostGIS, Mapserver and custom PHP.
20. OGC
®
copyright © 2014 Open Geospatial Consortium
the OpenPOIs database
• reference implementation of the POI format
• free and open, always
• provides a Rosetta Stone for all POIs, any time,
anywhere
• includes
– OpenStreetMap
– NGA, USGS, GeoNames
– dbPedia
– China Historical GIS
– Futouring
• future work
– freebase, governments, historians
– self-service synchronization
21. OGC
®
copyright © 2014 Open Geospatial Consortium
Descriptive Properties
• location: geography specifier
• label: name
• description: narrative text
• category: tags, keywords, etc.
• link: related items
• time: when the POI exists in the world
22. OGC
®
copyright © 2014 Open Geospatial Consortium
Location Properties
• point,
line,
or polygon
• GML 3.3 ―compact encoding‖ -- simple!
• coordinate reference system (with lat/lon default)
• and/or address
• and/or spatial relationship to another POI
<Point>
<posList>42.358 -71.06</posList>
</Point>
<LineString>
<posList>42.358 -71.06 42.375 -71.093...</posList>
</LineString>
<SimplePolygon>
<posList>42.358 -71.06 42.375 -71.093...</posList>
</SimplePolygon>
23. OGC
®
copyright © 2014 Open Geospatial Consortium
Descriptive Property: category
<category term="722110" scheme="http://www.census.gov/naics/2007/" type="text/html"
href="http://www.census.gov/econ/industry/def/d722110.htm">Full-service restaurants</category>
<category term="rating:food" scheme="http://www.example.com/category/ratings"
href="http://www.example.com/ratings/food#extraordinary_to_perfection">27</category>
<category term="cuisine" scheme="http://www.example.com/category/cuisines"
href="http://www.example.com/ratings/cuisines">Deli</category>
• category
• term: the unique identifier – aka tag (mandatory)
• scheme: URI identifier for the term’s definition. may be resolvable
(optional)
• value: human-readable description (optional)
• href: URL to full definition. always resolvable (optional)
• type: MIME type of the href (optional)
• XML examples:
24. OGC
®
copyright © 2014 Open Geospatial Consortium
Descriptive Property: link
• link
• term: relationship of link to the POI (mandatory)
• href: URL for linked content (mandatory)
• type: MIME type of href (mandatory)
• value: human-readable description (optional)
• author: basic attribution (optional)
• XML examples:
<link term="related" href="http://en.wikipedia.org/wiki/Faneuil_Hall" type="text/html"/>
<link term="related" href="http://www.cityofboston.gov/freedomtrail/faneuilhall.asp"
type="text/html"/>
<link term="related" href="http://www.thefreedomtrail.org/visitor/faneuil-hall.html"
type="text/html"/>
<link term="related" href="http://www.faneuilhallmarketplace.com/" type="text/html"/>
<link term="image‖
href="http://www.cityofboston.gov/Images_Documents/Bright_Fan_Hall_tcm3-2661.gif"
type="image/gif"/>
<link term="related" href="http://hdl.loc.gov/loc.award/mhsalad.130006">
<value>Faneuil Hall, exterior: perspective view, Boston, MA</value>
<author term="LOC" href="http://www.loc.gov" type="text/plain">
<value>Library of Congress</value>
</author>
</link>
25. OGC
®
copyright © 2014 Open Geospatial Consortium
Data Management Properties (metadata)
• id: unique identifier for the POI in the publisher’s system
• created/updated/deleted: applies to the POI record (not the
actual place in the world—time property covers that)
• license: use restrictions, e.g. copyright
26. OGC
®
copyright © 2014 Open Geospatial Consortium
Basic Example: City of Boston, MA USA
<poi id="http://www.rajsingh.org/pois/45343489" created="2004-01-22T09:38:21-05:00‖>
<author href="http://www.rajsingh.org/me.rdf" type="application/rdf+xml"/>
<license href="http://creativecommons.org/licenses/by/3.0/" type="text/html" term="CC BY 3.0"/>
<label term=‖primary‖>Boston</label>
<description updated="2011-10-21T22:10:00+12:00">
<value>Boston is the capital of and largest city in Massachusetts, and is one of the oldest
cities in the United States. Boston is regarded as the unofficial "Capital of New England"
for its economic and cultural impact on the entire New England region.</value>
<author id="http://en.wikipedia.org" href="http://en.wikipedia.org/wiki/Boston" type="text/plain">
<value>Wikipedia</value>
</author>
</description>
<category term="city" scheme="http://www.usgs.gov/placetypes"type="text/html‖>
<value>seat of a first-order administrative division</value>
</category>
<time term="start" type="text/datetime‖>16300917</time>
<link term="canonical" href="http://www.rajsingh.org/pois/45343489.xml"
scheme="http://www.iana.org/assignments/link-relations/link-relations.xml" type="text/xml"/>
<link term="related" href="http://en.wikipedia.org/wiki/Boston" type="text/html"
scheme="http://www.iana.org/assignments/link-relations/link-relations.xml"/>
<link term=‖map" href="http://www.geonames.org/maps/google_42.358_-71.06.html" type="text/html"
scheme="http://www.iana.org/assignments/link-relations/link-relations.xml"/>
<location>
<point term="centroid">
<Point srsName="http://www.opengis.net/def/crs/EPSG/0/4326">
<posList>42.358 -71.06</posList>
</Point>
</point>
</location>
</poi>
27. OGC
®
copyright © 2014 Open Geospatial Consortium
OpenPOIs API
query by… example…
ID http://openpois.net/poiquery.php?id=f0aa9f2f-c091-4dc2-9282-3a5dbbec8314
RESTful ID http://openpois.net/pois/f0aa9f2f-c091-4dc2-9282-3a5dbbec8314
radius/point http://openpois.net/poiquery.php?lat=42.349433712876&lon=-
71.040894451933&maxfeatures=9&format=application/xml
bounding box http://openpois.net/poiquery.php?bbox=-71.10,42.35,-
71.00,42.45&maxfeatures=20&format=application/json
Time and
area
http://openpois.net/poiquery.php?lat=25.959&lon=119.519&maxfeatures=1&format=xml&ra
dius=1000&start=944
WFS http://openpois.net/openpoiwfs?request=GetCapabilities&service=WFS&version=1.1.0
http://openpois.net/api.php
28. OGC
®
copyright © 2014 Open Geospatial Consortium
impacts
• more geospatial open data
• domains that benefit from an open POI db
– disaster management
– public health
– resource management
– climate science
• Better geospatial standards in
– "RESTful" APIs
– RDF, linked data and the Semantic Web
29. OGC
®
copyright © 2014 Open Geospatial Consortium
What should you do with the POI format?
1. have unique IDs for all your POIs
2. provide a public URL:
• to get at every POI in W3C POI format
• at least an ID and name please
3. adopt the link part of the data model
• to maintain references to related POIs
• add links to that public POI URL
4. be part of OpenPOI DB
• work with me to link and sync to your POIs!
31. OGC
®
copyright © 2014 Open Geospatial Consortium
Why GeoJSON?
• only well-defined generic JSON model for geodata
• a lot like GML Simple Features
• Not and OGC standard, but strong OGC member interest
• lots of uptake
32. OGC
®
copyright © 2014 Open Geospatial Consortium
GeoJSON example
{
"type":"Feature",
"properties": {
"id":"aabbaa",
"name":"Ark"
},
"geometry": {
"type":"Polygon",
"coordinates":[
[ [76.078122854233,30.96094250679],[41.624997854233,34.47656750679],[52.874997854233,33.07031750679],
[63.421872854233,40.10156750679],[76.078122854233,30.96094250679] ]
]
},
"crs": {
"type":"name",
"properties": { "name":"urn:ogc:def:crs:OGC:1.3:CRS84" }
}
}
33. OGC
®
copyright © 2014 Open Geospatial Consortium
Where is GeoJSON in OGC?
• being ―murmered about‖
• tried out as a lightweight exchange format in Testbed 10
geosynchronization experiment
34. OGC
®
copyright © 2014 Open Geospatial Consortium
References & Contacts
• GeoPackage
– http://geopackage.org
• OWS Context
– https://github.com/opengeospatial/owc-swg (private for now)
– http://owscontext.org (coming soon)
• POIs
– OpenPOIs Repository http://openpois.net
– OGC POI Standards Working Group:
http://www.opengeospatial.org/projects/groups/poiswg
• GeoJSON
– http://www.geojson.org/geojson-spec.html
Notas del editor Registered Extensions NonLinear 2D GeometriesGP BLOB Extension for User-Defined Geometry TypesSpatial IndexesSQL Triggers using Geomety SQL API functions, Other TriggersWebP TilesZoom any intervals A registry of all the places in the world, and links to all of their web resources(a different kind of geo-data catalog)APIs to get the information as maps, XML, JSON, or RDFA location resource that’s always current, accurate, and authoritativeOpenPOIs will evolve into the single most comprehensive, structured registry of points of interest on the Web. A registry of all the places in the world, and links to all of their web resources(a different kind of geo-data catalog)APIs to get the information as maps, XML, JSON, or RDFA location resource that’s always current, accurate, and authoritativeOpenPOIs will evolve into the single most comprehensive, structured registry of points of interest on the Web. OpenPOIs embodies three facets of openness. First, the data set is open. Only POI repositories with compatible open data policies have been indexed by OpenPOIs. Second, the API is open. Anyone is free to use the read API, and a write API is being built for any authenticated user to freely add information. Thirdly, the code is open. The system is built on PostGIS, Mapserver and custom PHP. Like OGC standards, OpenPOIs is part of the public Internet infrastructure. OGC standards and OpenPOIs are platform, vendor and data neutral. The OGC's vision and mission, experience with legal and organizational issues involved in "openness", and rich connections to the world's providers and users of geospatial data and technology put the Consortium in a unique position to launch and host this resource.The potential societal benefits are broad and deep. Linked POI registries will support disaster management, public health, resource management, science, and more. Better geospatial standards are another benefit of this project. Current growth areas in Web-based computing are "RESTful" programming, linked data and the Semantic Web. OpenPOIs is designed to accommodate and leverage these developments. The Web and Semantic Web provide tools with which the POI vision can be achieved, and OpenPOIs provides the data. Existing OGC Web Services (OWS) standards have just begun to evolve to track these developments, and experience gained with the OpenPOIs Registry will help move the standards forward. GeoJSON always consists of a single object. This object (referred to as the GeoJSON object below) represents a geometry, feature, or collection of features.The GeoJSON object may have any number of members (name/value pairs).The GeoJSON object must have a member with the name "type". This member's value is a string that determines the type of the GeoJSON object.The value of the type member must be one of: "Point", "MultiPoint", "LineString", "MultiLineString", "Polygon", "MultiPolygon", "GeometryCollection", "Feature", or "FeatureCollection". The case of the type member values must be as shown here.A GeoJSON object may have an optional "crs" member, the value of which must be a coordinate reference system object (see 3. Coordinate Reference System Objects).A GeoJSON object may have a "bbox" member, the value of which must be a bounding box array (see 4. Bounding Boxes).