Rename _ol_geom_MultiPolygon_ to MultiPolygon

This commit is contained in:
Tim Schaub
2017-12-14 08:56:51 -07:00
parent c502f016f7
commit 9d396280b0
30 changed files with 124 additions and 124 deletions
+10 -10
View File
@@ -5,7 +5,7 @@ import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
import Point from '../../../../src/ol/geom/Point.js';
import Polygon from '../../../../src/ol/geom/Polygon.js';
import {get as getProjection, transform} from '../../../../src/ol/proj.js';
@@ -217,7 +217,7 @@ describe('ol.format.EsriJSON', function() {
var feature = format.readFeature(multiPolygonEsriJSON);
expect(feature).to.be.an(_ol_Feature_);
var geometry = feature.getGeometry();
expect(geometry).to.be.an(_ol_geom_MultiPolygon_);
expect(geometry).to.be.an(MultiPolygon);
expect(geometry.getCoordinates()).to.eql([
[[[0, 1], [1, 4], [4, 3], [3, 0]], [[2, 2], [3, 2], [3, 3], [2, 3]]],
[[[10, 1], [11, 5], [14, 3], [13, 0]]]
@@ -644,7 +644,7 @@ describe('ol.format.EsriJSON', function() {
]
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_MultiPolygon_);
expect(obj).to.be.a(MultiPolygon);
expect(obj.getLayout()).to.eql('XY');
expect(obj.getCoordinates()).to.eql([
[[[0, 1], [1, 4], [4, 3], [3, 0]], [[2, 2], [3, 2],
@@ -663,7 +663,7 @@ describe('ol.format.EsriJSON', function() {
hasZ: true
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_MultiPolygon_);
expect(obj).to.be.a(MultiPolygon);
expect(obj.getLayout()).to.eql('XYZ');
expect(obj.getCoordinates()).to.eql([
[[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0],
@@ -682,7 +682,7 @@ describe('ol.format.EsriJSON', function() {
hasM: true
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_MultiPolygon_);
expect(obj).to.be.a(MultiPolygon);
expect(obj.getLayout()).to.eql('XYM');
expect(obj.getCoordinates()).to.eql([
[[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0],
@@ -702,7 +702,7 @@ describe('ol.format.EsriJSON', function() {
hasM: true
});
var obj = format.readGeometry(str);
expect(obj).to.be.a(_ol_geom_MultiPolygon_);
expect(obj).to.be.a(MultiPolygon);
expect(obj.getLayout()).to.eql('XYZM');
expect(obj.getCoordinates()).to.eql([
[[[0, 1, 0, 1], [1, 4, 0, 1], [4, 3, 0, 1], [3, 0, 0, 1]],
@@ -945,7 +945,7 @@ describe('ol.format.EsriJSON', function() {
});
it('encodes multipolygon', function() {
var multipolygon = new _ol_geom_MultiPolygon_([
var multipolygon = new MultiPolygon([
[[[0, 1], [1, 4], [4, 3], [3, 0]], [[2, 2], [3, 2], [3, 3], [2, 3]]],
[[[10, 1], [11, 5], [14, 3], [13, 0]]]
]);
@@ -955,7 +955,7 @@ describe('ol.format.EsriJSON', function() {
});
it('encodes XYZ multipolygon', function() {
var multipolygon = new _ol_geom_MultiPolygon_([
var multipolygon = new MultiPolygon([
[[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0],
[3, 3, 0], [2, 3, 0]]],
[[[10, 1, 0], [11, 5, 0], [14, 3, 0], [13, 0, 0]]]
@@ -966,7 +966,7 @@ describe('ol.format.EsriJSON', function() {
});
it('encodes XYM multipolygon', function() {
var multipolygon = new _ol_geom_MultiPolygon_([
var multipolygon = new MultiPolygon([
[[[0, 1, 0], [1, 4, 0], [4, 3, 0], [3, 0, 0]], [[2, 2, 0], [3, 2, 0],
[3, 3, 0], [2, 3, 0]]],
[[[10, 1, 0], [11, 5, 0], [14, 3, 0], [13, 0, 0]]]
@@ -977,7 +977,7 @@ describe('ol.format.EsriJSON', function() {
});
it('encodes XYZM multipolygon', function() {
var multipolygon = new _ol_geom_MultiPolygon_([
var multipolygon = new MultiPolygon([
[[[0, 1, 0, 1], [1, 4, 0, 1], [4, 3, 0, 3], [3, 0, 0, 3]],
[[2, 2, 0, 3], [3, 2, 0, 4],
[3, 3, 0, 1], [2, 3, 0, 1]]],
+7 -7
View File
@@ -5,7 +5,7 @@ import _ol_geom_Circle_ from '../../../../src/ol/geom/Circle.js';
import _ol_geom_GeometryCollection_ from '../../../../src/ol/geom/GeometryCollection.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
import Point from '../../../../src/ol/geom/Point.js';
import Polygon from '../../../../src/ol/geom/Polygon.js';
import {fromLonLat, get as getProjection, toLonLat, transform} from '../../../../src/ol/proj.js';
@@ -634,9 +634,9 @@ describe('ol.format.GeoJSON', function() {
var ccw = [[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]];
var right = new Polygon([ccw, cw]);
var rightMulti = new _ol_geom_MultiPolygon_([[ccw, cw]]);
var rightMulti = new MultiPolygon([[ccw, cw]]);
var left = new Polygon([cw, ccw]);
var leftMulti = new _ol_geom_MultiPolygon_([[cw, ccw]]);
var leftMulti = new MultiPolygon([[cw, ccw]]);
var rightObj = {
type: 'Polygon',
@@ -671,9 +671,9 @@ describe('ol.format.GeoJSON', function() {
var cw = [[-180, -90], [-180, 90], [180, 90], [180, -90], [-180, -90]];
var ccw = [[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]];
var right = new Polygon([ccw, cw]);
var rightMulti = new _ol_geom_MultiPolygon_([[ccw, cw]]);
var rightMulti = new MultiPolygon([[ccw, cw]]);
var left = new Polygon([cw, ccw]);
var leftMulti = new _ol_geom_MultiPolygon_([[cw, ccw]]);
var leftMulti = new MultiPolygon([[cw, ccw]]);
var rightObj = {
type: 'Polygon',
@@ -702,9 +702,9 @@ describe('ol.format.GeoJSON', function() {
var cw = [[-180, -90], [-180, 90], [180, 90], [180, -90], [-180, -90]];
var ccw = [[-180, -90], [180, -90], [180, 90], [-180, 90], [-180, -90]];
var right = new Polygon([ccw, cw]);
var rightMulti = new _ol_geom_MultiPolygon_([[ccw, cw]]);
var rightMulti = new MultiPolygon([[ccw, cw]]);
var left = new Polygon([cw, ccw]);
var leftMulti = new _ol_geom_MultiPolygon_([[cw, ccw]]);
var leftMulti = new MultiPolygon([[cw, ccw]]);
var leftObj = {
type: 'Polygon',
+10 -10
View File
@@ -5,7 +5,7 @@ import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
import Point from '../../../../src/ol/geom/Point.js';
import Polygon from '../../../../src/ol/geom/Polygon.js';
import {transform} from '../../../../src/ol/proj.js';
@@ -118,7 +118,7 @@ describe('ol.format.GML2', function() {
'</gml:MultiPolygon>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_MultiPolygon_);
expect(g).to.be.an(MultiPolygon);
expect(g.getCoordinates()).to.eql([
[
[
@@ -319,7 +319,7 @@ describe('ol.format.GML2', function() {
' </layer>';
var feature = new _ol_Feature_({
geometry: new _ol_geom_MultiPolygon_([[[[1.1, 2], [3, 4.2], [5.2, 6]]]])
geometry: new MultiPolygon([[[[1.1, 2], [3, 4.2], [5.2, 6]]]])
});
feature.setId(1);
var objectStack = [{
@@ -844,7 +844,7 @@ describe('ol.format.GML3', function() {
' </gml:polygonMember>' +
'</gml:MultiPolygon>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_MultiPolygon_);
expect(g).to.be.an(MultiPolygon);
expect(g.getCoordinates()).to.eql([
[[[1, 2, 0], [3, 2, 0], [3, 4, 0],
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
@@ -887,7 +887,7 @@ describe('ol.format.GML3', function() {
' </gml:polygonMembers>' +
'</gml:MultiPolygon>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_MultiPolygon_);
expect(g).to.be.an(MultiPolygon);
expect(g.getCoordinates()).to.eql([
[[[1, 2, 0], [3, 2, 0], [3, 4, 0],
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
@@ -1001,7 +1001,7 @@ describe('ol.format.GML3', function() {
' </gml:surfaceMember>' +
'</gml:MultiSurface>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_MultiPolygon_);
expect(g).to.be.an(MultiPolygon);
expect(g.getCoordinates()).to.eql([
[[[1, 2, 0], [3, 2, 0], [3, 4, 0],
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
@@ -1045,7 +1045,7 @@ describe('ol.format.GML3', function() {
' </gml:surfaceMembers>' +
'</gml:MultiSurface>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_MultiPolygon_);
expect(g).to.be.an(MultiPolygon);
expect(g.getCoordinates()).to.eql([
[[[1, 2, 0], [3, 2, 0], [3, 4, 0],
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
@@ -1103,7 +1103,7 @@ describe('ol.format.GML3', function() {
' </gml:surfaceMember>' +
'</gml:MultiSurface>';
var g = readGeometry(format, text);
expect(g).to.be.an(_ol_geom_MultiPolygon_);
expect(g).to.be.an(MultiPolygon);
expect(g.getCoordinates()).to.eql([
[[[1, 2, 0], [3, 2, 0], [3, 4, 0],
[1, 2, 0]], [[2, 3, 0], [2, 5, 0], [4, 5, 0], [2, 3, 0]],
@@ -1308,7 +1308,7 @@ describe('ol.format.GML3', function() {
feature = features[0];
expect(feature.getId()).to.equal('states.1');
expect(feature.get('STATE_NAME')).to.equal('Illinois');
expect(feature.getGeometry()).to.be.an(_ol_geom_MultiPolygon_);
expect(feature.getGeometry()).to.be.an(MultiPolygon);
});
});
@@ -1334,7 +1334,7 @@ describe('ol.format.GML3', function() {
it('creates 2 geometries', function() {
var feature = features[0];
expect(feature.get('center')).to.be.a(Point);
expect(feature.get('the_geom')).to.be.a(_ol_geom_MultiPolygon_);
expect(feature.get('the_geom')).to.be.a(MultiPolygon);
});
});
+6 -6
View File
@@ -7,7 +7,7 @@ import LineString from '../../../../src/ol/geom/LineString.js';
import _ol_geom_LinearRing_ from '../../../../src/ol/geom/LinearRing.js';
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
import Point from '../../../../src/ol/geom/Point.js';
import Polygon from '../../../../src/ol/geom/Polygon.js';
import {addProjection, addCoordinateTransforms, transform, get as getProjection} from '../../../../src/ol/proj.js';
@@ -876,7 +876,7 @@ describe('ol.format.KML', function() {
var f = fs[0];
expect(f).to.be.an(_ol_Feature_);
var g = f.getGeometry();
expect(g).to.be.an(_ol_geom_MultiPolygon_);
expect(g).to.be.an(MultiPolygon);
expect(g.getCoordinates()).to.eql(
[[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]],
[[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]]);
@@ -892,7 +892,7 @@ describe('ol.format.KML', function() {
it('can write MultiPolygon geometries', function() {
var layout = 'XYZ';
var multiPolygon = new _ol_geom_MultiPolygon_(
var multiPolygon = new MultiPolygon(
[[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]],
[[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]], layout);
var features = [new _ol_Feature_(multiPolygon)];
@@ -1080,7 +1080,7 @@ describe('ol.format.KML', function() {
var f = fs[0];
expect(f).to.be.an(_ol_Feature_);
var g = f.getGeometry();
expect(g).to.be.an(_ol_geom_MultiPolygon_);
expect(g).to.be.an(MultiPolygon);
expect(g.getCoordinates()).to.eql([
[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]],
[[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]
@@ -1097,7 +1097,7 @@ describe('ol.format.KML', function() {
it('can write MultiPolygon geometries', function() {
var layout = 'XYZ';
var multiPolygon = new _ol_geom_MultiPolygon_([
var multiPolygon = new MultiPolygon([
[[[0, 0, 0], [0, 1, 0], [1, 1, 0], [1, 0, 0]]],
[[[3, 0, 0], [3, 1, 0], [4, 1, 0], [4, 0, 0]]]
], layout);
@@ -3199,7 +3199,7 @@ describe('ol.format.KML', function() {
var components = geometry.getGeometries();
expect(components).to.have.length(2);
expect(components[0]).to.be.an(Point);
expect(components[1]).to.be.an(_ol_geom_MultiPolygon_);
expect(components[1]).to.be.an(MultiPolygon);
});
it('reads style and icon', function() {
+2 -2
View File
@@ -3,7 +3,7 @@ import * as _ol_extent_ from '../../../../src/ol/extent.js';
import _ol_format_MVT_ from '../../../../src/ol/format/MVT.js';
import Point from '../../../../src/ol/geom/Point.js';
import Polygon from '../../../../src/ol/geom/Polygon.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
import _ol_render_Feature_ from '../../../../src/ol/render/Feature.js';
where('ArrayBuffer.isView').describe('ol.format.MVT', function() {
@@ -159,7 +159,7 @@ describe('ol.format.MVT', function() {
var feature = format.createFeature_({}, rawFeature);
_ol_format_MVT_.readRawGeometry_ = readRawGeometry_;
var geometry = feature.getGeometry();
expect(geometry).to.be.a(_ol_geom_MultiPolygon_);
expect(geometry).to.be.a(MultiPolygon);
});
it('creates ol.render.Feature instances', function() {
+2 -2
View File
@@ -1,5 +1,5 @@
import _ol_Feature_ from '../../../../src/ol/Feature.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
import Polygon from '../../../../src/ol/geom/Polygon.js';
import _ol_format_Feature_ from '../../../../src/ol/format/Feature.js';
import {transform} from '../../../../src/ol/proj.js';
@@ -157,7 +157,7 @@ describe('ol.format.TopoJSON', function() {
var first = features[0];
expect(first).to.be.a(_ol_Feature_);
var firstGeom = first.getGeometry();
expect(firstGeom).to.be.a(_ol_geom_MultiPolygon_);
expect(firstGeom).to.be.a(MultiPolygon);
expect(firstGeom.getExtent()).to.eql(
[-180, -85.60903777459777, 180, 83.64513000000002]);
+4 -4
View File
@@ -5,7 +5,7 @@ import _ol_format_filter_ from '../../../../src/ol/format/filter.js';
import LineString from '../../../../src/ol/geom/LineString.js';
import MultiLineString from '../../../../src/ol/geom/MultiLineString.js';
import MultiPoint from '../../../../src/ol/geom/MultiPoint.js';
import _ol_geom_MultiPolygon_ from '../../../../src/ol/geom/MultiPolygon.js';
import MultiPolygon from '../../../../src/ol/geom/MultiPolygon.js';
import Polygon from '../../../../src/ol/geom/Polygon.js';
import {transform} from '../../../../src/ol/proj.js';
import _ol_xml_ from '../../../../src/ol/xml.js';
@@ -55,7 +55,7 @@ describe('ol.format.WFS', function() {
feature = features[0];
expect(feature.getId()).to.equal('states.1');
expect(feature.get('STATE_NAME')).to.equal('Illinois');
expect(feature.getGeometry()).to.be.an(_ol_geom_MultiPolygon_);
expect(feature.getGeometry()).to.be.an(MultiPolygon);
});
it('transforms and creates a polygon for Illinois', function() {
@@ -66,7 +66,7 @@ describe('ol.format.WFS', function() {
expect(feature.getId()).to.equal('states.1');
expect(feature.get('STATE_NAME')).to.equal('Illinois');
var geom = feature.getGeometry();
expect(geom).to.be.an(_ol_geom_MultiPolygon_);
expect(geom).to.be.an(MultiPolygon);
var p = transform([-88.071, 37.511], 'EPSG:4326', 'EPSG:3857');
p.push(0);
expect(geom.getFirstCoordinate()).to.eql(p);
@@ -106,7 +106,7 @@ describe('ol.format.WFS', function() {
expect(feature.get('name')).to.equal('My Polygon with hole');
expect(feature.get('boundedBy')).to.eql(
[47.003018, -0.768746, 47.925567, 0.532597]);
expect(feature.getGeometry()).to.be.an(_ol_geom_MultiPolygon_);
expect(feature.getGeometry()).to.be.an(MultiPolygon);
expect(feature.getGeometry().getFlatCoordinates()).
to.have.length(60);
});