Locations Plugin


I think “latlon” is a standard in most (all?) GIS software, I’m fine with it.

I would not use it, for the reason I stated: although the idea seems cool, the choice of random English words bothers me a lot.

Swatch in the 1990s

It sounds like Swatch in 1998 who came up with the “Internet Time” fad: they decided to divide a day in 1000 units “to avoid timezone issues”, but in fact it would not work since one would need to convert to local time anyway unless all in the world would agree to use “Biel Mean Time” (BMT), after the location of Swatch HQ.

Sounds like colonization to me. Let’s stick with the existing. It can make a fancy extra plugin, but it should not bloat this one.


(Richie Rich) #366

Same here, the w3w is a ‘nice to have’, but we’d not use it either.



It does, as well as your other plugins. Thank you!


(Destry Hunt) #368

The What3Words just came on my radar, and although I believe I would use it extensively for a new community that could become a large one, we should probably wait on asking you to dedicate it time considering the many other demands on your time. In the meantime, I will continue to research it. I may reach out to the What3Words team and get a sense of its growth and long term prospects.

When I have more information to share, I will circle back and share with everyone. Although it is premature to make the case for integration of the product, I can attest that the premise could be “disruptive” to the mapping industry in all the right ways for consumers like us. This is my view of it:

  1. Mapping solutions are frustrating because they are too often unable to locate a location based on any information other than the exact mailing address. Google is the exception because it can surmise a location based on misspelled and incomplete addresses, cross streets, and other typically problematic location information provided by the user. Users are so accustomed to providing GoogleMaps with garbage and being returned the correct location that the average technologically illiterate user is unable to glean the same utility from a Google competitor. Lat/Lon is far too complex for many users to comprehend, let alone to remember or copy/paste into the correct field. The human mind struggles with remembering numbers.
  2. Enter What3Words. Whoever thought of the concept understands how the brain remembers information. Without going down the neuroscience rabbit hole, What3Words takes away much of Google’s competitive advantage since a user merely has to click on a What3Words map to reveal the three words associated with the 3 meter squared location. The three words, which are easy to remember, are then input into a custom wizard field (this is very hard for lengthy lat/long numbers).

It may be too early for everyone to appreciate what a game-changer such a mapping technology may represent, which is a compelling argument for waiting. However, I think we should keep our eye on it. The need to integrate it may organically surface again.



(Destry Hunt) #369

According to the videos I saw, the solution is spreading to other languages. English was the first language, but it looks like other languages are being quickly added.


(Keith John Hutchison) #370

Once the transport industry starts using it wholesale it will abundantly clear what a game changer it will be.

1 Like

(Richie Rich) #371

can attest that the premise could be “disruptive” to the mapping industry

They’ve been around for over five years, they’re not doing much disruption yet…


(Destry Hunt) #372

Yeah, “disrupt” may have been a poor choice of words on my part. However, they are now integrated into Mercedes Benz’s sat-nav system. They are a small player, but I would love to be able to offer it as an option on my forum. I am so frustrated with the difficulty in getting the existing platforms (except for Google Maps) to recognize a partial address, misspelled address, or cross streets more than 50% of the time. Telling people to instead input the correct lat/long is in some cases equivalent to telling someone to solve a calculus problem every time they wanted to log into their email. The difference in technological skill level between users and developers can sometimes be so significant that the developers do not fully comprehend the opportunity in meeting the users where they are at and reaping the rewards from their adoption of a solution as a result.

1 Like

(Angus McLeod) #373

I’ve switched longitude and latitude.

I’m all for this, how it’s not yet clear to me that what3words is in fact the more usable solution for the non-technical folks, or just something that seems cool to people who are tech-inclined.

I would also like to see non-google geocoding get better at handling fuzzy search. That would perhaps be a better angle to investigate at this stage, rather than pursue a somewhat more prospective alternative solution.


(Destry Hunt) #374

I value your opinion as a proven plugin developer/author, so I will continue to research the topic and think more about fuzzy search as well. I deeply appreciate the work you do, and in the short time that I have been learning and using Discourse and its associated plugins, I have enjoyed testing your plugins and reading the discussions about them in this forum. I look forward to seeing how your locations plugin continues to evolve and advance.


(Angus McLeod) #375

I value your opinion as well, so don’t give up on w3w just yet :wink: It’s good to have a variety of views here. For the reasons I mentioned, I don’t think I’ll add it right now, but maybe circumstances or arguments may convince me or another contributor in the future.


(Patrick Rien) #376

Agreed may not be useful for all, but def lots of use cases currently (blog post linked below good overview for travelers) and many not yet imagined…

For example, could create w3w tags in Discourse. Would make it easier to add locations to posts and then also see all posts related to that location. “Best beach spot for volleyball is #pokers-kitten-arranged”. Could also add multiple tags to reference several locations (vs current each topic tied to just one location).

Again, not pushing hard for it especially if not an “easy” integration. Just think it could have a lot of useful/interesting applications.

Note w3w supports lots of languages (pic below is sample from app).


The software powering this discussion forum encountered an unexpected problem
(Bernard Sadaka (SDKAAA)) #377

There seems to be a bug after the latest update of Discourse:
Thank you in advance!


