Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Mostly a clone of osmlab/osm-community-index
  • Loading branch information
bhousel committed Feb 24, 2020
0 parents commit 834b2f7
Show file tree
Hide file tree
Showing 28 changed files with 1,240 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
trim_trailing_whitespace = true
insert_final_newline = true

# for ESLint
[*.js]
end_of_line = lf

[*.{js,json,css,html}]
indent_style = space
indent_size = 2
13 changes: 13 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"env": {
"node": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "script"
},
"extends": [
"eslint:recommended"
]
}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/.nyc_output/
/coverage/
/node_modules/

.DS_Store
npm-debug.log
package-lock.json
11 changes: 11 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/.nyc_output/
/.tx/
/coverage/
/node_modules/
/test/

.DS_Store
.travis.yml
npm-debug.log
package-lock.json
RELEASE.md
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: node_js
node_js:
- "10"
- "12"
9 changes: 9 additions & 0 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[main]
host = https://www.transifex.com
minimum_perc = 1

[id-editor.community]
file_filter = i18n/<lang>.yaml
source_file = i18n/en.yaml
source_lang = en
type = YAML
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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/imagery-index

Please star our project on GitHub to show your support! :star:

_Breaking changes, which may affect downstream projects, are marked with a_ :warning:


<!--
# A.B.C
##### YYYY-MMM-DD
*
[#xxx]: https://github.com/ideditor/location-conflation/issues/xxx
-->

153 changes: 153 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
## Contributing

*If you don't understand the explanation below, feel free to [post an Issue](https://github.com/ideditor/imagery-index/issues) to describe your imagery sources. That page contains some pointers to help you fill in all the info we need. You do need [a Github account](https://github.com/join) to be able to post an Issue.*

There are 2 kinds of files in this project:

* Under `sources/` there are `.json` files to describe the imagery sources
* Under `features/` there are custom `.geojson` files

### tl;dr

To add your imagery source to the index:

* Add source `.json` files under the `sources/` folder
* Each file contains info about what the source is (slack, forum, mailinglist, facebook, etc.)
* Each file also contains info about which locations the source is active. The locations can be country or region codes, points, or custom `.geojson` files in the `features/*` folder.
* You can copy and change an existing file to get started.
* run `npm run test`
* This will check the files for errors and make them pretty.
* If you don't have Node installed, you can skip this step and we will do it for you.
* If there are no errors, submit a pull request.


### Installing

* Clone this project, for example:
`git clone git@github.com:ideditor/imagery-index.git`
* `cd` into the project folder,
* Run `npm install` to install libraries


### Sources

These are `*.json` files found under the `sources/` folder.
Each source file contains a single JSON object with information about the imagery source.

Source files look like this:

```js
{
"id":
"type":
"locationSet": { "include": ["us"] }
"name":
"description":
"extendedDescription":
"url":
}
```

Here are the properties that a source file can contain:

* __`id`__ - (required) A unique identifier for the source.
* __`type`__ - (required) Type of imagery source, one of `tms` or `wms`.
* __`locationSet`__ - (required) Where the imagery source is active (see below for details).
* __`name`__ - (required) Display name for this imagery source
(in English, will be sent to Transifex for translation to other languages)
* __`description`__ - (required) One line description of the imagery source
(in English, will be sent to Transifex for translation to other languages)
* __`extendedDescription`__ - (optional) Longer description of the imagery source
(in English, will be sent to Transifex for translation to other languages)
* __`url`__ - (required) A url template for the imagery source


#### locationSet

Each source must have a `locationSet` to define where the source is active.

```js
"locationSet": {
"include": [ Array of locations ], // required
"exclude": [ Array of locations ] // optional
}
```

The "locations" can be any of the following:
* Codes recognized by the [country-coder library](https://github.com/ideditor/country-coder#readme). These should be [ISO 3166-1 2 or 3 letter country codes or UN M.49 numeric codes](https://en.wikipedia.org/wiki/List_of_countries_by_United_Nations_geoscheme).<br/>_Example: `"de"`_
* Points as `[longitude, latitude]` coordinate pairs. A 25km radius circle will be computed around the point.<br/>_Example: `[8.67039, 49.41882]`_
* Filenames for `.geojson` features. If you want to use your own features, you'll need to add these under the `features/` folder. Each `Feature` must have an `id` that ends in `.geojson`.<br/>_Example: `"de-hamburg.geojson"`_<br/>Tip: You can use [geojson.io](http://geojson.io) or other tools to create these.

See [location-conflation](https://github.com/ideditor/location-conflation#readme) project for details and examples.


### Features

These are optional `*.geojson` files found under the `features/` folder. Each feature file contains a single GeoJSON `Feature` for a region where a imagery source is active.

Feature files look like this:

```js
{
"type": "Feature",
"id": "boston_metro.geojson",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [...]
}
}
```

Note: A `FeatureCollection` containing a single `Feature` is ok too - the build script can handle this.

There are many online tools to create or modify these `.geojson` files.
Drawing a simple shape with [geojson.io](http://geojson.io) works great.


### Building

* Just `npm run test`
* This will check the files for errors and make them pretty.


### Translations

All imagery sources automatically support localization of the
`name`, `description`, and `extendedDescription` text. These fields
should be written in US English.

Translations are managed using the
[Transifex](https://www.transifex.com/projects/p/id-editor/) platform.
After signing up, you can go to [iD's project page](https://www.transifex.com/projects/p/id-editor/),
select a language and click **Translate** to start translating.

The translation strings for this project are located in a resource called
[**imagery**](https://www.transifex.com/openstreetmap/id-editor/imagery/).


#### For maintainers

Transifex will automatically fetch the source file from this repository daily.
We need to manually pull down and check in the translation files whenever we
make a new release (see [RELEASE.md](RELEASE.md)).

To work with translation files,
[install the Transifex Client](https://docs.transifex.com/client/introduction) software.

The Transifex Client uses a file
[`~/.transifex.rc`](https://docs.transifex.com/client/client-configuration#-transifexrc)
to store your username and password.

Note that you can also use a
[Transifex API Token](https://docs.transifex.com/api/introduction#authentication)
in place of your username and password. In this usage, the username is `api`
and the password is the generated API token.

Once you have installed the client and setup the `~/.transifex.rc` file, you can
use the following commands:

* `tx push -s` - upload latest source `/i18n/en.yaml` file to Transifex
* `tx pull -a` - download latest translation files to `/i18n/<lang>.yaml`

For convenience you can also run these commands as `npm run txpush` or `npm run txpull`.
15 changes: 15 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ISC License

Copyright (c) 2020, imagery-index contributors

Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE.
63 changes: 63 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@

# imagery-index

🛰 An index of aerial and satellite imagery useful for mapping.


### About the index

#### tl;dr

To add an imagery source to the index:

* Add source `.json` files under the `sources/` folder
* Each file contains info about the imagery source: name, url template, license requirements
* Each file also contains info about which locations the imagery covers. The locations can be country or region codes, points, or custom `.geojson` files in the `features/*` folder.
* You can copy and change an existing file to get started.
* Run `npm run test`
* This will check the files for errors and make them pretty.
* If you don't have Node installed, you can skip this step and we will do it for you.
* If there are no errors, submit a pull request.

:point_right: See [CONTRIBUTING.md](CONTRIBUTING.md) for full details about how to add an imagery source to this index.


#### Source files

The source files for this index are stored in two kinds of files:

* Under `sources/` there are `.json` files to describe the imagery sources
* Under `features/` there are custom `.geojson` files


#### Distributed Files

Several files are published under `dist/`. These are generated - do not edit them.

* todo


#### Prerequisites

* [Node.js](https://nodejs.org/) version 10 or newer
* [`git`](https://www.atlassian.com/git/tutorials/install-git/) for your platform


#### Installing

* Clone this project, for example:
`git clone git@github.com:ideditor/imagery-index.git`
* `cd` into the project folder,
* Run `npm install` to install libraries


#### Building

* Just `npm run test`
* This will check the files for errors and make them pretty.


### License

imagery-index is available under the [ISC License](https://opensource.org/licenses/ISC).
See the [LICENSE.md](LICENSE.md) file for more details.
18 changes: 18 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Release Checklist

### Update master branch, tag and publish
- [ ] git checkout master
- [ ] npm install
- [ ] npm run test
- [ ] npm run dist
- [ ] npm run txpull
- [ ] git add . && git commit -m 'npm run txpull'
- [ ] Update `CHANGELOG.md`
- [ ] Update version number in `package.json`
- [ ] git add . && git commit -m 'vA.B.C'
- [ ] git tag vA.B.C
- [ ] git push origin master vA.B.C
- [ ] npm publish

Open https://github.com/ideditor/imagery-index/tags
Click "Add Release Notes" and link to the CHANGELOG
Loading

0 comments on commit 834b2f7

Please sign in to comment.