OpenStreetMap

jmapb's Diary

Recent diary entries

Adventures in Punycode

Posted by jmapb on 31 December 2022 in English. Last updated on 4 January 2023.

This year I mapped my first POI with a Punycode website: a Japanese cafe/ice cream shop in Brooklyn called Amai Bā (https://www.openstreetmap.org/node/9795586991).

photo of Amai Bā

The website is https://www.xn–amaib-jwa.com. This was posted via QR code, taped to the shop window before the cafe opened. I’ve been hoping it would reappear on the permanent signage, but nothing so far – possibly because the website is still an empty placeholder.

Punycode https://www.xn–amaib-jwa.com is the agreed standard RFC 3492 way to encode https://www.amaibā.com. This is necessary because the Unicode character ā (a with macron, used mostly in rominisation of non-Latin writing systems) is not part of the letter/digit/hyphen character set supported by DNS, making amaibā.com an Internationalized domain name. Under the hood, xn–amaib-jwa.com is the “real” domain name, but most modern browsers are configured to show the site as amaibā.com.

I found only one other POI with a Punycode website in all of North America: https://www.openstreetmap.org/way/712913728 “7R Events,XV & Bridal Shop & Decor” in Cleburne, Texas, with the website https://www.xn–quinceaerasoutlet-lxb.com – Punycode for https://www.quinceañerasoutlet.com. (Quinceañera is often abbreviated to the Roman number XV, which helps in parsing the name of this business.) That website isn’t live, though. The correct website is https://www.quinceanerasoutlet.com with a standard Latin “n” instead of the eñe. It’s possible that quinceañerasoutlet.com was active at one time, or perhaps there was a typo or overzealous Spanish autocorrect. At any rate, I updated 7R’s website, so as of now Amai Bā is North Americas’s only surviving Punycode website in OSM.

Punycode websites are much more popular abroad, as seen in this Overpass Turbo map (screenshotted before I fixed 7R’s website – the quick-n-dirty query is https://overpass-turbo.eu/s/1pyt):

screenshot of Overpass Turbo map

They’re rare in the Americas, unmapped in Africa and Austrailia… but there are plenty in Europe, encoding Spain’s eñes, France’s accents grave and aigu, Germany’s eszetts and umlauts, Denmark’s æ’s and ø’s, etc. (Spot-checking these revealed a few more examples of incorrect website tags similar to 7R’s in Texas, where the correct url can be found by replacing letters with their plain Latin approximations. If I have time to fix some of these I could boost my number-of-countries-mapped score.)

There are clusters of non-Latin Punycode websites mapped in Ukraine, Belarus, Russia, South Korea, and Japan. There are few to none mapped in other places that feature non-Latin scripts, like China, Greece, and the Middle East.


Unlike DNS, OpenStreetMap itself supports the full Unicode character set, encoded in UTF-8. By convention, all OSM tag names and many tag values use a much smaller subset which excludes any letters that aren’t standard Latin, but website can take Unicode values without problem. Tagging website=https://www.amaibā.com would work just as well as tagging website=https://www.xn--amaib-jwa.com. The browser will convert to Punycode as needed when making network requests, and (normally) back to Unicode for display. (An example in New Zealand: https://www.openstreetmap.org/node/5507224960)

The OSM wiki currently gives no advice on which form is preferred. Both have pros and cons. For Amai Bā I recorded the Punycode because that’s how it was signed (via QR code… some QR encoders and decoders don’t handle Unicode URLs well, so Punycode might be advantageous in that situation.) Offhand it seems that tagging UTF-8 Unicode URLs is much more popular in Europe, slightly more popular in the USA, and slightly less popular in Japan.

By the way – if anyone reading this knows the how to write “Amai Bā” in Japanese, please be a dear and tag it on node 9795586991 under name:jp, thanks!

Happy New Mapping Year, everyone!

Location: Brooklyn Heights, Kings County, New York, United States

Using NYC Dept of Buildings Building Information Search, part 2

Posted by jmapb on 8 April 2022 in English. Last updated on 29 May 2023.

[continued from part 1]

Carrying on with my Brooklyn survey… In the Bushwick neighborhood, I’ve found another new building to map, and a good opportunity to show a little more of NYC’s Building Information Search tool (aka BIS.). Like last time, we’ll start by finding the building’s BIN and height using BIS’s search option 1, with borough Brooklyn, housenumber 618, and street Bushwick Avenue. Here’s the resulting Property Profile Overview page:

BIS Property Profile Overview of 618 Bushwick Avenue

(That exciting red bar means this development is currently in trouble with the Dept of Buildings, but that’s none of my business.) We find the BIN, 3425505. Note the “ALSO SEE OTHER BIN(S) BELOW” message and the “Additional BINs for Building” field – these are older obsolete BINs that this new building has supplanted. The “DOB Building Remarks” note about multiple lots being merged tells the same story, which is a very familiar one in Brooklyn: A large new building has replaced several smaller buildings.

But that story’s not exactly right, in this case. 618 Bushwick Avenue looks like this:

photo of 618 Bushwick Avenue

The church on the corner is the old Saint Mark’s Lutheran, and to the left of it, sporting a “Now Leasing” sign, is Saint Mark’s Lutheran School. Long disused, these structures date from the 1890s when Bushwick was a German neighborhood, and the beer-brewing capital of the East Coast. (Some history and photos can be found at the NYC Chapter of The American Guild of Organists site, a great resource for church building lore.)

On either side of the school building is new construction. But all of this, per both city records and on-the-ground reality, is now one building! The previously-freestanding church and school have not been demolished but instead stitched together along with the new blocky corner on the left, and joined into a single residential building with a single address and BIN. So we’ll find the height (of the church, the tallest part) and map this all as one building footprint.

The downside is that there’s potential confusion for those navigating using an OSM-based map. If the map shows a single building where your eyes see four, you might think you’re in the wrong place. This can be even more disorienting if you’re using a 3D map render that shows building heights – you’ll see tall vertical walls with little resemblance to the actual premises, as in this OSM2world rendering:

OSM2World 3D rendering of 618 Bushwick Avenue

So in addition to the BIN and height, I’ll add some 3D details to this building. Hopefully then, given a sufficiently sophisticated render, the picture will jibe better with reality. Let’s head back to the Property Profile Overview page to see how the public zoning diagrams can help this process. As in Part 1, open the View Zoning Documents link in a new tab:

BIS Job Query By Location

Again, as before, open the job 320374171 link in a new tab to load the Application Details page. But this time we’ll also open the actual zoning documents from the CLICK HERE link, in yet another new tab, to further investigate details of the building.

First, though, a quick glance at the section 13 Building Characteristics from the Application Details tab:

Building Characteristics for 618 Bushwick Avenue

Note the proposed change of occupancy classification from place of assembly to residential. Also note the proposed change in height from 65 to 70 feet, which is surprising because the renovation doesn’t include anything taller than the church building, and the church didn’t grow – in fact, it actually lost the top half of its spire. (The originally imported height of this church splits the difference at 20.5 meters, about 67 feet.)

Maybe we’ll find some clarity by browsing the zoning documents. Click over to that tab:

Zoning Documents for 618 Bushwick Avenue

The good stuff is in the Zoning Diagram ZD1. Often there will be multiple revisions of this document listed, reflecting an evolving building proposal. BIS advises you to use the most recent version, but occasionally the newest is just a quick fix that was printed and modified by hand, then scanned at poor resolution, leaving some info illegible. In these cases it might be useful to look at older versions too.

But we only have a single ZD1 for 618 Bushwick. Open the link (in a new tab! if you’ve gotten this far without BIS timing out on you, buy a lottery ticket) to launch the document viewer:

Zoning Document Viewer

Lovely, but cramped. I recommend downloading the underlying PDF file by clicking the download icon in the toolbar at the top of the viewer box, so you can read it in a native viewer. (And if you want to print, use the print icon in the toolbar, not the “PRINT DOCUMENT” button at the top which will cause the whole page to reload and most likely time out.)

By the way, this PDF lists the old BIN from the church building, instead of the new BIN – don’t use the zoning documents as a BIN reference! It also says 616 Bushwick instead of 618. Larger buildings in NYC usually have one or more ranges of valid housenumbers. Often these alternates are listed in BIS on the initial Property Profile Overview page, but not in this case. (You can see them on the GOAT though – I’ll have to do a diary entry about the GOAT and friends sometime later.) Sometimes a building’s signed address will match neither the BIS Property Profile nor the zoning documents. It’s generally best to tag what’s actually on the building.

Back to the ZD1 PDF… This one, like most, includes three different style building diagrams:

Plot Plan for 618 Bushwick Avenue

The plot plan (sometimes called “site plan”) depicts the site from above and is helpful when mapping building footprints. One interesting thing to observe from this one is that the newly constructed corner ell segment is not square. Its sides parallel Bushwick Avenue and Troutman Street, which don’t meet at a right angle.

It can also give some insight in the heights of the various building parts, which is useful for 3D mapping. This plot plan shows these heights in stories, but does not give actual measurements. Sometimes the plot plan will also show details of adjacent buildings. This one does not, even though the new corner abuts 17 Troutman to the south.

Section diagram for 618 Bushwick Avenue

The section diagrams are vertical slices through the structure. Some good details about the roof structure can be gleaned from these, but it can be frustrating – you’ll soon be wishing for more slices (although this one does have several).

These section diagrams include some vertical measurements, but in this case they don’t actually measure the building. Instead, they show how the building sections conform to the maximum dimensions allowed by zoning regulations.

Another thing to note is the slight differences in ground elevation at different ends of the building. Things are pretty flat around here, but in some places the ground terrain can be a real issue with 3D modelling.

Axonometric diagram for 618 Bushwick Avenue

The axonometric diagram is an isometric birds-eye corner view of the building. Sometimes multiple angles are included; here we only have one.

Note that the previous diagrams specified a scale but this one says “not to scale.” Personally I’d recommend against putting excessive faith in the scale of any of these.

Unlike the previous diagrams, this axonometric diagram includes both the maximum permitted measurements and the actual proposed measurements at various spots around the site. Most important for our mapping purposes is the height of the church roof, listed as 69’ 4½” – yet another contender for the height of the building way. There’s no clear explanation for these height discrepancies – maybe different methods of measurement, different precision requirements, or recomputation of the baseplane – but to me this seems like the most authoritative number, so I’ll round to the nearest tenth of a meter and tag height=21.1.

From this diagram, it looks like this development originally intended to keep the full church steeple – maybe it proved unsalvageable or unsafe. Also, it’s clear that the steeple, even in truncated form, is not included in the building height measurements. It’s listed here as a “non-complying condition.” Similarly, the stair and elevator bulkheads on the Troutman end of the building, described as “permitted obstructions,” are not counted toward the building height even though they’re taller than the peak of the church roof. This is normal for NYC – the tagged height of the approximately one million imported building footprints is to the top of the roofline, not including extras.

Ok, I’ve finally completed the quest for BIN and height. Now, following the Simple 3D Buildings schema, I can add some 3D details so maps can better depict the unusual structure of this building. With the ZD1 diagrams, aerial imagery, and photos from my own site survey I have plenty of source material. Per OSM2World, here’s what I’ve arrived at:

OSM2World 3D rendering of 618 Bushwick Avenue after changes

See also F4map or Streets GL for a browsable 3D view.

Note that even though I’ve settled on 21.1 meters for the overall building height, the building parts representing the steeple and bulkheads are tagged with larger height values, which the 3D map renderers show correctly.

The mobile app Organic Maps shows a 3Dish view that renders the height of building parts but ignores the roof shape tags. The result is nonetheless helpful – it looks somewhat like the actual building:

Organic Maps 3D rendering of 618 Bushwick Avenue after changes

As old Brooklyn churches go, this one’s actually relatively simple in form. But there are many, many more 3D features that could be added, e.g. the roof dormers, buttresses, details of the rectory in the back. One could probably take a whole day and dozens of nodes trying to approximate the portico alone. But I’m not inclined to go too crazy with it. In the past I’ve occasionally mapped tiny 3D details just because I could, but even with good diagrams like these it tends to involve a fair amount of guesswork and feels close to running afoul of the don’t-tag-for-the-renderer ethos. Currently I only add 3D details that I feel are valuable for navigation.

Anyway, the new 618 Bushwick building is way 1047468252. A couple of finishing touches:

  • I went with building=yes rather than a more specific tag. The building tag value should reflect the physical form of the building, and physically this is a Frankenstein monster so no single value would do it justice. Semicolon-separated values for the building tag are in use in some places, but I’m disinclined to try this undocumented tagging technique on a tag that’s in heavy use by software. (I did add building:use=residential though.)
  • Both the church and the school were included in the 2009 GNIS node import. Since these buildings still exist in a sense, I added their gnis:feature_id tags (no problem using a semicolon value here IMO) and merged the original nodes into the new building footprint.

This was a good way to demonstrate the use of BIS’s zoning document trove for 3D mapping – but of course it can also be quite useful in normal 2D mapping, for clarifying height and nailing down details of building footprints. Be aware that the ZD1 diagrams are not always fully accurate – give greater credence to your own survey, or to recent aerial imagery. And some will be of much poorer quality, or might not exist at all, especially for older buildings.

Happy mapping everyone!

Location: Bedford-Stuyvesant, Brooklyn, Kings County, New York, 11216, United States

Using NYC Dept of Buildings Building Information Search, part 1

Posted by jmapb on 11 March 2022 in English. Last updated on 18 March 2022.

To celebrate NYC Open Data Week, a brief introduction to the NYC Department of Buildings Building Information Search tool.

I’ve spotted a new building in Brooklyn that’s missing in OSM. My goal is to add this building to the map, keeping parity with New York City’s established tagging practices for buildings.

NYC had a full import of building footprints in 2013-2014. In addition to building=yes, all buildings were tagged with height (in meters) and nycdoitt:bin (the city’s Building Identification Number, or BIN for short). Buildings with only a single address were also tagged with addr:housenumber, addr:street, and addr:postcode. For buildings with multiple addresses, a node for each address was placed inside the building perimeter.

The building I found has just one address: 1021 Bedford Avenue, 11205. I’ve added the addr: tags, but I’d also like to know the height and BIN so this building will be as well-tagged as those around it. So let’s look it up in the Department of Buildings Building Information Search (BIS for short), which can be found at the following arcane url:

https://a810-bisweb.nyc.gov/bisweb/bispi00.jsp

Here’s the initial search form:

NYC DOB Building Information Search

We’ll use property search mode 1, at the top. Select Brooklyn for the borough, enter the housenumber and street, and click Go, and with any luck a “Property Profile Overview” page will appear:

NYC DOB property overview

There’s a fair amount of info on this page, but the gold nugget here is the BIN, which is on the right side of the blue bar at the top: 3414286. All we need now is the building height. Unfortunately it’s not listed here; we need to go deeper.

Let’s talk about the elephant in the room at this point… this Building Information Search tool is somewhat clunky. Personally I’d love an API that could digest an NYC address and return info like BIN and height in a single call. (If anyone has one, please spill those beans!) The fact that this takes multiple clicks is all the more frustrating because the BIS server is prone to timeouts and overzealous rate limiting. All this to say that, from this point forward, when clicking further into the Building Information Search, I recommend always opening links in a new tab – because it makes it easier to retry (sometimes hours later) when things fail.

Now let’s keep digging for the building height. Open the “View Zoning Documents” link (in a new tab!) to reveal:

NYC DOB zoning jobs list

What we find is not quite zoning documents, but instead a list of DOB application job numbers. Usually, as here, it’s not a long list, just a single job. The information we want – the building height – can be found by by opening the job number link, in this case 321385032 (in a new tab, of course):

NYC DOB job application details

Here are the Application Details for job 321385032, a dense page with a lot of useful info. I’ve zoomed in on section 13 which finally reveals the building height, 63 feet. To be consistent with the rest of the NYC buildings, we convert to meters rounded to the nearest tenth – so height=19.2 and our mission is complete.

The resulting building is way 738676322.

Note that I’ve added building:levels=6 – this is from my own surveyed observations, not from the Building Information Search. (In this case the building stories count on the Application Details page agrees with the survey, but I’ve seen instances where that count did not include the penthouse or ground floor level for some reason.)

I’ve also tagged building=apartments rather than building=yes. I believe building=yes is the correct tag for any building that can’t be unambiguously categorized, but this one is clearly an apartment building. And again, this is my own conclusion from survey, not based on data pulled from the Dept of Buildings.

I’ll describe some other uses for the BIS tool in a later post. Happy Open Data everyone!

Location: Clinton Hill, Brooklyn, Kings County, New York, 11205, United States