JSON::ParserError (765: unexpected token at ‘’)
/usr/local/lib/ruby/2.5.0/json/common.rb:156:in `parse’


/usr/local/lib/ruby/2.5.0/json/common.rb:156:in `parse'
/usr/local/lib/ruby/2.5.0/json/common.rb:156:in `parse'
/var/www/discourse/plugins/discourse-locations/plugin.rb:40:in `block (2 levels) in activate!'
/var/www/discourse/lib/plugin/instance.rb:176:in `block (2 levels) in add_to_class'
/var/www/discourse/plugins/discourse-locations/plugin.rb:69:in `block (2 levels) in activate!'
(eval):40:in `_fast_attributes'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:456:in `attributes'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:480:in `_serializable_hash'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:359:in `serializable_hash'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer/associations.rb:124:in `block in serialize'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer/associations.rb:123:in `map'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer/associations.rb:123:in `serialize'
/var/www/discourse/lib/freedom_patches/ams_include_without_root.rb:55:in `include!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:368:in `block in include_associations!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:367:in `each_key'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:367:in `include_associations!'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:362:in `serializable_hash'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:347:in `as_json'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `encode'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `encode'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `to_json'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/active_model_serializers-0.8.4/lib/active_model/serializer.rb:331:in `to_json'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/multi_json-1.13.1/lib/multi_json/adapters/oj.rb:40:in `dump'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/multi_json-1.13.1/lib/multi_json/adapters/oj.rb:40:in `dump'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/multi_json-1.13.1/lib/multi_json/adapter.rb:25:in `dump'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/multi_json-1.13.1/lib/multi_json.rb:139:in `dump'
/var/www/discourse/app/models/site.rb:123:in `json_for'
/var/www/discourse/app/controllers/application_controller.rb:530:in `preload_anonymous_data'
/var/www/discourse/app/controllers/application_controller.rb:350:in `preload_json'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `block in make_lambda'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `block (2 levels) in halting'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `block (2 levels) in <module:Callbacks>'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `block in halting'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `block in invoke_before'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `invoke_before'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `block in process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `block in instrument'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `instrument'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `instrument'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activerecord- `process_action'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `process'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionview- `process'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.2/lib/mini_profiler/profiling_methods.rb:78:in `block in profile_method'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `dispatch'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `serve'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `block in <class:Constraints>'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `serve'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `block in serve'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `serve'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-protection-2.0.5/lib/rack/protection/frame_options.rb:31:in `call'
/var/www/discourse/lib/middleware/omniauth_bypass_middleware.rb:32:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/tempfile_reaper.rb:15:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/conditional_get.rb:25:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/head.rb:12:in `call'
/var/www/discourse/lib/content_security_policy/middleware.rb:12:in `call'
/var/www/discourse/lib/middleware/anonymous_cache.rb:216:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:232:in `context'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/session/abstract/id.rb:226:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `block in call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/activesupport- `run_callbacks'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/logster-2.1.2/lib/logster/middleware/reporter.rb:30:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties- `call_app'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties- `call'
/var/www/discourse/config/initializers/100-quiet_logger.rb:16:in `call'
/var/www/discourse/config/initializers/100-silence_logger.rb:29:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `call'
/var/www/discourse/lib/middleware/enforce_hostname.rb:17:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/method_override.rb:22:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/actionpack- `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/sendfile.rb:111:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-mini-profiler-1.0.2/lib/mini_profiler/profiler.rb:171:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/message_bus-2.2.0/lib/message_bus/rack/middleware.rb:57:in `call'
/var/www/discourse/lib/middleware/request_tracker.rb:163:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties- `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties- `public_send'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/railties- `method_missing'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/urlmap.rb:68:in `block in call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/urlmap.rb:53:in `each'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/rack-2.0.6/lib/rack/urlmap.rb:53:in `call'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:606:in `process_client'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:701:in `worker_loop'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:549:in `spawn_missing_workers'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.1/lib/unicorn/http_server.rb:142:in `start'
/var/www/discourse/vendor/bundle/ruby/2.5.0/gems/unicorn-5.4.1/bin/unicorn:126:in `<top (required)>'
/var/www/discourse/vendor/bundle/ruby/2.5.0/bin/unicorn:23:in `load'
/var/www/discourse/vendor/bundle/ruby/2.5.0/bin/unicorn:23:in `<main>'

(Angus McLeod) #378

hm two things here.

  1. This is a data issue, not a code issue per se (it’s not connected to any updates). I’ve added a begin...rescue block for the JSON.parse that’s failing to parse your data.

  2. This should only arise if you’ve somehow added location data to a category itself (as opposed to a topic). This is a hidden feature of the plugin, so I’m not sure how you’ve done this :slight_smile:


(Bernard Sadaka (SDKAAA)) #379

thx @angus !it works

1 Like

(Destry Hunt) #380

@angus would it be possible to send the latitude and longitude to discourse, on topic create, via api?

1 Like


Is anybody here working with GoGoCarto? What would it take to use this plugin as a source for it?


(Richie Rich) #382

Just installed the update, thanks @angus :smiley:

1 Like

(fearlessfrog) #383

Interested in this plug-in but looking for some advice on how best to organize it.

Every 6 months or so we have events where members being able to mark their location on a map, and for all others to be able to see those locations would be great. It’s a sort of ‘round the world in 80 days’ thing, so a big map would be ideal.

Would we set up an ‘Fly-in Event 2019 Summer’ category, and then just have one topic in it?

Initially that would work, but what do we do when we want to organize the ‘Fly-in Event 2019 Winter’ event and show the map for that? Do we create a sub-category with its own map? Worried about having to create lots of categories over time.

I guess what I am asking is is it possible to filter the Map in the category with Locations enabled to a certain topic, or a date range etc? I think that would be ideal for us, although open to advice here as still trying to figure this out.


(Angus McLeod) #384

If the goal is to allow all users to mark their locations on a map, perhaps the Users Map feature? e.g. Angus' Sandbox.

If you want to tie locations to users via topics, you’d have to have one topic per user. You can only have one location per topic.

Try posting via the API following this example

1 Like