Plots2: Long-term Geographic Features planning

Created on 11 May 2017  Â·  27Comments  Â·  Source: publiclab/plots2

This is not a regular issue, but is a long-term tracking issue for all Geographic features. It's related to work on this repository (formerly #1070) and to https://github.com/publiclab/leaflet-blurred-location/issues/1


Release v0.1 - bare bones minimal useful release


Release v0.2 - "people and privacy"

v0.2a - Location entry

(mostly via https://github.com/publiclab/leaflet-blurred-location/issues/1)

  • [x] standardize for use in nodes or profiles via separate module for BlurredLocation
  • [x] creates tags "lat:____", "lon:_____", "blurred:true", "place:buffalo-ny"
  • [x] parameterize location as you type, so you see buffalo-ny appear as you type "Buffalo, NY", and this is submitted as place:buffalo-ny with description "Buffalo, New York, ZIPCODE, USA"
  • [x] display tag desc on tag hover (made into FTO at #1406)
  • [ ] use tag description field for full placename? So "place:buffalo-ny" would have description; "Buffalo, New York, ZIPCODE, USA" ?
  • [ ] display tag desc on tag page
  • [ ] manual entry "place:buffalo-ny" auto-generates lat:xxx + lon:xxx - at what zoom level? "City"? Check google geocoder precision field?
  • [ ] Offer recent locations used so you can quickly reuse ones you've already entered? Last 3? And the location you've entered on your profile if that exists?

v0.2b - Map displays

  • [x] Upgrade: bounding box request on drag or zoom (#1934)
  • [x] Search box with geolocation and map refresh (follow-up to #1934)
  • [x] Advanced short codes for inline maps:

    • [x] (v0.2) [map:people:lat:lon] (just people: requires privacy blurring)

    • [x] (v0.2 or v0.3) variations like [map:question:_____], [map:activity:_____]

    • (abandoned) [map:content:Buffalo, NY] (can this work?) or [map:content]Buffalo, NY[/map]? -- no, let's just do this via the UI

  • [x] Map display on additional standard pages: /people or /questions (in second half of #1940)
  • [x] display of blurred locations:

    • [x] show blurred locations for only a range of zoom levels. When you zoom in too far on a blurred location, stop displaying it. Calculate this based on number of decimals and the zoom level.

    • [ ] For the highest zoom levels of display, begin showing a region instead of a point (think this through)

    • [ ] when does it stop being a point? when you zoom in far enough?

    • [ ] no longer display an anything for 41.03,71.04 if you zoom past xx.xx resolution?

v0.2c - Map API

  • [x] way to request located nodes or profiles (#1934)
  • [x] JSON content at URL: tag/tagname.json?geo=true&lat1=__&lat2=__&lon1=__&lon2=__ (bounding box) -- or just within 1 precision digit of /api/geo/41.0/51.8 (#1934) - coordinate w API team
  • [ ] in GeoJSON - coordinate w API team
  • [ ] eventually allow for natural language queries like /geo/q=Buffalo, NY ? - coordinate w API team
  • [ ] relying on calls of this type will also make pulling in JusticeMap content easier

Geo Subscriptions

  • [ ] area-based tag-based subscriptions? Perhaps via wildcard subscriptions?
  • [x] "near me" or "near X" vía user tag like follow:near:lat:lon? Coordination w subscriptions team + UI design for this (default to your own location?)
Ruby break-me-up enhancement help wanted planning

Most helpful comment

Sounds awesome!!
@jywarren #2734 Please have a look

All 27 comments

@jywarren Shall we start with the integration?

Sure, how's the display library going?

For interface, I'd like to suggest you try to get the basic input to
display in a partial template, as you originally did, but this time using
the new library!

On Aug 25, 2017 3:08 PM, "Mridul Nagpal" notifications@github.com wrote:

@jywarren https://github.com/jywarren Shall we start with the
integration?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/1416#issuecomment-325011018,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJxpV8v2CSZT_ib1ZzRxk_E-Mw7YFks5sbxuRgaJpZM4NYYC9
.

The display library is at a prototype stage now, it builds fine and has some basic methods.

We need to add the leaflet-blurred-location library to npm first, or we just link it from github itself?

The version is 1.1.0 and the name is leaflet-blurred-location
Should I change anything?

I trust your call -- should i grab the latest master and publish it? :-)

added integration steps from #1655 !!

@jywarren Shall we get on with this now? What's our priority for now?

@jywarren Let's finish off with this milestone for starters, or you have something else in mind?

Awesome. Maybe this one?

manual entry "place:buffalo-ny

This'll require rails-side geocode -- we have a gem installed I think? We'd want to check if there is already lat/lon tags set, but if not, try to geocode the tag and use that.

I think it'll be worth testing to see if this is a relatively reliable way to add location (just entering "place:location-name", stripping out the "-", geocoding) - because if it causes too many errors maybe it's not worth it.

We could start by looking at http://publiclab.org/tag/place:* and testing the different existing tags of this kind in the current JavaScript geocoder. Do they seem to work?

Cleaned up and updated some tasks!!!

So basically, we enter place: buffalo-ny, it then converts to "Buffalo, New York, ZIPCODE, USA" and then does a search. Right?

so this would be in the tag input on a PublicLab.org page --

so we'd detect a place:____ tag here:
https://github.com/publiclab/plots2/blob/0647cb0a7549821f7442213b9571dddfaebedcbb/app/controllers/tag_controller.rb#L278

Then we'd replace '-' with ' '

Then we'd use the already-installed Geocoder gem to try to find where it
is: https://github.com/alexreisner/geocoder

Then we'd add two additional tags: lat:____ and lon:____.

What do you think? Should we instead try to catch this in JavaScript and
have a popup that says "Looks like a location -- is this right?" and shows
lat/lon? That'd give people a chance to agree/disagree.

Or we could even just let people add the tag, but then show an alert above
the tag input area that says "That looked like a location -- _click here_
to add coordinates."

Which do you think is the best experience and the most compact code?

On Wed, May 9, 2018 at 10:52 AM, Mridul Nagpal notifications@github.com
wrote:

So basically, we enter place: buffalo-ny, it then converts to "Buffalo,
New York, ZIPCODE, USA" and then does a search. Right?

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/publiclab/plots2/issues/1416#issuecomment-387766023,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AABfJy05shdyNk7GHKSZWfDo0jeX6oDgks5twwKtgaJpZM4NYYC9
.

The option to add location co-ordinates sounds better, as all the location won't be converted to lat lon as well, thus we could give a pop up as you said.

@jywarren Also if we use javascript we can sync the co-ordinates with the leaflet-blurred-location library as well, using the same google API we used in leaflet-blurred-location

@jywarren Any updates?

Ok so if we do it in JavaScript then we won't need the place tag dash removal in ruby code - we can do that in JavaScript! We will need to detect place tags being added in JavaScript though. I believe the file is app/assets/javascripts/tagging.js

@jywarren There is a method addTag with tagname and selector as input, we can directly check it there right, if its a place? Also when I do console log in the addTag method it doesn't display on the console when I publish the doc. How do I debug ?

Yes, that makes sense -- add a filter inside addTag(). I believe addTag() uses the HTML form on the page, rather than making an independent AJAX call. We might try to switch to doing an AJAX call, but I guess it really seems to work OK right now, so why bother?

But consider -- addTag() relies on this code being present in HTML: https://github.com/publiclab/mapknitter/blob/master/app/views/tags/_index.html.erb

In any case, on the tag_controller side, it's OK to submit several tags at once, separated by commas, like one,two,three:etc -- so you could:

  1. [ ] intercepts addTag() and if it has place:___, then
  2. [ ] replace - with (a space) and try to geocode
  3. [ ] if successful, pop up a modal saying "we've detected a location and tried to geocode it; does this look right?" showing a longer text description of the place and buttons of Yes, add coordinates and No, just use the original tag options
  4. [ ] if they click Yes, add ,lat:_____,lon:______ to the submitted tag string, else just send the original place:_____ tag alone

How does this sound?

Sounds awesome!!
@jywarren #2734 Please have a look

@jywarren Whats next?

Hi Mridul there are a few open issues in the blurred image repo, want to
try those and also some CodeClimate based code structure work?

Thanks!!!

Hi, we still need a "combined" content + people map syntax, like:

[map:all:_latitude_:_longitude_]

https://publiclab.org/wiki/inline-maps doesn't list it, so once we implement, we can add that new syntax.

We'd love to show BOTH nodes and profiles at https://publiclab.org/puerto-rico

It'd be a combination of:

  1. People maps: https://github.com/publiclab/plots2/blob/master/app/models/concerns/node_shared.rb#L220
  2. Note maps: https://github.com/publiclab/plots2/blob/master/app/models/concerns/node_shared.rb#L174

I think we could probably make private methods that did these two so there's no code duplication.

@mridulnagpal or @sagarpreet-chadha interested in this one? Mridul knows this stuff pretty well.

I think the templates themselves are at:

I've moved this to its own issue, here: #3090

Is this the meta issue for https://publiclab.org/wiki/gsoc-ideas#Geographic+features+refinements ? I wanted to discuss the proposed features, would this be the correct thread to get insights on it?

Hi @daemon1024 yes it is, but it's SOOOOO old! I wonder if we should start anew? Many above ideas are done or discarded. What do you think?

@jywarren Sure. Let's start up a fresh planning issue.

Was this page helpful?
0 / 5 - 0 ratings