{"action":"created","issue":{"url":"https://api.github.com/repos/ckan/ckanext-spatial/issues/93","labels_url":"https://api.github.com/repos/ckan/ckanext-spatial/issues/93/labels{/name}","comments_url":"https://api.github.com/repos/ckan/ckanext-spatial/issues/93/comments","events_url":"https://api.github.com/repos/ckan/ckanext-spatial/issues/93/events","html_url":"https://github.com/ckan/ckanext-spatial/pull/93","id":52455026,"number":93,"title":"91 spatial form widget, upgrade leaflet and leaflet.draw","user":{"login":"florianm","id":762815,"avatar_url":"https://avatars.githubusercontent.com/u/762815?v=3","gravatar_id":"","url":"https://api.github.com/users/florianm","html_url":"https://github.com/florianm","followers_url":"https://api.github.com/users/florianm/followers","following_url":"https://api.github.com/users/florianm/following{/other_user}","gists_url":"https://api.github.com/users/florianm/gists{/gist_id}","starred_url":"https://api.github.com/users/florianm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/florianm/subscriptions","organizations_url":"https://api.github.com/users/florianm/orgs","repos_url":"https://api.github.com/users/florianm/repos","events_url":"https://api.github.com/users/florianm/events{/privacy}","received_events_url":"https://api.github.com/users/florianm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2014-12-19T07:22:29Z","updated_at":"2015-03-25T16:25:39Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ckan/ckanext-spatial/pulls/93","html_url":"https://github.com/ckan/ckanext-spatial/pull/93","diff_url":"https://github.com/ckan/ckanext-spatial/pull/93.diff","patch_url":"https://github.com/ckan/ckanext-spatial/pull/93.patch"},"body":"Here's an attempt at providing a spatial widget, addressing #91 . There are implications and I'm not sure whether my percussive implementation approach (hitting it with a wrench until it works) was the most graceful way, so I'd be grateful for feedback and suggestions.\r\n\r\nMain motivation: My end users love geo-referencing their datasets, and being able to search by map. But many (especially non-GIS-trained staff) struggle with GeoJSON, let alone a GeoJSON geometry. At the same time, my end users have expert knowledge about the true extent of their dataset. This means, letting them draw rather than paste or derive the extent would both make their lives easier (actually, enable them to provide geo-reference at all), and capture the most accurate study extent. Having accurate enough dataset extents would enable an agency to use the search tool to identify possible conflicts of planned field work with existing field sites. E.g., some of my end users manage controlled burns, while others monitor vegetation through 40+ years of non-burning.\r\n\r\nSo all we need is a map on which we can draw and edit polygons and rectangles, and the map needs to be data-bound to the \"spatial\" input. Bonus if one could pick spatial extents from a dropdown menu of favourite areas. Even better (haven't solved that one yet) if that list could be maintained through an API and would auto-complete like the tags do.\r\n\r\n* Updated Leaflet to 0.8-dev and Leaflet.draw to 0.2.3 (is there any better way than overwriting files in /vendor/?)\r\n* Used a patched geoalchemy as per #92 \r\n* Updated spatial-query's interaction with Leaflet.draw (required due to breaking changes in Leaflet.draw)\r\n* Provided a new module spatial-form (added usage docs directly into the file, to be moved into a better place later)\r\nand, over at ckanext-scheming, there's a new [spatial input widget](https://github.com/florianm/ckanext-scheming/blob/master/ckanext/scheming/templates/scheming/form_snippets/spatial.html) which will be a separate pull request for ckanext-scheming.\r\n\r\nCurrently, the dropdown comes out of ckanext-scheming, while the map comes from ckanext-spatial. To keep things simple, I've only data-bound map->text, dropdown->text, but neither dropdown->map nor text->map.\r\n\r\nScreenshots of working examples are at [ckanext-scheming issue 11](https://github.com/open-data/ckanext-scheming/issues/11), but feel free to take my [sandbox](http://data-demo.dpaw.wa.gov.au/) for a whirl (request a login from me) or, if you need your hands free (depending on how much you enjoy spatial stuff, I'm not judging), watch the thing in action at https://vimeo.com/116324887"},"comment":{"url":"https://api.github.com/repos/ckan/ckanext-spatial/issues/comments/86104063","html_url":"https://github.com/ckan/ckanext-spatial/pull/93#issuecomment-86104063","issue_url":"https://api.github.com/repos/ckan/ckanext-spatial/issues/93","id":86104063,"user":{"login":"amercader","id":200230,"avatar_url":"https://avatars.githubusercontent.com/u/200230?v=3","gravatar_id":"","url":"https://api.github.com/users/amercader","html_url":"https://github.com/amercader","followers_url":"https://api.github.com/users/amercader/followers","following_url":"https://api.github.com/users/amercader/following{/other_user}","gists_url":"https://api.github.com/users/amercader/gists{/gist_id}","starred_url":"https://api.github.com/users/amercader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amercader/subscriptions","organizations_url":"https://api.github.com/users/amercader/orgs","repos_url":"https://api.github.com/users/amercader/repos","events_url":"https://api.github.com/users/amercader/events{/privacy}","received_events_url":"https://api.github.com/users/amercader/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T16:25:39Z","updated_at":"2015-03-25T16:25:39Z","body":"This looks fantastic, I'll try and merge it as soon as I sort out the 2.3 support"}}