<div dir="ltr"><div>My colleague who is finishing a phd in precisely this database maping (historical comparison of street network) also recommands using Area(Intersection(A,B)) / area(Union(A,B)).<br><br></div><div>It is certainly a best solution.<br>
Cheers,<br></div>Rémi-C<br><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-09-01 23:56 GMT+02:00 Paul Ramsey <span dir="ltr"><<a href="mailto:pramsey@cleverelephant.ca" target="_blank">pramsey@cleverelephant.ca</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">My favourite "are polygons the same" test is the ratio of the<br>
Intersection(A,B) over Union(A,B). If they are identical, the ratio<br>
will be 1. If they are disjoint, the ratio will be 0. If you choose a<br>
fairly high ratio, you should get polygons that are very much the<br>
same, thus allowing for minor errata and slop.<br>
<br>
SELECT <a href="http://a.id" target="_blank">a.id</a> AS old_id, <a href="http://b.id" target="_blank">b.id</a> AS new_id<br>
FROM old_shapes a<br>
JOIN new_shapes b<br>
ON ST_Intersects(a.geom, b.geom)<br>
WHERE ST_Area(ST_Intersection(a.geom, b.geom)) /<br>
ST_Area(ST_Union(a.geom, b.geom)) > 0.95;<br>
<br>
P<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
On Sat, Aug 23, 2014 at 10:54 PM, Clifford Snow <<a href="mailto:clifford@snowandsnow.us">clifford@snowandsnow.us</a>> wrote:<br>
> I had considered using addressing data to give each footprint a unique id,<br>
> but yours does the same with one less step.  i'm going to try Rémi-C<br>
> solution as well.<br>
><br>
> Thanks<br>
><br>
><br>
> On Sat, Aug 23, 2014 at 3:51 AM, David Siegel <<a href="mailto:david.siegel@artcom.de">david.siegel@artcom.de</a>><br>
> wrote:<br>
>><br>
>> Hi Clifford<br>
>><br>
>> just a quick saturday morning thought: One approach is to use a hash<br>
>> function like SHA256. To get started I’d try something like this:<br>
>><br>
>> 1. For each footprint get a text representation of the geometry<br>
>> 2. Compute and store the SHA256[1] hash of the text representation<br>
>> 3. Find those hash values that are unique to the new footprint table<br>
>><br>
>> Note that you can influence the result by changing the text<br>
>> representation. Using a sorted list of just the coordinates for example<br>
>> ignores any changes in topology, &c. To speed things up just add an index on<br>
>> the hash column.<br>
>><br>
>> Cheers,<br>
>><br>
>> d<br>
>><br>
>> [1] <a href="http://www.postgresql.org/docs/8.3/static/pgcrypto.html" target="_blank">http://www.postgresql.org/docs/8.3/static/pgcrypto.html</a><br>
>><br>
>> On 23.08.2014, at 00:49, Clifford Snow <<a href="mailto:clifford@snowandsnow.us">clifford@snowandsnow.us</a>> wrote:<br>
>><br>
>> > The city of Seattle published a new shapefile with the latest building<br>
>> > footprints. The previous file was from 2009. I'd like to find which outlines<br>
>> > have changed. While I can see the differences using QGIS, what I need is a<br>
>> > list of changed or new building footprints. I'm struggling where to start.<br>
>> > There are about 300K footprints. The city did not retain any unique ids from<br>
>> > the previous file to the new.<br>
>> ><br>
>> > Any suggestions would be appreciated.<br>
>> ><br>
>> > Thanks,<br>
>> > Clifford<br>
>> ><br>
>> > --<br>
>> > @osm_seattle<br>
>> > <a href="http://osm_seattle.snowandsnow.us" target="_blank">osm_seattle.snowandsnow.us</a><br>
>> > OpenStreetMap: Maps with a human touch<br>
>> > _______________________________________________<br>
>> > postgis-users mailing list<br>
>> > <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
>> > <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
>><br>
>> _______________________________________________<br>
>> postgis-users mailing list<br>
>> <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
>> <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
><br>
><br>
><br>
><br>
> --<br>
> @osm_seattle<br>
> <a href="http://osm_seattle.snowandsnow.us" target="_blank">osm_seattle.snowandsnow.us</a><br>
> OpenStreetMap: Maps with a human touch<br>
><br>
> _______________________________________________<br>
> postgis-users mailing list<br>
> <a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a></div></div></blockquote></div><br></div>