Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics

I think I know what you mean by awkward. You export all buildings as one object. That's not how GeoJSON works. The MultiPolygon should be split up, one polygon per building. MultiPolygon can be used for a city gate, which has two towers but they're part of the same building really.

There's also something wrong in the MultiPolygon that I can't quite figure out, but QGIS is unable to split it into single parts, which it should be able to do.

Nevertheless, it's a huge step forward, already better results than the svg2json script I wrote for myself.

That was my intention, but apparently there is an error with the way I create multipolygons. As a result, instead of multiple polygons each consisting of a single "ring" (there are no buildings with holes) I create a single polygon consisting of multiple "rings". Too many nested arrays...

Yes, that's what it looks like. I would do one polygon per building. It also makes debugging and editing a LOT easier.




Brilliant! It works now, QGIS can split the multipart into single parts. I can now add the 400 city maps to my game world. :)

(here's what my own conversion script managed: -- you'll see the problems in the town wall, for example).

Question: Do you export parks as well?

I don't see problems with the walls, they look good imo :)

No, I don't export parks atm. Partly because I wanted to keep everything as simple as possible, but also because I haven't figured out yet what is the "best" way to encode some data. Parks don't have their own geometry, they are just wards marked as parks, but I don't export ward data so...

Why not export the ward data? Just as polygons with a "type" field that says "building zone" or "park"? That would be INCREDIBLY useful for zooming in, where at distance only the wards are visible and then they fade into individual buildings as you zoom in, the way Google maps does it. And you could export the ward names that way as well.