You are on page 1of 53

Salvador Bayarri

Consultant, World Bank


sbayarri@gmail.com
 Accessing other SDI services
 Cascading external services manually
 Catalog harvesting through Geonetwork
 Other community mapping initiatives
◦ GeoCommons
◦ Open Street Map
 The true power of SDIs is unleashed when
data and maps can be reused and value
added in other nodes
 GeoNode is ready to reuse services in two
ways:
◦ Add external WMS (maps) to GeoNode maps (also
tiled WMS and ArcGIS Rest services)
◦ Re-publish (cascade) WMS and WFS services in
GeoServer (so they can be used by all users)
 In GeoNode and most geoportals, we can add
layers from main Web map providers, and
also by specifying the URL of external
services (can be other Geonodes)
Go to the Maps section and edit or create a map
Then use the Add Layers tool and select ‘Add a
New Server’
In the next dialog, enter the type and URL of the
server
Now we can add layers from the external server to the
map,
and click ‘Done’ when we are finished
You should now see the layer added in the legend,
and the WMS image overlaid on your map
Some WMS will not be visible at certain scales, at
which they appear grayed out in the legend
 At version 2.0 we can also
add Picasa images,
YouTube videos or GeoRSS
news feeds to a map
 The feeds are displayed as markers that
we can click to get more information
 Some things which we cannot do yet
◦ Directly add WFS, WCS services to a map (but we
can use cascaded WFS)
◦ Displaying cascaded WMS seems to be broken in
this version
◦ Harvesting external CSW metadata catalogs
◦ Searching other Geonode catalogs (Geonode
Federation)
 Exercises:
Create servers and add layers from

http://haitidata.org/geoserver/wms
http://smit.cathalac.org:8080/geoserver/dataframe/
wms
http://nowcoast.noaa.gov/wms/com.esri.wms.Esrima
p/wwa?
 We can directly use external WMS URLs in our
GeoNode Maps by adding the WMS server address,
as we saw earlier

 But if we want all users in our GeoNode to have


access to a default set of external services, we
need to create new stores and layers using the
GeoServer component (again, we need
administrative privileges to do this)
 First, we have to create a new Store (data source) in
GeoServer, of type WMS
 Then we need to create new GeoServer layers for the WMS
layers we want to publish
 After adding the store, we will be automatically prompted to
publish layers, or we can later use the ‘Add a new resource’
link in the Layers page of GeoServer
 After saving the metadata info for the new layer, it
will appear in the list of Layers
 Don’t forget to call “geonode updatelayers” after
creating or modifying layers in Geoserver

 Note: does not seem to do anything for Cascaded


WMS layers, it does for cascaded WFS layers
 After creating the new cascaded WMS layer in
GeoServer, it will be automatically available to all
users to add it to a GeoNode map, under the ‘My
Geoserver WMS’ server

 Problem: some bug prevents the cascaded WMS


maps to draw (they appear pink)
 First, we have to create a new Store (data source) in
GeoServer, of type WFS

http://v2.suite.opengeo.org/geoserver/ows?
service=WFS&version=1.1.0&request=GetCapa
bilities
 Then we need to create new GeoServer layers for the WMS
layers we want to re-publish
 After adding the store, we will be automatically prompted to
create layers, or we can later use the ‘Add a new resource’
link in the Layers page of GeoServer
 When publishing a new WFS layer, we have the
opportunity to edit the metadata
 Some fields may be requested, like bounding boxes
 GeoServer has links to compute these bounds from
the data itself
 After writing the GeoServer metadata info for the
new layer, it will appear in the list of Layers
 After executing “geonode updatelayers” command,
the cascaded WFS will be automatically available to
all users to add it to a GeoNode map, just as the
cascaded WMS
 They will also be available as a layer in our
Geonode

Note: for now, they only


draw correctly if their native
CRS is WGS84 (EPSG:4326)
 Current status
◦ WMS:
 Do not synchronize (do not appear as Geonode layers,
but they can be added in map from local server)
 Do not draw (appear in pink tiles)
◦ WFS:
 They do synchronize well (appear as Geonode layers)
 They draw well if CRS = EPSG:4326 (native CRS is not
detected correclty)
 Exercise

Add the ‘US States’ layer from


http://v2.suite.opengeo.org/geoserver/ows?service=
WFS&version=1.1.0&request=GetCapabilities

Add it to a Geonode map


 The CSW catalogue web service allows external
access to the Geonode metadata catalog
 For instance, to get all the metadata records in
summary form:

http://localhost/catalogue/csw?REQUEST=GetRecords&SERVICE
=CSW&VERSION=2.0.2&OUTPUTSCHEMA=http://www.isotc211.
org/2005/gmd&elementSetName=summary&CONSTRAINTLANG
UAGE=CQL_TEXT&RESULTTYPE=results&TYPENAMES=csw:Recor
d
 The CSW protocol also allows external applications
to harvest the catalog (get a copy of the metadata)
 We will see how this works with Geonetwork, and
