2020-07-05 UTC
[fluffy] and [chrisaldrich] joined the channel
nickodd, GWG_ and [asuh] joined the channel
# 05:22 [asuh] Hey GWG, I’m looking up OSM for tile usage for static maps via Simple Location plugin. I saw your reply in the Github issue 97 so I got curious where the issue is with OSM. I believe this is the page I need to review, right?
# 05:23 GWG [asuh]: Those are tiles...I could solve the problem by running my own static map generator.
# 05:24 GWG OSM has no API for generating a static image
# 05:24 [asuh] What’s the difference between a tile and static image?
# 05:26 GWG Think of the difference between a jigsaw puzzle and a piece of a jigsaw puzzle
# 05:28 [asuh] Is the piece equal to the static image of the whole puzzle?
# 05:29 GWG The only practical way for me to use a tile server would be to do dynamic maps with leaflet.
# 05:29 GWG That would still be polling a server
# 05:30 GWG I could also set up a static map generation service of my own, but that is an expensive endeavor.
# 05:32 [asuh] So let me make sure I understand the problem, here’s what I think I’m reading/hearing:
# 05:32 [asuh] 1. Most map makers say please don’t generator static map images that are hosted locally
# 05:32 [asuh] 2. Even if it was okay to generate a static map image, Simple Location needs to poll multiple APIs and thus multiple ways to do this
# 05:32 GWG [asuh]: Well, actually, doing #2 would be a violation of TOS as well.
# 05:32 GWG I only use one Map Service at a time.
# 05:32 GWG I just put in 8 of them for redundancy
# 05:33 GWG If one fails, I can switch...but it switches the whole site
# 05:33 GWG As for #1, they don't say please. They say no
# 05:34 GWG So, the only way is to host your own static map API
# 05:34 [asuh] In a quick search, I found this service on Github that looks good, even if it violates #2 above:
# 05:34 Loqi [katydecorah] staticmapmaker: :earth_asia: Create a Bing, Google, Mapbox, HERE, Yandex, CartoDB, or MapQuest static map.
# 05:35 GWG I think that might do what I do...
# 05:35 GWG It generates the URL for a static map image
# 05:36 Loqi [Sebastian Greger] Self-hosting maps: taking control over UX and users' privacy
# 05:38 [asuh] I think my ongoing confusion about generating a static image of a certain part of a map using OSM is the TOS violation.
# 05:39 GWG [asuh]: It isn't. However, the system doing the generating has the limitation
# 05:39 GWG Someday, I will get around to generating it myself.
# 05:39 [asuh] and that limitation is the use of the API to process that data and generate the map image?
# 05:42 [asuh] Just skimming through what Sebastian wrote, it seems like the biggest problem for OSM is the abuse of their API since it costs money. But what Simple Location plugin could do, it doesn’t seem abusive to use the API to generate and pre-render a map image which would be served from the local site and not linked from OSM’s services
# 05:42 GWG Yes, but even with using their tile server, I'd have to render a static image.
# 05:43 GWG I could self-host aaronpk's Static Maps API for PHP if I wanted to.
# 05:44 GWG But how many users could do that?
# 05:44 [asuh] Is that a big package of PHP files that could included in the plugin? too large?
# 05:45 [asuh] I haven’t looked and didn’t know he was doing that locally
# 05:45 GWG I should ask him about it. He hasn't touched that package in 6 years.
# 05:48 GWG [asuh]: WordPress users installing a self-contained WordPress application
# 05:48 aaronpk It's the code that generates all the maps on my site still
# 05:50 [asuh] It’s been curious that this type of API couldn’t be included to generate the static image within Simple Location, and if your API, aaronpk, could be integrated, why not!
# 05:50 [asuh] or something like that Github repo I linked to above
# 05:50 GWG aaronpk: I know. But should I be generating static maps inside a WordPress plugin?
# 05:50 aaronpk All mine does is assemble 256px square images sourced from elsewhere
# 05:51 [asuh] that sounds reasonable and not too server intensive
# 05:53 aaronpk The complicated part is sourcing the map data but if you punt that to external providers then you're really dealing with only images and coordinate systems and you can usually avoid the coordinate system math when dealing with areas smaller than a large state
# 05:53 GWG aaronpk: I assume if I stick to OSM's tile servers, I'm not going to get into a dispute over TOS and storing the rendered image.
# 05:54 [asuh] The tile policy page I previously linked to seems to say they’d rather it be served locally, maybe with a link back to OSM?
# 05:58 GWG [asuh]: Either way, I'd have to adapt aaronpk's code...which I suppose is doable.
# 05:58 GWG Might be easier to run his service though somewhere and have Simple Location work with it
# 05:59 [asuh] GWG so you’re still concerned that including it in the plugin could be tough/bad on each server that this plugin is installed?
# 06:00 GWG [asuh]: Yes, that and I think just sticking his code inside the plugin wouldn't work. I'd have to adapt it.
# 06:01 [asuh] right, i understand about adapting it. or any other generator you’d include.
# 06:01 GWG [asuh]: So I will look into self hosting his code and supporting a provider that uses it first, and possibly moving to integration later
# 06:02 [asuh] I’ll reply to the Github issue and include some of these thoughts
# 06:03 GWG aaronpk: Has anything happened in the last 6 years that you haven't gotten around to doing with that code?
# 06:07 GWG [asuh]: Either way, this would come in stages if I did it
# 06:07 GWG But will install aaronpk's service and play around
# 06:07 aaronpk so here's the thing, it's not that computationally expensive
# 06:08 aaronpk since the map providers already chop up the tiles at several zoom levels it simplifies the problem a lot
# 06:08 aaronpk basically you say "I'm trying to make an image of this size at this zoom level" then go fetch all the images and assemble them in order
# 06:09 aaronpk the thing is most of the time you need to fetch at most 9 images which isn't that bad
# 06:09 GWG aaronpk: Where do you store the rendered images? Or do you just generate them dynamically?
# 06:10 [asuh] aaronpk: I use a shared host for my personal site. It would be okay to generate within the plugin on this shared server?
# 06:11 aaronpk [asuh]: really the only consideration there is making sure the shared host doesn't kill the script that's running to generate the image but most of the time it takes only a second or two so it's well under the limit
# 06:13 [asuh] GWG, could the rendered image be added to the `/uploads/` folder like other images added to WordPress?
# 06:15 GWG aaronpk: Why is attribution only Esri if some of these are not them? Just because of your employment at the time?
# 06:16 GWG [asuh]: I am more tempted to use aaronpk's work as it is PHP.
# 06:19 GWG [asuh]: If I self host that endpoint, separately from my site, and I'm happy, I'll release that code more quickly than using the code as inspiration for writing my own version.
# 06:19 GWG It wouldn't be the first time I did that. And later replaced it with something local
# 06:20 aaronpk It was supposed to default to Esri attribution for those tiles and give you a way to add appropriate attribution if you used other tiles
# 06:20 aaronpk it was 6 years ago, I can't guarantee the quality of that code
# 06:21 GWG aaronpk: All of it, or just the attribution part?
# 06:22 aaronpk I mean the rest is functional enough that it hasn't bothered me since then and it's literally used every day on my website
# 06:31 GWG On that note, it's 2:30am here... I'll fork tomorrow
# 07:25 Loqi GWG has 36 karma in this channel over the last year (139 in all channels)
[tantek] and [KevinMarks] joined the channel
# 08:29 [KevinMarks] Could you run a leaflet on a headless chrome browser to make the static maps (more dependencies, less code than doing it yourself)
computer2000, [tantek], [jgmac1106], nickodd, sknebel, Zegnat, [manton], Kaja_, [chrisaldrich], [jeremycherfas] and JtLively joined the channel; nickodd left the channel
# 18:24 JtLively Hi. I'm helping someone build a new WordPress website that can display other data from a database. What are the pros and cons of using custom tables in the same WordPress database or a separate database with a plugin like CDBT (if another one exists that's up-to-date)?
# 18:30 JtLively Thanks. I asked in #wordpress also but I wanted to ask here since I accidentally found it and am interested in the site now : D
[KevinMarks], [snarfed], [fluffy], [schmarty], [tantek], ben_thatmustbeme, Oclair_, wagle, [tantek]1, shrysr, petermolnar, [fluffy]1, jeremycherfas, marinin[m], justache, sknebel, beko, Ruxton, Kaja, [snarfed]1, GWG, [KevinMarks]1, IWSlackGateway1, Zegnat, dopplerg-, drkokandy, sebsel, mattl, globbot, crazed, aaronpk, [chrisaldrich] and samclarke[m] joined the channel
[KevinMarks] joined the channel