#wordpress 2020-07-05

2020-07-05 UTC
[fluffy] and [chrisaldrich] joined the channel
#
[chrisaldrich]
I've replied to James with a hint...
nickodd, GWG_ and [asuh] joined the channel
#
[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?
#
GWG
[asuh]: Those are tiles...I could solve the problem by running my own static map generator.
#
GWG
I am using third-party ones.
#
GWG
OSM has no API for generating a static image
#
[asuh]
What’s the difference between a tile and static image?
#
GWG
Think of the difference between a jigsaw puzzle and a piece of a jigsaw puzzle
#
[asuh]
Is the piece equal to the static image of the whole puzzle?
#
GWG
No.
#
GWG
The only practical way for me to use a tile server would be to do dynamic maps with leaflet.
#
GWG
That would still be polling a server
#
GWG
I could also set up a static map generation service of my own, but that is an expensive endeavor.
#
[asuh]
So let me make sure I understand the problem, here’s what I think I’m reading/hearing:
#
[asuh]
1. Most map makers say please don’t generator static map images that are hosted locally
#
[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
#
GWG
[asuh]: Well, actually, doing #2 would be a violation of TOS as well.
#
GWG
I only use one Map Service at a time.
#
GWG
I just put in 8 of them for redundancy
#
GWG
If one fails, I can switch...but it switches the whole site
#
GWG
As for #1, they don't say please. They say no
#
[asuh]
haha ok
#
GWG
So, the only way is to host your own static map API
#
[asuh]
In a quick search, I found this service on Github that looks good, even if it violates #2 above:
#
Loqi
[katydecorah] staticmapmaker: :earth_asia: Create a Bing, Google, Mapbox, HERE, Yandex, CartoDB, or MapQuest static map.
#
GWG
I think that might do what I do...
#
GWG
It generates the URL for a static map image
#
GWG
But the other service stores it
#
Loqi
[Sebastian Greger] Self-hosting maps: taking control over UX and users' privacy
#
[asuh]
I think my ongoing confusion about generating a static image of a certain part of a map using OSM is the TOS violation.
#
GWG
[asuh]: It isn't. However, the system doing the generating has the limitation
#
GWG
Someday, I will get around to generating it myself.
#
[asuh]
and that limitation is the use of the API to process that data and generate the map image?
#
[asuh]
or is it more than that?
#
GWG
Yes
#
[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
#
GWG
Yes, but even with using their tile server, I'd have to render a static image.
#
GWG
I could self-host aaronpk's Static Maps API for PHP if I wanted to.
#
GWG
But how many users could do that?
#
[asuh]
Is that a big package of PHP files that could included in the plugin? too large?
#
[asuh]
I haven’t looked and didn’t know he was doing that locally
#
GWG
I should ask him about it. He hasn't touched that package in 6 years.
#
[asuh]
You asked:
#
[asuh]
> But how many users could do that?
#
[asuh]
What did you mean by this?
#
GWG
[asuh]: WordPress users installing a self-contained WordPress application
#
aaronpk
Wow has it been that long?
#
aaronpk
It's the code that generates all the maps on my site still
#
[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!
#
[asuh]
or something like that Github repo I linked to above
#
GWG
aaronpk: I know. But should I be generating static maps inside a WordPress plugin?
#
aaronpk
All mine does is assemble 256px square images sourced from elsewhere
#
aaronpk
why not? It's just math
#
aaronpk
"just" ;-)
#
[asuh]
that sounds reasonable and not too server intensive
#
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
#
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.
#
[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?
#
[asuh]
some kind of attribution, that is
#
GWG
[asuh]: Either way, I'd have to adapt aaronpk's code...which I suppose is doable.
#
GWG
Might be easier to run his service though somewhere and have Simple Location work with it
#
[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?
#
GWG
[asuh]: Yes, that and I think just sticking his code inside the plugin wouldn't work. I'd have to adapt it.
#
[asuh]
right, i understand about adapting it. or any other generator you’d include.
#
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
#
[asuh]
I’ll reply to the Github issue and include some of these thoughts
#
GWG
aaronpk: Has anything happened in the last 6 years that you haven't gotten around to doing with that code?
#
GWG
[asuh]: Either way, this would come in stages if I did it
#
aaronpk
Not really no
#
GWG
But will install aaronpk's service and play around
#
aaronpk
so here's the thing, it's not that computationally expensive
#
aaronpk
since the map providers already chop up the tiles at several zoom levels it simplifies the problem a lot
#
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
#
aaronpk
the thing is most of the time you need to fetch at most 9 images which isn't that bad
#
aaronpk
and often it's only 4
#
GWG
aaronpk: Where do you store the rendered images? Or do you just generate them dynamically?
#
[asuh]
aaronpk: I use a shared host for my personal site. It would be okay to generate within the plugin on this shared server?
#
aaronpk
Most of the time I store the generated map image
#
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
#
GWG
Okay, so this may be doable
#
[asuh]
GWG, could the rendered image be added to the `/uploads/` folder like other images added to WordPress?
#
GWG
[asuh]: Easily
#
GWG
aaronpk: Why is attribution only Esri if some of these are not them? Just because of your employment at the time?
#
GWG
[asuh]: I am more tempted to use aaronpk's work as it is PHP.
#
[asuh]
makes sense
#
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.
#
GWG
It wouldn't be the first time I did that. And later replaced it with something local
#
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
#
aaronpk
it was 6 years ago, I can't guarantee the quality of that code
#
GWG
aaronpk: All of it, or just the attribution part?
#
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
#
GWG
On that note, it's 2:30am here... I'll fork tomorrow
#
Loqi
GWG has 36 karma in this channel over the last year (139 in all channels)
[tantek] and [KevinMarks] joined the channel
#
[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
#
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)?
#
aaronpk
you may want to look for a generic wordpress channel, this channel is more about specific indieweb topics https://indieweb.org
#
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
#
boffosocko.com
created /2020/Pop-ups/GettingStartedWithWordPress (+2516) "stub page with date and preliminary details"
(view diff)
[KevinMarks] joined the channel