whosonfirst / go-whosonfirst-pip-v2

An in-memory point-in-polygon (reverse geocoding) package for GeoJSON data, principally Who's On First data.
BSD 3-Clause "New" or "Revised" License
11 stars 5 forks source link

about the deprecation notice #34

Closed HIRANO-Satoshi closed 3 years ago

HIRANO-Satoshi commented 3 years ago

@straup Hi, I read the soon-to-be-deprecated/superseded notice. Please leave this repo if you do so.

Thanks for your contribution.

thisisaaronland commented 3 years ago

Of course. It will probably be archived (in the GitHub archive sense of the word) unless that will present an operational problem for people.

HIRANO-Satoshi commented 3 years ago

Thanks!

Why have you started the new one? What's the difference?

Should we move to it? We have some modifications.

straup commented 3 years ago

It is an attempt to de-couple the various components that make up go-whosonfirst-pip-v2 – indexing, storage, querying and serving – in to separate packages in order to allow for more flexibility.

Keep in mind that all of the examples that follow are a) actively being worked b) don't work properly in many cases c) poorly documented still.

For example there is a single "base" package that defines database-agnostic but WOF-specific interfaces for spatial queries and reading properties:

Which are then implemented in full or in part by provider-specific classes. For example, SQLite:

This package implements both interfaces which means indexing spatial queries is much faster as are appending "extra" properties (assuming a pre-indexed database generated using the https://github.com/whosonfirst/go-whosonfirst-sqlite-features-index package).

Other packages only implement the spatial interfaces like:

Or the properties reader interfaces like:

Building on that there are equivalent base packages for "server" implementations, like:

The idea is that all of these pieces can be easily combined in to purpose-fit applications. As a practical matter it's mostly about trying to identify and package the common pieces in to as few lines of code as possible so that they might be combined with an application-specific import statement. For example:

import (
         _ "github.com/whosonfirst/go-whosonfirst-spatial-MY-SPECIFIC-REQUIREMENTS"
)

Here is a concrete example, implementing the PIP service over HTTP using a SQLite backend:

It is part of the overall goal of:

For example:

That's the goal, anyway. I am still working through the implementation details.

Functionally the go-whosonfirst-spatial- packages should be equivalent to go-whosonfirst-pip-v2 as in there won't be any functionality removed. If you have specific needs or modifications you'd like to see I would enjoy hearing about them. This is probably the best place to start that conversation: