Skip to content

Commit

Permalink
Merge pull request #133 from bonkles-worldai/track_id_v2.17.2
Browse files Browse the repository at this point in the history
Remove Maxar-FB Layer, replace with Digitalglobe Premium.
  • Loading branch information
Bonkles authored Jun 9, 2020
2 parents 87b0ad5 + 5e56425 commit 50f7f04
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 41 deletions.
21 changes: 16 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,32 @@

# [1.0.9](https://github.com/facebookincubator/RapiD/releases/tag/rapid-v1.0.9)
#### 2020-Jun-09th
#### :trumpet: Updates
This removes the FB-Maxar imagery layer. We recommend using the the Maxar Premium (Beta) layer instead.

# [1.0.8](https://github.com/facebookincubator/RapiD/releases/tag/rapid-v1.0.8)
#### 2020-Mar-30th
#### :trumpet: Updates
This eliminates RapiD's need to contact the facebook.com domain and instead contacts the mapwith.ai domain. This should mean fewer configuration issues for folks using Firefox or similar.

# [1.0.7](https://github.com/facebookincubator/RapiD/releases/tag/rapid-v1.0.7)
##### 2020-Feb-18

#### :trumpet: Updates
This brings the RapiD code up-to-date with v2.17.2, which re-introduces Maxar Imagery.
This brings the RapiD code up-to-date with v2.17.2, which re-introduces Maxar Imagery.


# [1.0.6](https://github.com/facebookincubator/RapiD/releases/tag/rapid-v1.0.6)
##### 2020-Jan-31

#### :trumpet: Updates
This brings the RapiD code up-to-date with v2.17.1. This also fixes issue #105.
This brings the RapiD code up-to-date with v2.17.1. This also fixes issue #105.

# [1.0.5](https://github.com/facebookincubator/RapiD/releases/tag/rapid-v1.0.5)
##### 2019-Dec-12

#### :trumpet: Updates
This brings the RapiD code up-to-date with v2.17. This fixes issue #92.
This brings the RapiD code up-to-date with v2.17. This fixes issue #92.

