Upload
gborelli
View
1.023
Download
2
Embed Size (px)
DESCRIPTION
Geo-referencing content types in Plone with collective.geo
Citation preview
Geo-referencing content types in Plone withcollective.geo
Where is mycontent?
Who am I?I'm senior developer and project manager with Abstract since 2011I'm senior developer and project manager with Abstract since 2011
I have been working with Plone since 2007I have been working with Plone since 2007
During the last years I have gained experience with various Python webDuring the last years I have gained experience with various Python webdevelopment frameworksdevelopment frameworks
Where is my content? — Giorgio Borelli Abstract
Web maps: when, why and how
Complex and specialized GIS application1.Maps are the central part of the app
PanoramioFoursquareOnly-apartments
2.
Geo-referenced CMS3.
Where is my content? — Giorgio Borelli Abstract
What is collective.geocollective.geo is a package that allows to geo-reference contents and todisplay them on a map
http://plone.org/products/collective.geo
In 2008 I faced two problems
learning Plone 3 and the Zope component architectureput a lot of contents on a map
Where is my content? — Giorgio Borelli Abstract
What if c.geo was not therePlone products
Products.MapsProducts.ATGoogleMapsredturtle.maps.coreraptus.article.map
Consspecific for Archetypes1.can only georeference points2.can only use Google Maps3.developed for a specific project4.
Where is my content? — Giorgio Borelli Abstract
collective.geo manifestomodular and easily extendableup to date and taking advantage of ZCAnot related to a specific map service
Where is my content? — Giorgio Borelli Abstract
Use cases
ENEAWe can use the location fieldof a content-type togeo-locate the offices of acompany
Archetypescollective.geo
http://www.enea.it
Use the location field
Where is my content? — Giorgio Borelli Abstract
Tropical Data HubWe can assign collective.geoMaps behaviour to aDexterity content-type inorder to make itgeo-referenceable
Dexteritycollective.geo.behaviour
http://tropicaldatahub.org/
Dexterity content types TTW
Where is my content? — Giorgio Borelli Abstract
IW:LEARNc.geo allows to geo-referencecontent with different shapes
PointsLinesPolygons
http://iwlearn.net/
Not only points
Where is my content? — Giorgio Borelli Abstract
We can aggregategeo-referenced contents witha Plone collection and, withflexitopic, we can show theresults on a table andpaginate them
collective.flexitopicc.geo.flexitopic
Flexitopic
Where is my content? — Giorgio Borelli Abstract
AORIFThe modular structure ofcollective.geo allows us tocustomize it in a simple way
On saving a content we cangeolocate its address and showit on a map. The user doesn'tneed to know the coordinatesneither to use a complex UI.
More customizations
Where is my content? — Giorgio Borelli Abstract
We can use a different javascriptmap services to display contents.
Google mapsPolymaps http://polymaps.org/
Leaflethttp://leaflet.cloudmade.com
Kartographhttp://kartograph.org
http://ferraraterraeacqua.it/
Backend/frontend
Where is my content? — Giorgio Borelli Abstract
We can also view the portalusers in a specific map
With a portlet we can include themap in a different context suchas a landing page.
collective.geo.usersmap
http://plone.it/partecipa
Plone.it - users' map
Where is my content? — Giorgio Borelli Abstract
Inside Plonecollective.geo.index
External catalogsSOLR
collective.solr
PostGIS
when an object is geo-referenced anevent is fired bycollective.geo.geographer
<subscriber handler=".MySubscriber" for="IObjectGeoreferencedEvent" />
Looking for my content
Where is my content? — Giorgio Borelli Abstract
collective.geo underthe hood
DependenciesShapelylibgeos_cgeopyBeautifulSoup
Installation[buildout]extends = http://dist.plone.org/release/4.2.1/versions.cfg
eggs = collective.geo.bundle BeautifulSoup...
The core of collective.geo
Note: Shapely dependency will be removed in the next release
Where is my content? — Giorgio Borelli Abstract
collective.geo structure
Where is my content? — Giorgio Borelli Abstract
collective.geo.openlayersIncludes the javascript library Openlayers in Plone and some otherjavascripts that are useful for managing maps in collective.geo
layer = new OpenLayers.Layer.Google( 'Google maps', { 'sphericalMercator':true, numZoomLevels:20 })
Where is my content? — Giorgio Borelli Abstract
based on zgeo.geographer andzgeo.plone.geographerprovides the basic mechanism toenter geographic data intogeoreferenceable contents
any object can be georeferenced
>>> class Placemark(object): ... implements( ... IGeoreferenceable, ... IAttributeAnnotatable ... )
>>> placemark = Placemark()
>>> geo = IGeoreferenced(placemark) >>> geo.setGeoInterface('Point', ... (-105.08, 40.59))
collective.geo.geographer
Where is my content? — Giorgio Borelli Abstract
collective.geo.settingsstore default settings for collective.geo
map centerzoom levelwhich layers have to be shown on the mapwhich contents can be georeferenceddefault styles for all features
Where is my content? — Giorgio Borelli Abstract
collective.geo.mapwidgetmanages the mechanism that handles Openlayers maps in Ploneeach map widget is a Zope component which contains a series oflayersall the maps in collective.geo are composed by one or more maplayers and each layer returns a javascript snippet by a page templatewhich contains all information about the layer itself
Where is my content? — Giorgio Borelli Abstract
collective.geo.mapwidget>>> from collective.geo.mapwidget import maplayer>>> class BingStretMapLayer(maplayer.MapLayer):... name = u"bing_map"... Title = _(u'Bing Streets')... type = 'bing'... jsfactory = """... function() {... return new OpenLayers.Layer.VirtualEarth('%s',... {'type': VEMapStyle.Shaded,... 'sphericalMercator': true});... }""" % Title
<metal:layer use-macro="context/@@collectivegeo-macros/map-widget" />
data can be inserted in WKTformatgeocoding with geopyit is possible to setcustomized styles
collective.geo.contentlocationsuser interface for georeferencing Archetypes content types
Where is my content? — Giorgio Borelli Abstract
collective.geo.kmlregisters a kml view on the georeferenced objects and on folderishcontents such as Folders and Collections.
the KML file can be used on external services like Google Earth/Maps
Where is my content? — Giorgio Borelli Abstract
Dexteritycollective.z3cform.mapwidget
it's a specific widget for z3c.form that allows to manage thegeographic data in an easy way
collective.geo.behaviourit's a Dexterity behaviour that allows to georeference contents anduses the annotations mechanism of collective.geo.geographer forregistering data
Where is my content? — Giorgio Borelli Abstract
More extensions
collective.geo.mapcontent
Where is my content? — Giorgio Borelli Abstract
collective.geo.fileit provides a view for KML, KMZ (Keyhole Markup Language) and GPX(GPS eXchange Format) files.
The view renders the file in a openlayers Map using the collective.geolibrary.
Where is my content? — Giorgio Borelli Abstract
Conclusion7 packages on the core (two more for Dexterity soon)9 addons packagestranslated in 9 languagesCoactivate http://www.coactivate.org/projects/collectivegeoReadthedocs http://collectivegeo.readthedocs.org
Where is my content? — Giorgio Borelli Abstract
Sean GilliesSilvio Tomatis - silviotGerhard Weis - gweisDavid Breitkreutz - rockdjMakina corpus
Christian Ledermann - nanDavid Beitey - davidjbMaurizio Delmonte - miziodelAlice NarduzzoEnrico Barra
Contributors
Where is my content? — Giorgio Borelli Abstract