[OSM-dev] Determining if two linestrings are "similar"

Paweł Paprota ppawel at fastmail.fm
Fri Jan 4 18:55:03 GMT 2013

On 01/04/2013 07:44 PM, Tom MacWright wrote:
> How about rendering the lines at z16 in black with no antialiasing
> and comparing the results? After that, you can cache the hash of the
> image and compare it to additional lines. If you want to get really
> fancy, you could even pack them into bits and compare the hamming
> weight of the difference.

Yeah, I thought about using PostGIS raster features for doing that.

Looking at raster docs[1] it should be as simple as doing ST_AsRaster on
the geometry, then some rescaling and comparing the two.

[1] http://postgis.net/docs/manual-dev/RT_reference.html


More information about the dev mailing list