Query DB less when finding edge Geometries

Use a Map instead
Merge pull request #385 from agouge/query-less

Query DB less when finding edge Geometries.

Use a Map instead. Should be faster.