February 6, 2023

Changelog: February 5 - Introducing Circles!

After a brief end-of-year pause, welcome back to the Placemark changelog! We've got some good new stuff to introduce.

Drawing circles

This one was requested for a long time: the ability to draw circles. I could write about circles for hours, but I'll try to summarize why circles on maps are a bit odd, and why this feature includes three different kinds of circles.

Placemark is a tool that really embraces open geospatial formats. If you are coming from the world of drawing tools, or even technologies like SVG, the standard for putting graphics in webpages, you might expect those formats to support the idea of a "circle", and be surprised that virtually none of them do. There are a few formats that do support circles, like the tremendously complex GML format, but generally none of the geospatial data types that you'll come across support the idea of a circle - not ESRI Shapefiles, not GeoJSON, or KML, or WKT.

The reason why most formats don't support circles is in part because most formats are based on a meta-format, the Simple Features Standard (brace for PDF link), and most formats only support part of it, and that specification doesn't have circles (though it does have curves). The other reason is that circles are really hard to define.

Placemark's implementation of circle drawing allows for three distinct kinds of circles, but there are certainly more. They are:

  1. Geodesic circles. These have a constant radius in real-world units. If you're taking about a circle with a "one mile radius", then it's a geodesic circle.
  2. Degrees circles. These have a constant radius in decimal degrees, longitude and latitude. Let's say you have a circle with a "one degree radius", then that's a circle in degrees. This is probably the kind of circle you'd make if you were writing an algorithm to make circles - just spinning sine and cosine functions around a circle using some math.
  3. Mercator circles. These circles look like circles on a Mercator map, which is the kind of map that Placemark uses: it uses the Mercator projection. The circles that you can draw in this mode look right, but they don't have any direct relationship to the kind of circle you'd usually talk about - they aren't a "one mile radius" around anything.

In maps using the Web Mercator projection - the kinds of maps that Placemark supports - the circles that have easy definitions, like "a one mile radius", will often look odd, and the circles that look correct and look like circles, don't have such a simple definition. For example, here's a circle placed over Greenland: if you look closely, it's an ellipse, not a perfect circle.

A circle placed over Greenland

You can really dive into this subject by checking out Tissot's Indicatrix(es?), which put circles on common projections to show how each projection deforms the shapes, orientation, and size of circles. Thanks to the Theorema Egregium, we know that this is inevitable and unavoidable as a result of representing a 3D earth as a 2D map, but there are different compromises we can take - different map projections with different kinds of distortion.

And that's how we ended up with a circle drawing tool that supports three different kinds of circles! And, due to the lack of support in the base file formats, those circles are represented by polygons with many nodes.

In Placemark's implementation of circles, those circles keep being the same kind of circle with the same radius when you move them around: if you draw a geodesic circle at the equator with a certain radius, it'll get bigger if you move it north or south, due to the distortion of the Web Mercator projection. You can convert a circle into a polygon, though, by moving one of its nodes while pressing Command, or by deleting its "circle" property.

The "circle" property of a circle

More improvements

CSV import options including a new "polyline" option

You can now import CSV files with encoded polylines! CSV importing has gotten really powerful - 7 different options within the CSV importer. Oh, and this works for Excel files too. And you can now export polylines via the CSV export too - it supports all features with LineString geometries.

The feature table has always supported auto-completion drawn from the existing values of features, but it was previously limited to only the some of the most popular values. It's much improved now - even gigantic datasets with lots of distinct values will now have useful autocomplete in the table interface.

Figma Plugin Changelog

There's plenty new on the Placemark Figma Plugin, too! Since I introduced it last month, it's gained labeling for streets and areas, as well as vastly improved data limits.

Also new is a settings page that lets you copy the generated map's bounding box so you can use it in other tools (like Placemark, which supports zooming to bounding boxes, importing them as rectangles, exporting them, and more). And font size, for the labels, and the ability to go to the relevant area in Google or OSM. Over 1,500 folks have tried it out - it's free on the Figma Community site.

And that's it for this update. Thanks as always for sending suggestions and supporting Placemark, and here's to a happy 2023!