open source metadata manager
 Open it at http://localhost:8080/geonetwork and
login with user=admin, passwd=admin
 In the Administration section, click on “Harvesting
management” and add a new node from type CSW
Leave this
blank for
GeoNode
CSW servers

Enter the Geonode catalog server parameters

And give permissions to all to see the metadata


After saving, a new server will appear in the harvesting
configuration

If you want to harvest immediately, select the catalog


server and click on ‘Run’. Hit ‘Refresh’ and you will see the
status changed

The harvesting may take some time, but you can see the
results as they arrive to your node
Click on History to see what
happened
In this example, we can see a layer harvested from Geonode
We have now access to the links provided by Geonode to
download and access the layer page
However, the link to WMS and WFS services is not automatically
provided. If it were so, we could display the map and data here
in Geonetwork
• We get a copy of the metadata, but we cannot edit
them
• We don’t have a way to harvest metadata INTO
Geonode
• The metadata harvested from Geonode do not
contain links to the WMS, WFS services (they cannot
be directly loaded to a map), but we can see the
WMS and WFS addresses in the download links
• However, we can reuse the Geonode services
manually!
 Instead of harvesting, we can export metadata
directly from Geonode
 It will open in the Web browser, and then we can
save the file
 However, unfortunately the exported format is not
correct
 We need to eliminate the
<csw:GetRecordByIdResponse> element (at the start
and end of the file) and change the header to be:

<?xml version="1.0" encoding="UTF-8"?>


<gmd:MD_Metadata xmlns:gmd="http://www.isotc211.org/2005/gmd"
xmlns:srv="http://www.isotc211.org/2005/srv"
xmlns:gmx="http://www.isotc211.org/2005/gmx"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:gco="http://www.isotc211.org/2005/gco"
xmlns:gml="http://www.opengis.net/gml"
xmlns:gts="http://www.isotc211.org/2005/gts"
xmlns:geonet="http://www.fao.org/geonetwork"
xsi:schemaLocation="http://www.isotc211.org/2005/gmd
http://www.isotc211.org/2005/gmd/gmd.xsd">
<gmd:fileIdentifier>
 We can now import the XML file into Geonetwork
 The metadata should now be visible in Geonetwork
with the download and Web page links provided by
Geonode
GeoNode

Web front end Manual export/import &


linkage insertion

harvesting
pyCSW Geonetwork
CSW

cascading
GeoServer External Server
WMS, WFS, WCS

Metadat
a
 GeoCommons (geocommons.com) is a cloud-based
Web site to upload and share data to a worldwide
community
 There is only one GeoCommons site, where all
information is shared
 You don’t need to install anything to upload and
share
 As with
GeoNode, we
can upload data
layers and then
make maps with
them
 We can share
both
Recently, it has
been added an
option to publish
existing WMS
services to
GeoCommons
So we can cascade
GeoNode WMS
services to be seen
in GeoCommons
for a wide audience

More information in
http://developer.geoiq.com/blog/2011/02/01/wms-
and-tiles/
From
GeoCommons, we
can download data

And also do simple


geoprocesses

But we can not access


GeoCommons data and maps
as Web Services
 Exercise

Register and upload a Haiti dataset in


GeoCommons
Create a map
 Open Street Map (http://www.openstreetmap.org/)
is an initiative focused on creating a shared
worldwide map
 Data is created by means of community
contributions (crowdsourcing)
 Open Street Map data can be seen in GeoNode as
one of the base map options in the map viewer
 It can also be seen in qGIS via the OpenLayers
plugin

However, OSM is not published as


WMS, but as a tile service, so we cannot
directly use it as a layer in
GeoServer/GeoNode
 The interesting thing about OSM is that we can all
contribute to create data
 There is a very complete (but complex) editing
environment in the OSM portal (you just need to
register to contribute)
 There is a typology of point, line and polygons
features already defined, that we need to use when
adding objects
 We can interactively add features, or upload GPS
data as a reference
 Amazingly, we can also download all the map data
in vector format, using an open XML-based format
(.osm)
 OSM files can be converted into shapefiles using
the osm2shp tool from
http://code.google.com/p/osm2shp/

 The ArcGIS Data Interoperability Extension


supports OSM format at the 9.3.1 release of ArcGIS
Desktop

 qGIS not only supports OSM format, but we can


also perform the complete download-edit-upload
workflow from within this GIS
 With qGIS we can directly download data for a
certain geographic extent
 The next step is to convert the OSM file to a
database
 And then export the DB to a Spatialite DB
 A new layer will be created with the converted points, lines or
polygons
 Use a classified symbol to display different types of features
like streets and roads
 Then you can save the data as a shapefile and load into
Geonode!
 We can also export OSM data directly from their
web site
 Merkaartor
http://merkaartor.be
(Windows, UNIX, MacOS)

 OSM Editor for


ArcGIS (free plugin)
http://esriosmeditor.co
deplex.com/

You might also like