Skip to content

Conversation

@c-w
Copy link
Contributor

@c-w c-w commented Sep 6, 2017

See #14 for background information on this pull request.

Try it live: http://13.72.77.67/features/name/alto%20de%20lisboa

After running the importer, we have just under 6k new features in the database.
Most of these features come from the centro-poplado datasets and therewith
represent small towns or cities.

features=# select count(*) from features;
 count
 -------
   5879

features=# select count(*), layer from features group by layer order by count desc;
 count |  layer
-------+----------
  4754 | locality
  1093 | county
    32 | region

Unfortunately the Divipola data doesn't give us much additional information on
top of just the name, type and geometry of the features, so additional fields
like population will not be populated in the featureService.

Additionally, this PR also contains fixes for two bugs that were exposed by the
Divipola dataset: lowercasing differences between Postgres and NodeJS and
handling of queries for places with names that contain commas.

@c-w c-w requested review from erikschlegel and timfpark September 6, 2017 11:13
@c-w c-w self-assigned this Sep 6, 2017
Copy link
Contributor

@jcjimenez jcjimenez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

c-w added 3 commits September 7, 2017 09:18
NodeJS and Postgres differ in how they treat characters like diacritics
when lowercasing so we should always lowercase both sides of our
equality check in the same language.

An example to illustrate the differences:

```
+-------------+------------------------------+----------------+
| Environment | Operation                    | Result         |
+-------------+------------------------------+----------------+
| Postgres    | lower('BOGOTÁ, D.C.')        | 'bogotÁ, d.c.' |
| NodeJS      | 'BOGOTÁ, D.C.'.toLowerCase() | 'bogotá, d.c.' |
+-------------+------------------------------+----------------+
```
After running the importer, we have just under 6k new features in the database.
Most of these features come from the centro-poplado datasets and therewith
represent small towns or cities.

```
features=# select count(*) from features;
 count
 -------
   5879

features=# select count(*), layer from features group by layer order by count desc;
 count |  layer
-------+----------
  4754 | locality
  1093 | county
    32 | region
```

Unfortunately the Divipola data doesn't give us much additional information on
top of just the name, type and geometry of the features, so additional fields
like population will not be populated in the featureService.

Resolves #14
@c-w c-w merged commit 503d4b5 into master Sep 7, 2017
@c-w c-w deleted the load-divipola branch September 7, 2017 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants