Hacker Newsnew | past | comments | ask | show | jobs | submit | zylepe's commentslogin

Pole of Inaccessibility is also a useful technique for placing the label for a polygon at a visually pleasing location on a map. @mourner came up with a more efficient algorithm for computing the point https://blog.mapbox.com/a-new-algorithm-for-finding-a-visual... (https://github.com/mapbox/polylabel) which JTS's MaximumInscribedCircle utility is based on, which I use for "innermost point" label placement in planetiler.

I haven’t used markdown in javadoc yet but this seems like at least 3/10? I often want to put paragraphs or bulleted lists in javadoc and find myself wanting to use markdown syntax for readability in the code but need to switch to less readable html tags for tooling to render it properly.


Personally it’s fine, I haven’t used it though.

I really wish Javadoc was just plain text that honored line breaks. I really don’t care about the fact I can put HTML in there, that just seems dumb to me. I get you can’t remove it but I would be happy if you could.

I do like markdown. But I don’t see myself ever using it in a Javadoc.


I hate using html in comments.

Markdown in javadoc is at least 7/10 for me. Improves comment readability for humans while allowing formatted javadocs.


I wish C# would add this too. I despise having to write docs in XML style


A friend of mine is on a 25 year running every day streak. He flew to Australia and landed 2 days after taking off and said that day “never existed for him” ¯\_(ツ)_/¯


I like your friend's rule. If a guy literally runs every day, through stress fractures, flu, winter snow, thunderstorms, etc, I'm going to cut him a break on an international flight and continue to celebrate his streak with him.


I’ve stopped at that Lee McDonald’s and remember thinking the price seemed kind of high. Little did I know it was the most expensive in the country. Even the eastbound one across I-90 is $1.40 cheaper!


I’m looking forward to be able to memory-map an entire large file without having to split it up into 2gb segments, and to be able to reliably unmap it when done. So many hacks to work around this lack of functionality today…


Me too! it is funny having done it a few times I got used to it but I would love to get rid of it.


I came up with an approach for placing labels where each gets a min zoom to show up at such that there are no collisions and always appears beyond that. Personally I like the feel of it a lot better, but the downside is that at a given zoom labels are less dense than if they could show/hide to fill in empty spaces. Also, it makes it impossible to dynamically style the labels, or rotate/tilt.

Demo: https://msbarry.github.io/maplibre-minzoom-demo/world


The protomaps basemap is also built on planetiler: https://github.com/protomaps/basemaps - and Brandon is one of the main contributors a to planetiler!


planetiler is such a sophisticated software. Hats off to Michael!

Therefore I'm a bit proud that a tiny part of the fast and memory-efficient import pipeline is using code from GraphHopper :) (see Acknowledgement)


I spent a while optimizing sqlite inserts for planetiler, this is what I came up with:

https://github.com/onthegomap/planetiler/blob/db0ab02263baaa...

It batches inserts into bulk statements and is able to do writes in the 500k+ per second range, and reads are 300-400k/s using those settings.


You’re eliminating the “D” from “ACID” with these settings, and risk data loss on power failure and/or entire database corruption.

I can make a car go really fast if I eliminate the weight of having safety equipment on it like a bumper, seatbelt and airbag.


Which, for this use case - bulk generating a read-only data file from a source dataset in a batch job - seems like a pretty good performance tradeoff, no? In the case of a failure of some kind - no big deal, just restart the process anew.

This is one of those use cases where SQLite isn’t replacing <database> - it’s replacing fopen.


Exactly, this use case is write-once then read-only after that. Random updates to the sqlite file after that would need more “normal” settings, but they wouldn’t also need as much throughput.


It would be nice to have a compendium of SQLite use-cases and their respective configurations.


I built planetiler (https://github.com/onthegomap/planetiler) for this purpose. The output up to z14 is ~80gb and depending on how big of a machine you have it takes from 30 minutes up to a few hours - no DB required, just java or docker. If you are only going to z11-12, it should be quite a bit faster/smaller.

Brandon from Protomaps is also helping add pmtiles output natively to planetiler, so you won't need a conversion step afterwards!


Awesome, will check it out! Thanks for sharing & building this!


You may have chosen Valhalla for other reasons, but FWIW I’ve found Graphhopper can handle 1-2 orders of magnitude more qps than Valhalla on the same hardware.


I wasn't happy with cycling directions in GraphHopper and I was having trouble getting route shapes from its routing endpoint which made it really difficult to plot route polylines on the map. I've also been looking forward to exposing some customization of routing parameters since valhalla allows you to do this fairly trivially. That is good to know, though. Valhalla really is getting hammered by all this traffic. :/


What problems did you face with cycling directions?

Regarding the route shapes I can only guess: we use an encoded polyline as default for a very compact response. You can either disable this or use our JavaScript library, or there is a new UI https://github.com/graphhopper/graphhopper-maps

Regarding routing parameters: our custom_model approach is more powerful than simple parameters and still not complicated: https://www.graphhopper.com/blog/2020/05/31/examples-for-cus... See e.g. the several bike examples and see how to get an world wide instance up and running: https://www.graphhopper.com/blog/2022/06/27/host-your-own-wo...

In recent master you can additionally control how elevation influences your route (e.g. prefer or avoid them entirely or steep sections or similar)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: