Better HN
topnewbestaskshowjobs
Log inSign up

westnordost

66 karma · joined Jun 19, 2021 (5y ago) · 26 submissions

Submissions

comment 2mo ago · link · parent

It is a multiplatform app with one codebase, compiling to both iOS or Android.

comment 2mo ago · link · parent

This has been the most controversial quest in StreetComplete for a while. Following several discussions about it, I have now removed it for the upcoming version (i.e. v64.0).

comment 2mo ago · link · parent

I can't compare it to Flutter, I haven't used it.

comment 2mo ago · link · parent

Alright, let's see:

> KMP stability

Regarding moving parts in KMP, I have the impression that it is quite stable now, and has been for some time. I feel it is less maintenance work than having an Android project that uses the Android UI framework and system APIs. Google loves to deprecate and invent new APIs every few years. I feel there is very little in the way of breaking changes that need changes in the code in KMP. Most of that comes from some third party libraries on major new versions. The biggest change recently was a change in the Android Gradle plugin that required to change the project structure. Arguably, that again was more of an Android than a KMP thing.

> iOS developers

Well, the app is Kotlin Multiplatform + Compose Multiplatform as UI framework. So, while it runs on iOS, the parts that would feel native to an iOS dev are near zero: There are about 50 lines of code in Swift in the project and about 1000 dealing with iOS APIs, but written in Kotlin.

As Kotlin and Compose is used in Android development, the project will always feel more accessible to Android developers. That said, Kotlin is somewhat similar to Swift and Compose is also a declarative reactive user interface framework, i.e. similar to SwiftUI. As for the setup, they need at least IntelliJ/Android Studio to compile all that Kotlin to native code before launching the app from XCode in a simulator. That's my setup at least. Certainly one could also just use gradle (the build system) from the commandline.

> KMP bugs

KMP bugs, none that I remember. About platform-specific issues we will see what will surface during the beta test. So far, one thing surfaced, but it was found easily and necessitated changing 4 lines of code.

Compose (the UI framework) is a different matter. At times, I feel it is quite unwieldy when not solving standard problems. Being designed primarily by Google, I also find that best practices change and deprecations happen fairly frequently. Certain features lacking in Compose Multiplatform I need to implement myself. For example, there are still no scroll bars.

> Coding Agents

I have little experience with that, but what I have seen, the agents have no problem generating working code for the platform-specific parts of the implementation. Some un-slopping is necessary as always.

And, as I wrote, the platform specific code takes up a tiny part of the whole code base. Of the 80k lines of source code in the production code, 2k lines of source code are platform specific.

comment 2mo ago · link · parent

For the web, I personally like https://osmapp.org

https://cartes.app I can also recommend.

Both projects have a similar goal, to offer a more useful UI around using an OSM based map.

comment 2mo ago · link · parent

Have you tried out the Things or Places overlay? Second button from the right at the top, looks like a cake.

comment 2mo ago · link · parent

Overall, my experience has been pretty smooth. Just look at how little platform specific code is found in the streetcomplete repo and how straightforward these connect with the common code.

Or maybe I have been using it too long so that I don't notice the awkward bits anymore.

Any specific parts you are after?

comment 2mo ago · link · parent

In this case, the intended flow is that you tap "Uh..." -> "Differs along the way..."

You will then be led to another UI in which you can split the road into several sections.

comment 2mo ago · link · parent

There is an undo button on the lower left corner of the screen. Try it!

(It only shows edits made in the last 24 hours IIRC, but this limit is chosen quite arbitrarily. If there is a use case for it, it can be extended.)

comment 2mo ago · link · parent

As far as I know, yes. However, it was not quite adjacent but rather within the military base.

https://www.openstreetmap.org/?mlat=27.10983&mlon=57.08475&z...

After first looking at the map, I was quite surprised as it wasn't mentioned in the news.

Why is a school basically located on a military area, and not in a residential area?

comment 5mo ago · link · parent

It works offline, for one. A lot of datais kept persistently in a SQLite database.

comment 5mo ago · link · parent

Well, sort of. That'd be very bluesky. What's closer, actually, would be a desktop version, or rather, a version for Linux mobile like postmarketOS (would run like a desktop app in a JVM, but for a mobile target, the layout and UX wouldn't need to be changed.

comment 5mo ago · link · parent

When you are out of quests in your area, check the overlays! (Button to the left of the menu)

comment 5mo ago · link · parent

In my opinion, gamification that makes one addictive is very unethical.

So, any measure that aims at keeping users engaged (as the duolingo icon for example) should be viewed cautiosly.

Also, specifically with apps with which people provide real data, the more they see it as a game, the more the system will be gamed. When users start to guess, without really confirming it on-site, this leads to outright incorrect data.

What's fine, in my book, is to make the experience more gratifying, more "fun". That's probably what you meant, with firework animation etc.. The progress bars however already fall somewhat in the former category.

By the way, edits are accepted immediately. There is no verification step by the community (just like in wikipedia), all the more important it is that people don't start seeing it as a game first and as a way to contribute to a libre map second.

comment 5mo ago · link · parent

In regards to your edit: Yes, this is exactly correct.

comment 1y ago · link · parent

The bitmap approach you describe allows for immediate (i.e. O(1) ) lookup of region by coordinate, which is pretty neat. Space-efficiency-wise, a bitmap (+ index that maps color to country) might not be the most efficient data structure, though, as there are more than 256 countries, so you already need 16 bits for each pixel instead of 8. Then, you have the additional complexity of if you actually want the bitmap to be viewable by humans, you need to make sure that the colors for neighbouring countries at least are sufficiently distinct.

Anyway, a Kotlin library I wrote uses a similar technique to make requests for the majority of locations immediate, while also handling the edge cases - i.e. when querying a location near a border.

https://github.com/westnordost/countryboundaries (also available in Rust)

What it does is to slice up the input geometry (e.g. a GeoJson) into many small cells in a raster. So, when querying for a location, one doesn't need to do point-in-polygon checks for potentially huge polygons, but just for those little slices that are in the cell one is querying for. And of course, if a country completely covers a cell, we don't even need to do any point-in-polygon check anymore. All this slicing is done in a preprocessing step, so the actual library consumes a serialized data structure that is already in this sliced-up format.

I needed it to be fast because in my app I display a lot of POIs on the map for which there is logic that is dependent on in which country/state the POI is located.

comment 2y ago · link · parent

Are you thinking of certain secondary libraries in particular?

comment 2y ago · link · parent

You probably mean Compose Multiplatform?

That is a fork, or rather, extension to Jetpack Compose, Google's declarative UI framework for Android. It uses Skia for rendering but has an the identical API to Jetpack Compose, hence from the point of view of a framework user, there is nothing new about it (other than that it works on Android, iOS, desktop OSs and web).

comment 2y ago · link · parent

Regarding data mining tools for OpenStreetMap, there is also a tool with which one can use SPARQL syntax. This means that one could conflate data with wikidata or other data sources easily, too:

QLever: https://qlever.cs.uni-freiburg.de/osm-planet

Actually, there are two. Sophox is around for longer:

Sophox: https://sophox.org/

comment 4y ago · link · parent

The most accessible general-purpose map app for end users (Android and iOS) is written in C/C++. This is pretty high on the cool and useful scale: https://organicmaps.app/

Both map renderers Tangram-ES and Maplibre-GL - https://github.com/tangrams/tangram-es and - https://github.com/maplibre/maplibre-gl-native are also written in C/C++.

Finally, most routing software, such as OSRM or Valhalla are written in C/C++.

comment 4y ago · link · parent

Just for context, here is the current OSM data model in a nutshell:

There are three data types - nodes, ways and relations. All of the three can have any number of "tags" (i.e. a map<string, string>), which define their semantic meaning. For example, a way with `barrier=fence` is a fence. This stuff is documented in the openstreetmap wiki.

A node is a point with a longitude and a latitude.

A way is a sequence of nodes.

A relation is a collections of any number of nodes, ways or other relations. Each member of this collection can be assigned a "role" (string). Again, the semantics of what each role means is documented in the openstreetmap wiki.

To modify data, simply new versions of the edited data are uploaded via the API.

---

The most prominent point that stands out here is that only nodes have actual geometry.

This means that...

1. to get the geometry of a way (e.g a building, a road, a landuse, ...), data users first need to get the locations of all the nodes the way references. For relations, it is even one more step.

2. in order to edit the course of a way, editors actually edit the location of the nodes of which the way consists of, not the way itself. This means (amongst other things) that the VCS history of that way does not contain such changes

comment 5y ago · link · parent

Where the SDK pulls its data from is not hardcoded.

The SDK is just a library, used to render vector map tiles, usually in the MVT-format: https://docs.mapbox.com/vector-tiles/specification/

Most maps rendered with such an SDK are based on OpenStreetMap data.

comment 5y ago · link · parent

If it is true that Apple will soon drop OpenGL and only support Metal:

Will the SDK also work on iOS and Mac then, i.e. has Metal support?

comment 5y ago · link · parent

(Author here:) I got many emails about new patrons/sponsors yesterday and was astonished where this was all coming from, now I know!

Thank you for posting this and thank you all for your support! This helps me a lot to find the time to maintain the app, in general a kind of work that I think is often underestimated, also in terms of time invested.

For example, Google recently kicked the app out of their app store for spurious reasons so I had to act quickly to get it back ASAP. I kept track of the issue (and am still updating it, it's not over yet) here:

https://github.com/streetcomplete/StreetComplete/issues/2909

This may be an interesting read and shed some light on how the Google Play Store team works and handles policy violations and appeals.

comment 5y ago · link · parent

Doesn't it run in anbox?

comment 5y ago · link · parent

(Author here:) I too wish there could be an iOS version one day and it is also theoretically possible to do this, i.e. share code between the iOS version and the native Android version. The issue is, that the intial effort to do this is enormous and then, there'd need to be a maintainer for the finished (and continuously extended) version too.

See here for more information, especially for iOS programmers this might be interesting: https://github.com/streetcomplete/StreetComplete/issues/1892