# [1.0.4](https://github.com/facebookincubator/RapiD/releases/tag/rapid-v1.0.4)
##### 2019-Dec-12
Expand All @@ -31,14 +42,14 @@ Merged with [iD v2.16](https://github.com/openstreetmap/iD/blob/master/CHANGELOG
##### 2019-Nov-25

#### :tada: New Features
This release includes the buildings layer from Microsoft as an enabled feature layer! Read more about it here:
This release includes the buildings layer from Microsoft as an enabled feature layer! Read more about it here:
https://blogs.bing.com/maps/2019-09/microsoft-releases-18M-building-footprints-in-uganda-and-tanzania-to-enable-ai-assisted-mapping

For up-to-date availability of roads and buildings, check our continually-updated GeoJSON link here: https://github.com/facebookmicrosites/Open-Mapping-At-Facebook/blob/master/data/rapid_releases.geojson


#### :sparkles: Usability
The RapiD button is no longer an AI-roads toggle- instead, a dialog opens allowing you to enable Facebook's road layer, Microsoft's building layer, or nothing at all.
The RapiD button is no longer an AI-roads toggle- instead, a dialog opens allowing you to enable Facebook's road layer, Microsoft's building layer, or nothing at all.

# [1.0.2](https://github.com/facebookincubator/RapiD/releases/tag/rapid-v1.0.2)
##### 2019-Oct-14
Expand Down
11 changes: 0 additions & 11 deletions data/imagery.json
Original file line number Diff line number Diff line change
Expand Up @@ -13443,17 +13443,6 @@
"terms_text": "Data CC-BY 4.0 Deutsche Bahn AG",
"overlay": true
},
{
"id": "Maxar-FB",
"name": "Facebook's Map With AI - Maxar Imagery",
"type": "tms",
"template": "https://mapwith.ai/maps/ml_roads?theme=ml_road_vector&collaborator=fbid&token=ASZUVdYpCkd3M6ZrzjXdQzHulqRMnxdlkeBJWEKOeTUoY_Gwm9fuEd2YObLrClgDB_xfavizBsh0oDfTWTF7Zb4C&hash=ASYM8LPNy8k1XoJiI7A&result_type=satellite_raster_tile&materialize=true&x={x}&y={y}&z={zoom}",
"zoomExtent": [11, 18],
"terms_url": "https://wiki.openstreetmap.org/wiki/DigitalGlobe",
"terms_text": "Terms",
"default": true,
"description": "Maxar Imagery used by Facebook's Map With AI."
},
{
"id": "dgu-dof-2011",
"name": "dgu.hr: Croatia 2011 Aerial imagery",
Expand Down
46 changes: 23 additions & 23 deletions modules/core/rapid_context.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { geoExtent } from '../geo';

import toGeoJSON from '@mapbox/togeojson';
import { dispatch as d3_dispatch } from 'd3-dispatch';
import { dispatch as d3_dispatch } from 'd3-dispatch';
import { utilRebind } from '../util';

export function coreRapidContext() {
var rapidContext = {};
rapidContext.version = '1.0.7';
var _isTaskBoundsRect = undefined;
rapidContext.version = '1.0.9';
var _isTaskBoundsRect = undefined;
var dispatch = d3_dispatch('task_extent_set');

function distinct (value, index, self) {
return self.indexOf(value) === index;
return self.indexOf(value) === index;
}

var taskExtent;
Expand All @@ -21,48 +21,48 @@ export function coreRapidContext() {

var lineStringCount = gj.features.reduce(function (accumulator, currentValue) {
return accumulator + (currentValue.geometry.type === 'LineString' ? 1 : 0);
}, 0);
}, 0);

if (gj.type === 'FeatureCollection') {
var minlat, minlon, maxlat, maxlon;
// Calculate task extent.
// Calculate task extent.
gj.features.forEach(function(f) {
if (f.geometry.type === 'Point') {
var lon = f.geometry.coordinates[0];
var lat = f.geometry.coordinates[1];
if (minlat === undefined || lat < minlat) minlat = lat;
if (minlon === undefined || lon < minlon) minlon = lon;
if (maxlat === undefined || lat > maxlat) maxlat = lat;
if (maxlon === undefined || lon > maxlon) maxlon = lon;
if (maxlon === undefined || lon > maxlon) maxlon = lon;
}

if (f.geometry.type === 'LineString' && lineStringCount === 1) {
var lats = f.geometry.coordinates.map(function(f) {return f[0];});
var lngs = f.geometry.coordinates.map(function(f) {return f[1];});
var uniqueLats = lats.filter(distinct);
var uniqueLngs = lngs.filter(distinct);
var uniqueLats = lats.filter(distinct);
var uniqueLngs = lngs.filter(distinct);

var eachLatHas2Lngs = true;
var eachLatHas2Lngs = true;
uniqueLats.forEach(function (lat) {
var lngsForThisLat = f.geometry.coordinates
// Filter the coords to the ones with this lat
.filter(function(coord){ return coord[0] === lat; })
// Make an array of lngs that associate with that lat
.map(function(coord){ return coord[1]; })
// Finally, filter for uniqueness
.filter(distinct);
.filter(distinct);

if (lngsForThisLat.length !== 2) {
eachLatHas2Lngs = false;
eachLatHas2Lngs = false;
}
});
// Check for exactly two unique latitudes, two unique longitudes,
//and that each latitude was associated with exactly 2 longitudes,
//
if (uniqueLats.length === 2 && uniqueLngs.length === 2 && eachLatHas2Lngs) {
_isTaskBoundsRect = true;
});
// Check for exactly two unique latitudes, two unique longitudes,
//and that each latitude was associated with exactly 2 longitudes,
//
if (uniqueLats.length === 2 && uniqueLngs.length === 2 && eachLatHas2Lngs) {
_isTaskBoundsRect = true;
} else {
_isTaskBoundsRect = false;
_isTaskBoundsRect = false;
}
}
});
Expand All @@ -78,11 +78,11 @@ export function coreRapidContext() {


rapidContext.isTaskRectangular = function() {
if (!taskExtent) {
return false;
if (!taskExtent) {
return false;
}

return _isTaskBoundsRect;
return _isTaskBoundsRect;
};

return utilRebind(rapidContext, dispatch, 'on');
Expand Down
4 changes: 2 additions & 2 deletions modules/renderer/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function rendererBackground(context) {
var _contrast = 1;
var _saturation = 1;
var _sharpness = 1;
var _numGridSplits = 0; // No grid by default.
var _numGridSplits = 0; // No grid by default.


function background(selection) {
Expand Down Expand Up @@ -470,7 +470,7 @@ export function rendererBackground(context) {
background.findSource(requested) ||
best ||
background.findSource(context.storage('background-last-used')) ||
background.findSource('Maxar-FB') ||
background.findSource('Maxar-Premium') ||
background.findSource('Bing') ||
first ||
background.findSource('none')
Expand Down

0 comments on commit 50f7f04

Please sign in to comment.