Skip to content

Commit

Permalink
v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bhousel committed Mar 12, 2023
1 parent 6d87a63 commit 5432065
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 36 deletions.
21 changes: 14 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# What's New

**location-conflation** is an open source project. You can submit bug reports, help out,
or learn more by visiting our project page on GitHub: :octocat: https://github.com/ideditor/location-conflation
or learn more by visiting our project page on GitHub: :octocat: https://github.com/rapideditor/location-conflation

Please star our project on GitHub to show your support! ⭐️

Expand All @@ -13,9 +13,16 @@ _Breaking changes, which may affect downstream projects, are marked with a_ ⚠
##### YYYY-MMM-DD
*
[#xxx]: https://github.com/ideditor/location-conflation/issues/xxx
[#xxx]: https://github.com/rapideditor/location-conflation/issues/xxx
-->

# 1.2.0
##### 2023-Mar-12
* Bump dependency versions
* Switch location-conflation to a scoped package under the rapideditor org: `@rapideditor/location-conflation`
* ⚠️ Note: projects that depend on location-conflation may need to update their code


# 1.1.0
##### 2022-Dec-09
* Update country-coder to v5.1
Expand Down Expand Up @@ -60,7 +67,7 @@ _Breaking changes, which may affect downstream projects, are marked with a_ ⚠
##### 2020-Dec-30
* Perf improvement: Don't union features iteratively with locationReducer ([#26])

[#26]: https://github.com/ideditor/location-conflation/issues/26
[#26]: https://github.com/rapideditor/location-conflation/issues/26


# 0.6.0
Expand Down Expand Up @@ -88,9 +95,9 @@ _Breaking changes, which may affect downstream projects, are marked with a_ ⚠
* Include `stringify` convenience method
* Update country-coder and other dependencies

[#20]: https://github.com/ideditor/location-conflation/issues/20
[#2]: https://github.com/ideditor/location-conflation/issues/2
[#1]: https://github.com/ideditor/location-conflation/issues/1
[#20]: https://github.com/rapideditor/location-conflation/issues/20
[#2]: https://github.com/rapideditor/location-conflation/issues/2
[#1]: https://github.com/rapideditor/location-conflation/issues/1


# 0.3.0
Expand All @@ -104,7 +111,7 @@ _Breaking changes, which may affect downstream projects, are marked with a_ ⚠
* Use wikidata identifiers as the country coder feature ids and cache keys now
* Update country-coder dependency

[#4]: https://github.com/ideditor/location-conflation/issues/4
[#4]: https://github.com/rapideditor/location-conflation/issues/4


# 0.2.0
Expand Down
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![build](https://github.com/ideditor/location-conflation/workflows/build/badge.svg)](https://github.com/ideditor/location-conflation/actions?query=workflow%3A%22build%22)
[![npm version](https://badge.fury.io/js/%40ideditor%2Flocation-conflation.svg)](https://badge.fury.io/js/%40ideditor%2Flocation-conflation)
[![build](https://github.com/rapideditor/location-conflation/workflows/build/badge.svg)](https://github.com/rapideditor/location-conflation/actions?query=workflow%3A%22build%22)
[![npm version](https://badge.fury.io/js/%40rapideditor%2Flocation-conflation.svg)](https://badge.fury.io/js/%40rapideditor%2Flocation-conflation)


# location-conflation
Expand All @@ -15,7 +15,7 @@ including and excluding other locations and shapes.
It is useful for generating geofences in a declarative way, so your application doesn't need
to bundle or fetch so much geodata.

⚡️ Try it now!: https://ideditor.github.io/location-conflation/
⚡️ Try it now!: https://location-conflation.com/


You can define a *locationSet* as an Object with `include` and `exclude` properties:
Expand All @@ -28,7 +28,7 @@ const locationSet = {

The "locations" can be any of the following:

- Strings recognized by the [country-coder library](https://github.com/ideditor/country-coder#readme).<br/>
- Strings recognized by the [country-coder library](https://github.com/rapideditor/country-coder#readme).<br/>
These include [ISO 3166-1 2 or 3 letter country codes](https://en.wikipedia.org/wiki/List_of_countries_by_United_Nations_geoscheme), [UN M.49 numeric codes](https://en.wikipedia.org/wiki/UN_M49), and supported Wikidata QIDs.<br/>
_Examples: `"de"`, `"001"`, `"conus"`, `"gb-sct"`, `"Q620634"`_<br/>
👉 A current list of supported codes can be found at <https://ideditor.codes>
Expand All @@ -46,15 +46,15 @@ The "locations" can be any of the following:

### Use in Node

`npm install @ideditor/location-conflation`
`npm install @rapideditor/location-conflation`

**location-conflation** is distributed in CJS and ESM module formats for maxmimum compatibility. ([Read more about Javascript module formats](https://dev.to/iggredible/what-the-heck-are-cjs-amd-umd-and-esm-ikm))


```js
const LocationConflation = require('@ideditor/location-conflation').default; // require CJS
const LocationConflation = require('@rapideditor/location-conflation').default; // require CJS
// or
import LocationConflation from '@ideditor/location-conflation'; // import ESM
import LocationConflation from '@rapideditor/location-conflation'; // import ESM
```


Expand All @@ -65,7 +65,7 @@ You can also use **location-conflation** directly in a web browser. A good way
When you load this file in a `<script>` tag, you'll get a `LocationConflation` global to use elsewhere in your scripts:
```html
<head>
<script src="https://cdn.jsdelivr.net/npm/@ideditor/[email protected]/dist/location-conflation.iife.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@rapideditor/[email protected]/dist/location-conflation.iife.min.js"></script>
</head>
<script>
Expand All @@ -80,7 +80,7 @@ When you load this file in a `<script>` tag, you'll get a `LocationConflation` g

## Examples
```js
const LocationConflation = require('@ideditor/location-conflation').default;
const LocationConflation = require('@rapideditor/location-conflation').default;
const myFeatures = require('./path/to/FeatureCollection.json'); // optional
const loco = new LocationConflation(myFeatures);
```
Expand All @@ -90,30 +90,30 @@ const loco = new LocationConflation(myFeatures);
const locationSet = { include: ['039'] }; // 039 = Southern Europe
const result = loco.resolveLocationSet(locationSet);
```
<img width="800px" alt="Southern Europe" src="https://raw.githubusercontent.com/ideditor/location-conflation/main/docs/images/example1.png"/>
<img width="800px" alt="Southern Europe" src="https://raw.githubusercontent.com/rapideditor/location-conflation/main/docs/images/example1.png"/>


#### Southern Europe and Northern Africa:
```js
const locationSet = { include: ['039','015'] }; // 015 = Northern Africa
const result = loco.resolveLocationSet(locationSet);
```
<img width="800px" alt="Southern Europe and Northern Africa" src="https://raw.githubusercontent.com/ideditor/location-conflation/main/docs/images/example2.png"/>
<img width="800px" alt="Southern Europe and Northern Africa" src="https://raw.githubusercontent.com/rapideditor/location-conflation/main/docs/images/example2.png"/>


#### Southern Europe and Northern Africa, _excluding_ Egypt and Sudan:
```js
const locationSet = { include: ['039','015'], exclude: ['eg','sd'] };
const result = loco.resolveLocationSet(locationSet);
```
<img width="800px" alt="Southern Europe and Northern Africa, excluding Egypt and Sudan" src="https://raw.githubusercontent.com/ideditor/location-conflation/main/docs/images/example3.png"/>
<img width="800px" alt="Southern Europe and Northern Africa, excluding Egypt and Sudan" src="https://raw.githubusercontent.com/rapideditor/location-conflation/main/docs/images/example3.png"/>


#### The Alps, _excluding_ Liechtenstein and regions around Bern and Zürich
```js
const result = loco.resolveLocationSet({ include: ['alps.geojson'], exclude: ['li', [8.55,47.36], [7.45,46.95]] });
```
<img width="800px" alt="The Alps, excluding Liechtenstein and regions around Bern and Zürich" src="https://raw.githubusercontent.com/ideditor/location-conflation/main/docs/images/example4.png"/>
<img width="800px" alt="The Alps, excluding Liechtenstein and regions around Bern and Zürich" src="https://raw.githubusercontent.com/rapideditor/location-conflation/main/docs/images/example4.png"/>


&nbsp;
Expand Down Expand Up @@ -157,7 +157,7 @@ Each feature *must* have a filename-like `id`, for example: `new_jersey.geojson`
<a name="validateLocation" href="#validateLocation">#</a> <i>loco</i>.<b>validateLocation</b>(<i>location</i>)

Validates a given location. The "locations" can be:
- Strings recognized by the [country-coder library](https://github.com/ideditor/country-coder#readme). <br/>
- Strings recognized by the [country-coder library](https://github.com/rapideditor/country-coder#readme). <br/>
👉 A current list of supported codes can be found at <https://ideditor.codes><br/>
_Examples: `"de"`, `"001"`, `"conus"`, `"gb-sct"`, `"Q620634"`_

Expand Down Expand Up @@ -295,7 +295,7 @@ Convenience method to access the internal feature `_cache`. You probably should
### Installing

* Clone this project, for example:
`git clone [email protected]:ideditor/location-conflation.git`
`git clone [email protected]:rapideditor/location-conflation.git`
* `cd` into the project folder,
* Run `npm install` to install libraries

Expand All @@ -308,7 +308,7 @@ Convenience method to access the internal feature `_cache`. You probably should
### Thanks!

**location-conflation** is really just a wrapper around these other great projects:
* [country-coder](https://github.com/ideditor/country-coder) for world boundaries, and
* [country-coder](https://github.com/rapideditor/country-coder) for world boundaries, and
* [polygon-clipping](https://github.com/mfogel/polygon-clipping) for union/difference functions


Expand Down
12 changes: 6 additions & 6 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<script src='https://api.tiles.mapbox.com/mapbox-gl-js/v1.13.1/mapbox-gl.js'></script>
<script defer src='https://kit.fontawesome.com/c772610440.js' crossorigin='anonymous'></script>
<script defer src='https://cdn.jsdelivr.net/npm/[email protected]/dist/index.min.js'></script>
<script defer src='https://cdn.jsdelivr.net/npm/@ideditor/[email protected]/dist/location-conflation.iife.min.js'></script>
<script defer src='https://cdn.jsdelivr.net/npm/@rapideditor/[email protected]/dist/location-conflation.iife.min.js'></script>
<!-- <script defer src='../dist/location-conflation.iife.js'></script> -->
<link href='https://api.tiles.mapbox.com/mapbox-gl-js/v1.13.1/mapbox-gl.css' rel='stylesheet'/>
<link href='style.css' rel='stylesheet' type='text/css'/>
Expand All @@ -29,7 +29,7 @@
<div id='sidebar' class='hasRows'>

<div id='loco' class='section'>
<p>Paste a locationSet:<a href='https://github.com/ideditor/location-conflation/blob/main/README.md#location-conflation' target='_blank' style='font-size: smaller; margin-left: 70px'>What's this?</a></p>
<p>Paste a locationSet:<a href='https://github.com/rapideditor/location-conflation/blob/main/README.md#location-conflation' target='_blank' style='font-size: smaller; margin-left: 70px'>What's this?</a></p>
<textarea autofocus id='loco-textarea' name='loco-textarea' rows='5'>
{ include: ['de', 'cz', 'pl'] }
</textarea>
Expand Down Expand Up @@ -67,7 +67,7 @@ <h3>Try these!</h3>
<div class='icon'><i class='fas fa-file-code fa-lg'></i></div>
</div>
<div id='octocat'>
<a href='https://github.com/ideditor/location-conflation' target='_blank'>
<a href='https://github.com/rapideditor/location-conflation' target='_blank'>
<i class='fab fa-github fa-2x'></i>
</a>
</div>
Expand Down Expand Up @@ -201,7 +201,7 @@ <h3>Try these!</h3>
} else if (qs.referrer === 'nsi') {
_fcPromise = fetch('https://cdn.jsdelivr.net/gh/osmlab/name-suggestion-index@main/dist/featureCollection.min.json');
} else if (qs.referrer === 'ii') {
_fcPromise = fetch('https://cdn.jsdelivr.net/gh/ideditor/imagery-index@main/dist/featureCollection.min.json');
_fcPromise = fetch('https://cdn.jsdelivr.net/gh/rapideditor/imagery-index@main/dist/featureCollection.min.json');
} else {
_fcPromise = Promise.resolve({ ok: true, json: function() { return {}; } }); // fake response
}
Expand Down Expand Up @@ -397,8 +397,8 @@ <h3>Try these!</h3>
}

// Display the emoji flag
// https://github.com/ideditor/country-coder/issues/25
// https://github.com/ideditor/country-coder/issues/26
// https://github.com/rapideditor/country-coder/issues/25
// https://github.com/rapideditor/country-coder/issues/26
var overrideFlag = {
Q21: '🏴󠁧󠁢󠁥󠁮󠁧󠁿', // GB-ENG (England)
Q22: '🏴󠁧󠁢󠁳󠁣󠁴󠁿', // GB-SCT (Scotland)
Expand Down
2 changes: 1 addition & 1 deletion index.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as CountryCoder from '@ideditor/country-coder';
import * as CountryCoder from '@rapideditor/country-coder';

import calcArea from '@mapbox/geojson-area';
import circleToPolygon from 'circle-to-polygon';
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@ideditor/location-conflation",
"version": "1.1.0",
"name": "@rapideditor/location-conflation",
"version": "1.2.0",
"license": "ISC",
"repository": "github:ideditor/location-conflation",
"repository": "github:rapideditor/location-conflation",
"contributors": [
"Bryan Housel <[email protected]> (https://github.com/bhousel)"
],
Expand Down Expand Up @@ -39,16 +39,16 @@
},
"dependencies": {
"@aitodotai/json-stringify-pretty-compact": "^1.3.0",
"@ideditor/country-coder": "^5.1.0",
"@mapbox/geojson-area": "^0.2.2",
"@rapideditor/country-coder": "^5.2.0",
"circle-to-polygon": "^2.2.0",
"geojson-precision": "^1.0.0",
"polygon-clipping": "~0.15.3"
},
"devDependencies": {
"c8": "^7.13.0",
"esbuild": "^0.17.10",
"eslint": "^8.35.0",
"esbuild": "^0.17.11",
"eslint": "^8.36.0",
"npm-run-all": "^4.1.5",
"shx": "^0.3.4",
"tap": "^16.3.4"
Expand Down

0 comments on commit 5432065

Please sign in to comment.