{ "info": { "author": "4teamwork AG", "author_email": "mailto:info@4teamwork.ch", "bugtrack_url": null, "classifiers": [ "Framework :: Plone", "Framework :: Plone :: 4.3", "Framework :: Plone :: 5.1", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Programming Language :: Python", "Topic :: Software Development" ], "description": "Introduction\n============\n\nThis product helps integrating the ``collective.geo.*`` packages and aims to\nprovide some sensible defaults. Besides some integration glue it defines a new\ninterface ``IGeocodableLocation`` that can be used to create adapters that knows\nhow to represent the location of a content type with address-like fields as a\nstring suitable for passing to a geocoding API.\n\n\nPurpose\n========\n\n- Automatic geocoding of ``IGeoreferenceable`` content types via an\n ``IGeocodableLocation`` adapter\n- Caching of geocoding responses\n- Only trigger geocoding lookups if location related fields on the content item\n changed\n- Facilitate doing automatic geocoding based on location fields and still allow\n for manually setting custom coordinates\n\n\nUsage\n=====\n\n\nAutomatically geocoding your content types\n------------------------------------------\n\nIn order for your content types to be automatically geocoded on ``ObjectEdited``\nor ``ObjectInitialized`` events, you need to create an adapter for your content\ntype that implements ``IGeocodableLocation`` and knows how to build a geocodable\nlocation string from the content type's location related fields.\n\nIn order to implement the interface you need to define a ``getLocationString``\nmethod on your adapter that returns the complete location as a comma separated\nstring, with the location parts getting less specific from left to right.\n\nFor example::\n\n '1600 Amphitheatre Parkway, Mountain View, CA, US'\n 'Engehaldestr. 53, 3012 Bern, Switzerland'\n\nIf the ``getLocationString`` method returns the empty string or ``None``, the\nevent handler won't attempt to do a geocode lookup, so this is the suggested way\nto abort geocoding if not enough location information is available.\n\nExample code::\n\n from ftw.geo.interfaces import IGeocodableLocation\n from zope.component import adapts\n from zope.interface import implements\n\n\n class MyTypeLocationAdapter(object):\n \"\"\"Adapter that is able to represent the location of an MyType in\n a geocodable string form.\n \"\"\"\n implements(IGeocodableLocation)\n adapts(IMyType)\n\n def __init__(self, context):\n self.context = context\n\n def getLocationString(self):\n \"\"\"Build a geocodable location string from the MyType's address\n related fields.\n \"\"\"\n street = self.context.getAddress()\n zip_code = self.context.getZip()\n city = self.context.getCity()\n country = self.context.getCountry()\n\n location = ', '.join([street, zip_code, city, country])\n return location\n\n\nRegister the adapter with ZCML::\n\n \n\n\nCaching of geocoding responses\n------------------------------\n\nResponses from the geocoding API are being RAM cached. The cache key being used\nis the result of the ``getLocationString`` method, which means that for every\nunique location string the geocoding lookup is only done once and subsequently\nfetched from the cache.\n\n\nOnly triggering geocoding when location fields changed\n------------------------------------------------------\n\nIf we were to do a geocode lookup on every ``ObjectEdited`` event, any custom\ncoordinates that have been set would be overriden every time *any* field on\nthe content item is changed (even if the geocoding response itself was fetched\nfrom the cache).\n\nTo avoid this, ``ftw.geo`` stores the result of ``getLocationString`` as an\nannotation on the object and on ``ObjectEdited`` checks if the location string\n(and therefore the location related fields) actually changed, and only does the\nlookup when necessary. This means:\n\nOn ``ObjectInitialized`` the content type will first be geocoded initally\n(unless ``getLocationString`` returned ``None`` or the empty string). If you\nmanually set coordinates after that through the 'Coordinates' tab provided by\n``collective.geo.contentlocations`` they will be saved and overwrite the\ncoordinates determined previously by geocoding. After that, if you edit the\ncontent item and change any fields *not* related to the location, the custom\ncoordinates will be preserved. Only if you change one of the location related\nfields used in ``getLocationString`` the geocoding will be performed again and\nany custom coordinates overwritten.\n\n\nGoogle API Key\n--------------\n\nGoogle's geocoding API can be used without an API Key, but then is limited to\n2500 requests per day. If you defined your Google Maps API Key in\n``collective.geo.settings`` it will be used, otherwise the geocoding API will be\ncalled without an API key.\n\n\nRendering a content map viewlet in a custom template\n----------------------------------------------------\n\nIf you don't want your content map displayed in one of the default viewlet\nmanagers (plone.abovecontentbody / plone.abovecontentbody) on the content item's\nmain view but instead in a custom view and/or a different viewlet manager, this\nis how you do it:\n\nFirst, you need to make sure your browser view implements a specific interface\nand provide a KMLMapViewletLayer adapter (view, request, context, widget) for\nit::\n\n \n\nYour view class have to provide the ``collective.geo.kml.interfaces.IKMLOpenLayersView``::\n\n from collective.geo.kml.interfaces import IKMLOpenLayersView\n from Products.Five.browser import BrowserView\n from zope.interface import implements\n\n\n class ContactView(BrowserView):\n implements(IKMLOpenLayersView)\n\nThen, in your view's template, simply use the macros provided by\ncollective.geo.mapwidget::\n\n
\n \n \n
\n\n\n\nDependencies\n============\n\n`collective.geo.settings `_\n\n`collective.geo.openlayers `_\n\n`collective.geo.geographer `_\n\n`collective.geo.contentlocations `_\n\n`collective.geo.kml `_\n\n\nIf you're having trouble installing the collective.geo.* dependencies (namely\n``libgeos`` and ``shapely``) trough your distribution's package manager, you can\nbuild them yourself using this buildout configuration:\n\n\n\n**shapely.cfg**::\n\n [buildout]\n parts +=\n geos\n shapely\n\n [geos]\n recipe = zc.recipe.cmmi\n url = http://download.osgeo.org/geos/geos-3.3.5.tar.bz2\n md5sum = 2ba61afb7fe2c5ddf642d82d7b16e75b\n extra_options =\n CC='gcc -m32'\n CXX='g++ -m32'\n\n [shapely]\n recipe = zc.recipe.egg:custom\n egg = Shapely\n include-dirs = ${geos:location}/include\n library-dirs = ${geos:location}/lib\n rpath = ${geos:location}/lib\n\nUse it in your main ``buildout.cfg`` like this::\n\n [buildout]\n extends =\n # ...\n shapely.cfg\n\n [instance1]\n eggs +=\n ${shapely:egg}\n\n environment-vars +=\n LD_LIBRARY_PATH ${geos:location}/lib\n\n\nLinks\n=====\n\n- Github: https://github.com/4teamwork/ftw.geo\n- Issues: https://github.com/4teamwork/ftw.geo/issues\n- Pypi: http://pypi.python.org/pypi/ftw.geo\n- Continuous integration: https://jenkins.4teamwork.ch/search?q=ftw.geo\n\n\nContributors\n============\n\n- Lukas Graf [lukasg], Author\n\n\nCopyright\n=========\n\nThis package is copyright by `4teamwork `_.\n\n``ftw.geo`` is licensed under GNU General Public License, version 2.\n\nChangelog\n=========\n\n\n1.4.2 (2019-10-23)\n------------------\n\n- Move plone5 incompatible dependency to plone4 extra [Nachtalb]\n\n\n1.4.1 (2019-04-01)\n------------------\n\n- Fix location not found error raising False exception, leading to a bad error message for the user [Nachtalb]\n\n\n1.4.0 (2019-01-23)\n------------------\n\n- The location adapter may return utf-8 or unicode, so lets use safe_uniode to be sure. [mathias.leimgruber]\n\n- Drop Plone 4.2 support. [mathias.leimgruber]\n\n- Since Version 1.3.6 plone.api 1.5.1 is required. [mathias.leimgruber]\n\n- Add Plone 5.1 test config. [mathias.leimgruber]\n\n\n1.3.6 (2018-10-10)\n------------------\n\n- Pass google api key from \"IGeoSettings.googleapi\" to GoogleV3 (required now). [mathias.leimgruber]\n\n- Drop Plone 4.1 support. [jone]\n\n\n1.3.5 (2016-09-29)\n------------------\n\n- Fix German translation.\n [mbaechtold]\n\n1.3.4 (2016-03-30)\n------------------\n\n- Fix bug when using ftw.geo in combination with the IReferenceable behavior.\n This bug will appear with plone >= 4.3.8\n [elioschmutz]\n\n1.3.3 (2016-03-30)\n------------------\n\n- Fix removing coordinates if no location is given.\n If you remove an existing address from an object, the handler is now\n removing the coordinates too. This causes that the map will no longer be\n visible on the object.\n [elioschmutz]\n\n- Restrict versions of some dependencies so they don't pull in Plone 5.\n [mbaechtold]\n\n\n1.3.2 (2014-10-20)\n------------------\n\n- Declare plone.app.dexterity as dependency.\n Dexterity is used in the handlers.py.\n [mathias.leimgruber]\n\n\n1.3.1 (2014-10-20)\n------------------\n\n- Use Archetypes events for AT content and zope.lifecycle events for DX.\n- BugFix: No longer cast geocode (of geocoders.GoogleV3) to list. It's already a list.\n [mathias.leimgruber]\n\n\n1.3 (2013-11-26)\n----------------\n\n- Use conditional imports to account for API changes in geopy 0.96.\n [lgraf]\n\n- Use zope.lifecycleevents for dexterity support.\n [jone]\n\n- Added missing dependency.\n [Julian Infanger]\n\n\n1.2 (2013-05-10)\n----------------\n\n- Fix German translation file.\n [jone]\n\n- Fix UnicodeDecode error while rendering the portal message for GQueryError.\n\n\n1.1 (2013-04-03)\n----------------\n\n- Use message IDs and defaults in error message translations.\n [lgraf]\n\n- Improved exception handling when doing geocoding on save.\n Deal with network errors and any other unhandled exception,\n and display meaningful messages for all cases.\n [lgraf]\n\n- Fix tests according to the new features\n [mathias.leimgruber]\n\n- Display a status message when automatic geocoding didn't yield any results.\n [lgraf]\n\n- Make sure to import exceptions we check for from the googlev3 geocoder\n after switching to V3 geocoding API.\n [lgraf]\n\n- Deal with multiple results for automatic geocoding.\n When automatic geocoding on save for a content item results in\n more than one match, choose the first one and display a message\n to the user that he might want to change it.\n [lgraf]\n\n- Remove api key usage. The geopy GoogleV3 Geocoder does not\n implement an api key.\n [mathias.leimgruber]\n\n- Use google map api V3 of geopy 0.95.\n See -> http://plone.293351.n2.nabble.com/collective-geo-GBadKeyError-when-geocoding-w-geopy-td7563845.html\n [mathias.leimgruber]\n\n\n1.0 (2012-12-03)\n----------------\n\n- Added import step to uninstall Products.Maps using quickinstaller.\n [lukasg]\n\n- First implementation.\n [lukasg]", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/4teamwork/ftw.geo", "keywords": "plone ftw geo", "license": "GPL2", "maintainer": "Lukas Graf", "maintainer_email": "", "name": "ftw.geo", "package_url": "https://pypi.org/project/ftw.geo/", "platform": "", "project_url": "https://pypi.org/project/ftw.geo/", "project_urls": { "Homepage": "https://github.com/4teamwork/ftw.geo" }, "release_url": "https://pypi.org/project/ftw.geo/1.4.2/", "requires_dist": null, "requires_python": "", "summary": "Integration package for collective.geo.* packages.", "version": "1.4.2", "yanked": false, "yanked_reason": null }, "last_serial": 13253361, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "b3444609616bf957a846a97bcb706826", "sha256": "9f683fa1ee18c2dd0d0a894089f90d2108aa84300aa05341a04b952e24454ee7" }, "downloads": -1, "filename": "ftw.geo-1.0.zip", "has_sig": false, "md5_digest": "b3444609616bf957a846a97bcb706826", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 29050, "upload_time": "2012-12-03T07:45:26", "upload_time_iso_8601": "2012-12-03T07:45:26.978381Z", "url": "https://files.pythonhosted.org/packages/14/46/41aa0bc7b013c78aca9e41c6b65f594580bdaa174de50bb88eb951f58bb4/ftw.geo-1.0.zip", "yanked": false, "yanked_reason": null } ], "1.1": [ { "comment_text": "", "digests": { "md5": "df97688cc0ae2499972de891c2f16010", "sha256": "21d9cb116f1408e8927d40aee236b76e2da4ced6a545a392a5347eacb18cd9fc" }, "downloads": -1, "filename": "ftw.geo-1.1.zip", "has_sig": false, "md5_digest": "df97688cc0ae2499972de891c2f16010", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33581, "upload_time": "2013-04-09T07:32:00", "upload_time_iso_8601": "2013-04-09T07:32:00.166032Z", "url": "https://files.pythonhosted.org/packages/1d/07/d35d0fa62668027651fd9bec535651f0a4f650c725d1751fba0ba9f72cae/ftw.geo-1.1.zip", "yanked": false, "yanked_reason": null } ], "1.2": [ { "comment_text": "", "digests": { "md5": "b390dac6f5b3165dcbb87c6eb2c9bdf9", "sha256": "ec5e98c00f3265f2f97b1150d4baacd3e70e1c8ae07e7a6a8342dda2510cf3f2" }, "downloads": -1, "filename": "ftw.geo-1.2.zip", "has_sig": false, "md5_digest": "b390dac6f5b3165dcbb87c6eb2c9bdf9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 34280, "upload_time": "2013-05-10T14:43:32", "upload_time_iso_8601": "2013-05-10T14:43:32.748073Z", "url": "https://files.pythonhosted.org/packages/b9/57/3d0d2deb81ff817eca4575eab25d098d8ef52a896e65ade53f81474539c1/ftw.geo-1.2.zip", "yanked": false, "yanked_reason": null } ], "1.3": [ { "comment_text": "", "digests": { "md5": "7a32edcec8fab7fa8e765c4a4f5bb7f2", "sha256": "eeab56a933f3ed1a135682adf5a002c4ded287007d3bea94250348bf60bf1ade" }, "downloads": -1, "filename": "ftw.geo-1.3.zip", "has_sig": false, "md5_digest": "7a32edcec8fab7fa8e765c4a4f5bb7f2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38116, "upload_time": "2013-11-26T09:42:01", "upload_time_iso_8601": "2013-11-26T09:42:01.280154Z", "url": "https://files.pythonhosted.org/packages/11/b7/447630328253320be81a074d180c944421b798698cba2e706b25d6101930/ftw.geo-1.3.zip", "yanked": false, "yanked_reason": null } ], "1.3.1": [ { "comment_text": "", "digests": { "md5": "9f89f37e3e871baf8bfb0c31aeafc845", "sha256": "a2a2a029a0364c6203d7866a1e65e579d3743099f31e585ac92b32e52f4e2695" }, "downloads": -1, "filename": "ftw.geo-1.3.1.zip", "has_sig": false, "md5_digest": "9f89f37e3e871baf8bfb0c31aeafc845", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38684, "upload_time": "2014-10-20T06:48:10", "upload_time_iso_8601": "2014-10-20T06:48:10.086103Z", "url": "https://files.pythonhosted.org/packages/10/ef/b18b25ebee0f8f4ae8dc98f815eb6d21857ace4f6a4f1f984c5fa254bc53/ftw.geo-1.3.1.zip", "yanked": false, "yanked_reason": null } ], "1.3.2": [ { "comment_text": "", "digests": { "md5": "73e1b5477fca17f047f59f5d2c08c382", "sha256": "0432030a168fd15adf0b0eed587dee32fb16e16b7fecda169c2d73291977d40f" }, "downloads": -1, "filename": "ftw.geo-1.3.2.zip", "has_sig": false, "md5_digest": "73e1b5477fca17f047f59f5d2c08c382", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38800, "upload_time": "2014-10-20T13:01:35", "upload_time_iso_8601": "2014-10-20T13:01:35.821177Z", "url": "https://files.pythonhosted.org/packages/5c/5f/a176207bc258493f0e129709d0d89f7ab3dfafe69b4b7b33d50da7af0f21/ftw.geo-1.3.2.zip", "yanked": false, "yanked_reason": null } ], "1.3.3": [ { "comment_text": "", "digests": { "md5": "d0d2ce372fa32aa576aed6488e85da11", "sha256": "88da97bcb069d87d8507450ab38fcc25b66f9bf5901e807aaeb4df9c8cab43cb" }, "downloads": -1, "filename": "ftw.geo-1.3.3.tar.gz", "has_sig": false, "md5_digest": "d0d2ce372fa32aa576aed6488e85da11", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23446, "upload_time": "2016-03-30T07:23:38", "upload_time_iso_8601": "2016-03-30T07:23:38.353111Z", "url": "https://files.pythonhosted.org/packages/54/8c/af1c039827bfc9f2cde08f4e6031987dd4c1e700a9f069363942fd71daad/ftw.geo-1.3.3.tar.gz", "yanked": false, "yanked_reason": null } ], "1.3.4": [ { "comment_text": "", "digests": { "md5": "220220c6e8fb4faa34f284760c2ff7bb", "sha256": "ab8651e9c69755cc29f968dcc867c30d1a38560bd56e15cfbca85ac8dabf9637" }, "downloads": -1, "filename": "ftw.geo-1.3.4.tar.gz", "has_sig": false, "md5_digest": "220220c6e8fb4faa34f284760c2ff7bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23687, "upload_time": "2016-03-30T14:25:31", "upload_time_iso_8601": "2016-03-30T14:25:31.066530Z", "url": "https://files.pythonhosted.org/packages/78/ea/4694ed10dd7f2991ffc1945c49354f0b4a0a8075e00a30abd272628fa68a/ftw.geo-1.3.4.tar.gz", "yanked": false, "yanked_reason": null } ], "1.3.5": [ { "comment_text": "", "digests": { "md5": "e6d7d335bcaedfa26267096c4131b024", "sha256": "4c5d86a87b51f21db480e10991048c877ce249272d8cd291478f553aa597b8c6" }, "downloads": -1, "filename": "ftw.geo-1.3.5.tar.gz", "has_sig": false, "md5_digest": "e6d7d335bcaedfa26267096c4131b024", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23690, "upload_time": "2016-09-29T06:43:58", "upload_time_iso_8601": "2016-09-29T06:43:58.143760Z", "url": "https://files.pythonhosted.org/packages/94/e5/f451a8144c088f95c015b5fd863ec5714c06b6b0bf8a1a0ae72355f40d0d/ftw.geo-1.3.5.tar.gz", "yanked": false, "yanked_reason": null } ], "1.3.6": [ { "comment_text": "", "digests": { "md5": "7fa9cdf2f7a9c2ec5a159152f209c78f", "sha256": "1eb163501d94f0ae4b5ee99a382cb4e51f2d37022c5693460586338afe3d1b30" }, "downloads": -1, "filename": "ftw.geo-1.3.6.tar.gz", "has_sig": false, "md5_digest": "7fa9cdf2f7a9c2ec5a159152f209c78f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26706, "upload_time": "2018-10-10T16:14:57", "upload_time_iso_8601": "2018-10-10T16:14:57.577412Z", "url": "https://files.pythonhosted.org/packages/1f/db/405911b378588991b3d8215732253bc315b4eca62f30f27df6bce5c31025/ftw.geo-1.3.6.tar.gz", "yanked": false, "yanked_reason": null } ], "1.4.0": [ { "comment_text": "", "digests": { "md5": "c5a768df426dd64ce8cf53b26f98c175", "sha256": "d0234baebb5dc8ce5be75056eec3360c747c96511a4304394e67cea36c3d1dba" }, "downloads": -1, "filename": "ftw.geo-1.4.0.tar.gz", "has_sig": false, "md5_digest": "c5a768df426dd64ce8cf53b26f98c175", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26993, "upload_time": "2019-01-23T07:02:04", "upload_time_iso_8601": "2019-01-23T07:02:04.045631Z", "url": "https://files.pythonhosted.org/packages/d4/2d/d9726b15a3c7ef608712263ee20ec2c93ec03c91cb7377442f83d26794f4/ftw.geo-1.4.0.tar.gz", "yanked": false, "yanked_reason": null } ], "1.4.1": [ { "comment_text": "", "digests": { "md5": "e6b1dee58513528d5efb95cd4ebc7737", "sha256": "bedc898cb12e1d52b6d85d7fa8230075fd2d8dc6cf9fc2a45a2cbc8450258aa7" }, "downloads": -1, "filename": "ftw.geo-1.4.1.tar.gz", "has_sig": false, "md5_digest": "e6b1dee58513528d5efb95cd4ebc7737", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27211, "upload_time": "2019-04-01T16:53:13", "upload_time_iso_8601": "2019-04-01T16:53:13.288262Z", "url": "https://files.pythonhosted.org/packages/29/85/f1bc1c6c1412421f693da312a39ceb673920609e949fb0027ea1d984bdb1/ftw.geo-1.4.1.tar.gz", "yanked": false, "yanked_reason": null } ], "1.4.2": [ { "comment_text": "", "digests": { "md5": "bc206113cb56b1f4f606f711bf5274c6", "sha256": "523504a8aaeb730b0dc91b4f951e9d32431ce8482055a06aaf240820e3ce8c24" }, "downloads": -1, "filename": "ftw.geo-1.4.2.tar.gz", "has_sig": false, "md5_digest": "bc206113cb56b1f4f606f711bf5274c6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27298, "upload_time": "2019-10-23T14:19:21", "upload_time_iso_8601": "2019-10-23T14:19:21.528906Z", "url": "https://files.pythonhosted.org/packages/f9/06/16c4323af10fd25fc8320af8baf65d4ea7098b60a9fbaf9409907f2fab92/ftw.geo-1.4.2.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bc206113cb56b1f4f606f711bf5274c6", "sha256": "523504a8aaeb730b0dc91b4f951e9d32431ce8482055a06aaf240820e3ce8c24" }, "downloads": -1, "filename": "ftw.geo-1.4.2.tar.gz", "has_sig": false, "md5_digest": "bc206113cb56b1f4f606f711bf5274c6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 27298, "upload_time": "2019-10-23T14:19:21", "upload_time_iso_8601": "2019-10-23T14:19:21.528906Z", "url": "https://files.pythonhosted.org/packages/f9/06/16c4323af10fd25fc8320af8baf65d4ea7098b60a9fbaf9409907f2fab92/ftw.geo-1.4.2.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }