Where is my content?

1,053 views

Published on

Geo-referencing content types in Plone with collective.geo

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,053
On SlideShare
0
From Embeds
0
Number of Embeds
156
Actions
Shares
0
Downloads
5
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Where is my content?

  1. 1. Geo-referencing content types in Plone withcollective.geo Where is my content?
  2. 2. Who am I?Im senior developer and project manager with Abstract since 2011I have been working with Plone since 2007During the last years I have gained experience with various Python webdevelopment frameworks Abstract Where is my content? — Giorgio Borelli
  3. 3. Web maps: when, why and how1. Complex and specialized GIS application2. Maps are the central part of the app Panoramio Foursquare Only-apartments3. Geo-referenced CMS Abstract Where is my content? — Giorgio Borelli
  4. 4. What is collective.geocollective.geo is a package that allows to geo-reference contents and todisplay them on a maphttp://plone.org/products/collective.geoIn 2008 I faced two problems learning Plone 3 and the Zope component architecture put a lot of contents on a map Abstract Where is my content? — Giorgio Borelli
  5. 5. What if c.geo was not therePlone products Cons Products.Maps 1. specific for Archetypes Products.ATGoogleMaps 2. can only georeference points redturtle.maps.core 3. can only use Google Maps raptus.article.map 4. developed for a specific project Abstract Where is my content? — Giorgio Borelli
  6. 6. collective.geo manifesto modular and easily extendable up to date and taking advantage of ZCA not related to a specific map service Abstract Where is my content? — Giorgio Borelli
  7. 7. Use cases
  8. 8. Use the location fieldENEAWe can use the location fieldof a content-type togeo-locate the offices of acompany Archetypes collective.geohttp://www.enea.it Abstract Where is my content? — Giorgio Borelli
  9. 9. Dexterity content types TTWTropical Data HubWe can assign collective.geoMaps behaviour to aDexterity content-type inorder to make itgeo-referenceable Dexterity collective.geo.behaviourhttp://tropicaldatahub.org/ Abstract Where is my content? — Giorgio Borelli
  10. 10. Not only pointsIW:LEARNc.geo allows to geo-referencecontent with different shapes Points Lines Polygonshttp://iwlearn.net/ Abstract Where is my content? — Giorgio Borelli
  11. 11. FlexitopicWe can aggregategeo-referenced contents witha Plone collection and, withflexitopic, we can show theresults on a table andpaginate them collective.flexitopic c.geo.flexitopic Abstract Where is my content? — Giorgio Borelli
  12. 12. More customizationsAORIFThe modular structure ofcollective.geo allows us tocustomize it in a simple wayOn saving a content we cangeolocate its address and showit on a map. The user doesntneed to know the coordinatesneither to use a complex UI. Abstract Where is my content? — Giorgio Borelli
  13. 13. Backend/frontendWe can use a different javascriptmap services to display contents. Google maps Polymaps http://polymaps.org/ Leaflet http://leaflet.cloudmade.com Kartograph http://kartograph.orghttp://ferraraterraeacqua.it/ Abstract Where is my content? — Giorgio Borelli
  14. 14. Plone.it - users mapWe can also view the portalusers in a specific mapWith a portlet we can include themap in a different context suchas a landing page. collective.geo.usersmaphttp://plone.it/partecipa Abstract Where is my content? — Giorgio Borelli
  15. 15. Looking for my contentInside Plone when an object is geo-referenced an event is fired by collective.geo.index collective.geo.geographerExternal catalogs <subscriber handler=".MySubscriber" SOLR for="IObjectGeoreferencedEvent" /> collective.solr PostGIS Abstract Where is my content? — Giorgio Borelli
  16. 16. collective.geo under the hood
  17. 17. The core of collective.geoDependencies Installation Shapely [buildout] extends = http://dist.plone.org/release libgeos_c /4.2.1/versions.cfg geopy eggs = collective.geo.bundle BeautifulSoup BeautifulSoup ...Note: Shapely dependency will be removed in the next release Abstract Where is my content? — Giorgio Borelli
  18. 18. collective.geo structure Abstract Where is my content? — Giorgio Borelli
  19. 19. 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 } ) Abstract Where is my content? — Giorgio Borelli
  20. 20. collective.geo.geographer based on zgeo.geographer and >>> class Placemark(object): ... implements( zgeo.plone.geographer ... IGeoreferenceable, ... IAttributeAnnotatable provides the basic mechanism to ... ) enter geographic data into >>> placemark = Placemark() georeferenceable contents >>> geo = IGeoreferenced(placemark) >>> geo.setGeoInterface(Point,any object can be georeferenced ... (-105.08, 40.59)) Abstract Where is my content? — Giorgio Borelli
  21. 21. collective.geo.settingsstore default settings for collective.geo map center zoom level which layers have to be shown on the map which contents can be georeferenced default styles for all features Abstract Where is my content? — Giorgio Borelli
  22. 22. collective.geo.mapwidget manages the mechanism that handles Openlayers maps in Plone each map widget is a Zope component which contains a series of layers all the maps in collective.geo are composed by one or more map layers and each layer returns a javascript snippet by a page template which contains all information about the layer itself Abstract Where is my content? — Giorgio Borelli
  23. 23. collective.geo.mapwidget >>> from collective.geo.mapwidget import maplayer >>> class BingStretMapLayer(maplayer.MapLayer): ... name = u"bing_map" ... Title = _(uBing 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" />
  24. 24. collective.geo.contentlocationsuser interface for georeferencing Archetypes content types data can be inserted in WKT format geocoding with geopy it is possible to set customized styles Abstract Where is my content? — Giorgio Borelli
  25. 25. 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 Abstract Where is my content? — Giorgio Borelli
  26. 26. Dexteritycollective.z3cform.mapwidget its a specific widget for z3c.form that allows to manage the geographic data in an easy waycollective.geo.behaviour its a Dexterity behaviour that allows to georeference contents and uses the annotations mechanism of collective.geo.geographer for registering data Abstract Where is my content? — Giorgio Borelli
  27. 27. More extensions
  28. 28. collective.geo.mapcontent Abstract Where is my content? — Giorgio Borelli
  29. 29. 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. Abstract Where is my content? — Giorgio Borelli
  30. 30. Conclusion 7 packages on the core (two more for Dexterity soon) 9 addons packages translated in 9 languages Coactivate http://www.coactivate.org/projects/collectivegeo Readthedocs http://collectivegeo.readthedocs.org Abstract Where is my content? — Giorgio Borelli
  31. 31. Contributors Sean Gillies Christian Ledermann - nan Silvio Tomatis - silviot David Beitey - davidjb Gerhard Weis - gweis Maurizio Delmonte - miziodel David Breitkreutz - rockdj Alice Narduzzo Makina corpus Enrico Barra Abstract Where is my content? — Giorgio Borelli

×