diff --git a/PITCHME.md b/PITCHME.md new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/PITCHME.md diff --git a/ms_configura.php b/ms_configura.php index 1b5e583..e15663a 100755 --- a/ms_configura.php +++ b/ms_configura.php @@ -95,7 +95,6 @@ Exemplo de chave: def00000881f5d29aa8604e109797766cd26754c4cc06be02c09163810a78a $i3geoKeys = array( "salvaMapfile"=>"" ); -//TODO documentar no moodle /* Variable: $i3geoPermiteLogin @@ -187,17 +186,8 @@ $i3geoEsquemasWL = array(); Tipo: {array} */ -$i3geoUploadDataWL = array( - "arquivos" => array( - "Pasta 1"=>"/tmp/ms_tmp" - ), - "postgis" => array( - "esquemas"=>array("esquema1","i3geo_metaestat","public"), - "conexao"=>array("user"=> "postgres", "password"=>"postgres", "dbname"=>"i3geosaude", "host"=>"localhost", "port"=>"5432") - ) -); +$i3geoUploadDataWL = array(); -//TODO documentar moodle /* Variale: $logExec @@ -262,7 +252,7 @@ No caso do SAIKU, verifique tambem se o programa i3geo/ferramentas/saiku/esquema abrir e verificar o inicio desse arquivo). Veja tambem: i3geo/ferramentas/saiku/install.txt */ $statusFerramentas = array( - "saiku"=>true, + "saiku"=>false, "melhorcaminho"=>false ); /* @@ -318,7 +308,7 @@ inseretxt,mostraexten,outputformat,perfil,tipoimagem */ //$i3geoBlFerramentas = array("saiku"); -$i3geoBlFerramentas = array(); +$i3geoBlFerramentas = array("saiku"); /* Variable: $ogrOutput diff --git a/pacotes/wicket/bower.json b/pacotes/wicket/bower.json deleted file mode 100755 index 44b0f05..0000000 --- a/pacotes/wicket/bower.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "Wicket", - "version": "1.2", - "main": [ - "wicket.js", - "wicket-arcgis.js", - "wicket-gmap3.js", - "wicket-leaflet.js" - ], - "ignore": [ - "doc/*", - "tests/*" - ] -} diff --git a/pacotes/wicket/doc/arcgis.html b/pacotes/wicket/doc/arcgis.html deleted file mode 100755 index 34821b3..0000000 --- a/pacotes/wicket/doc/arcgis.html +++ /dev/null @@ -1,221 +0,0 @@ - - - - - - - - - - - - - -Wicket - Lightweight Javascript for WKT [ESRI ArcGIS Sandbox] - - - - - - - - -
-
- -
  -
-
-
-
-
-
-
Wicket
-  It whispers WKT in your application's ear. -
-
- Wicket is a lightweight Javascript library that reads and writes Well-Known Text (WKT) strings. It can also be extended to parse and to create geometric objects from various mapping frameworks, such as Leaflet and the Google Maps API. -
-
- - - - -
-
-
-
- - - diff --git a/pacotes/wicket/doc/dot_shadow.png b/pacotes/wicket/doc/dot_shadow.png deleted file mode 100755 index 788f45c..0000000 Binary files a/pacotes/wicket/doc/dot_shadow.png and /dev/null differ diff --git a/pacotes/wicket/doc/index.css b/pacotes/wicket/doc/index.css deleted file mode 100755 index 9f8a16b..0000000 --- a/pacotes/wicket/doc/index.css +++ /dev/null @@ -1,85 +0,0 @@ -body {margin:0;padding:0;background:#CF6;border-top:5px solid #000;font-family:Helvetica,Arial,sans-serif;font-size:14px;} -img {border:none;} -label {color:#666;} -label:hover {color:#333;} -a:link, -a:visited {color:#460;text-decoration:none;} - -.leaflet-container .leaflet-control-attribution {color:white;background:none !important;box-shadow:none !important;} -.leaflet-container .leaflet-control-attribution a:link, -.leaflet-container .leaflet-control-attribution a:visited {color:#8C0;} - -.attribute {width:290px;float:right;padding:10px 0;text-align:left;font-size:10px;line-height:16px;} -.menu {float:left;margin:0;padding:0;list-style:none;} -.menu a {display:inline-block;margin:0;padding:5px 0 10px;margin:0 25px 0 0;border-top:5px solid transparent;} -.menu a:hover, -.menu a:active {border-top:5px solid #999;color:#000;text-decoration:none;} -.text {color:#333;} -.wrapper {width:1000px;height:100%;margin:0 auto;} - -#canvas {width:698px;height:100%;background:#AAA;border-left:1px solid #999;border-right:1px solid #999;} -#canvas, -#controls {float:left;} -#controls {width:290px;height:100%;padding:0 0 0 10px;text-align:justify;background:transparent;position:relative;top:-80px;} -#controls .text {margin:90px 0 0;} -#controls a:hover, -#controls a:active {text-decoration:underline;} -#forkme {width:141px;height:141px;z-index:9999;position:absolute;left:0;top:4px;background:transparent url(https://s3.amazonaws.com/github/ribbons/forkme_left_red_aa0000.png) no-repeat left top;} -#form {margin:10px 0 0;font-size:14px;color:#666;font-family:CabinItalic,sans-serif;} -#form #wkt {width:100%;height:150px;border:1px solid #999;padding:3px;resize:none;} -#form #urlify {vertical-align:baseline;margin:10px 5px 0 0;} -#form #reset {margin:10px 10px 0 0; - filter: progid: DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc'); - -ms-filter: "progid: DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc')"; - background-image: -moz-linear-gradient(top, #eeeeee, #cccccc); - background-image: -ms-linear-gradient(top, #eeeeee, #cccccc); - background-image: -o-linear-gradient(top, #eeeeee, #cccccc); - background-image: -webkit-gradient(linear, center top, center bottom, from(#eeeeee), to(#cccccc)); - background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc); - background-image: linear-gradient(top, #eeeeee, #cccccc); - -moz-background-clip: padding; - -webkit-background-clip: padding-box; - background-clip: padding-box; - } -#form #reset, -#form #submit {float:right;height:30px;margin-top:10px;padding:0 5px 2px 5px;font-family:CabinItalic,sans-serif;font-size:16px;color:#666; - border: 1px solid #999999; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - } -#form #submit {background-color: #EF9; - filter: progid: DXImageTransform.Microsoft.gradient(startColorstr = '#eeffcc', endColorstr = '#ddff99'); - -ms-filter: "progid: DXImageTransform.Microsoft.gradient(startColorstr = '#eeffcc', endColorstr = '#ddff99')"; - background-image: -moz-linear-gradient(top, #eeffcc, #ddff99); - background-image: -ms-linear-gradient(top, #eeffcc, #ddff99); - background-image: -o-linear-gradient(top, #eeffcc, #ddff99); - background-image: -webkit-gradient(linear, center top, center bottom, from(#eeffcc), to(#ddff99)); - background-image: -webkit-linear-gradient(top, #eeffcc, #ddff99); - background-image: linear-gradient(top, #eeffcc, #ddff99); - -moz-background-clip: padding; - -webkit-background-clip: padding-box; - background-clip: padding-box; - } -#form #reset:hover, -#form #submit:hover {color:#333;border-color:#666;text-shadow:1px 1px 0px #FFF; - -moz-box-shadow: 0px 0px 2px #999999; - -webkit-box-shadow: 0px 0px 2px #999999; - box-shadow: 0px 0px 2px #999999; - } -#form #reset:active, -#form #submit:active { - -moz-box-shadow:inset 0px 0px 2px #999999; - -webkit-box-shadow:inset 0px 0px 2px #999999; - box-shadow:inset 0px 0px 2px #999999; - } -#foot {background:transparent url(white_spacer.gif) repeat-x top left;} -#foot, -#head {width:100%;height:20%;color:#333;} -#head {background:transparent url(white_spacer.gif) repeat-x bottom left;} -#nav {width:698px;text-align:left;} -#ribbon {width:100%;height:60%;background:#EEE;} -#ribbon .wrapper {} -#ribbon .wrapper .title {float:right;width:300px;height:80px;font-family:CabinRegular,sans-serif;font-size:16px;color:#333;} -#ribbon .wrapper .title .brand {font-family:CabinMediumItalic,sans-serif;font-size:36px;color:#000;text-shadow:1px 1px 1px #FFF;} - diff --git a/pacotes/wicket/doc/index.html b/pacotes/wicket/doc/index.html deleted file mode 100755 index 7f4c190..0000000 --- a/pacotes/wicket/doc/index.html +++ /dev/null @@ -1,327 +0,0 @@ - - - - - - - - - - - - - -Wicket - Lightweight Javascript for WKT [Sandbox] - - - - - - - -
  -
-
- -
-
-
-
-
-
-
Wicket
-  It whispers WKT in your application's ear. -
-
- Wicket is a lightweight Javascript library that reads and writes Well-Known Text (WKT) strings. It can also be extended to parse and to create geometric objects from various mapping frameworks, such as Leaflet and the Google Maps API. -
-
- - - - -
-
-
-
- - - diff --git a/pacotes/wicket/doc/index.ie.css b/pacotes/wicket/doc/index.ie.css deleted file mode 100755 index 9f8a16b..0000000 --- a/pacotes/wicket/doc/index.ie.css +++ /dev/null @@ -1,85 +0,0 @@ -body {margin:0;padding:0;background:#CF6;border-top:5px solid #000;font-family:Helvetica,Arial,sans-serif;font-size:14px;} -img {border:none;} -label {color:#666;} -label:hover {color:#333;} -a:link, -a:visited {color:#460;text-decoration:none;} - -.leaflet-container .leaflet-control-attribution {color:white;background:none !important;box-shadow:none !important;} -.leaflet-container .leaflet-control-attribution a:link, -.leaflet-container .leaflet-control-attribution a:visited {color:#8C0;} - -.attribute {width:290px;float:right;padding:10px 0;text-align:left;font-size:10px;line-height:16px;} -.menu {float:left;margin:0;padding:0;list-style:none;} -.menu a {display:inline-block;margin:0;padding:5px 0 10px;margin:0 25px 0 0;border-top:5px solid transparent;} -.menu a:hover, -.menu a:active {border-top:5px solid #999;color:#000;text-decoration:none;} -.text {color:#333;} -.wrapper {width:1000px;height:100%;margin:0 auto;} - -#canvas {width:698px;height:100%;background:#AAA;border-left:1px solid #999;border-right:1px solid #999;} -#canvas, -#controls {float:left;} -#controls {width:290px;height:100%;padding:0 0 0 10px;text-align:justify;background:transparent;position:relative;top:-80px;} -#controls .text {margin:90px 0 0;} -#controls a:hover, -#controls a:active {text-decoration:underline;} -#forkme {width:141px;height:141px;z-index:9999;position:absolute;left:0;top:4px;background:transparent url(https://s3.amazonaws.com/github/ribbons/forkme_left_red_aa0000.png) no-repeat left top;} -#form {margin:10px 0 0;font-size:14px;color:#666;font-family:CabinItalic,sans-serif;} -#form #wkt {width:100%;height:150px;border:1px solid #999;padding:3px;resize:none;} -#form #urlify {vertical-align:baseline;margin:10px 5px 0 0;} -#form #reset {margin:10px 10px 0 0; - filter: progid: DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc'); - -ms-filter: "progid: DXImageTransform.Microsoft.gradient(startColorstr = '#eeeeee', endColorstr = '#cccccc')"; - background-image: -moz-linear-gradient(top, #eeeeee, #cccccc); - background-image: -ms-linear-gradient(top, #eeeeee, #cccccc); - background-image: -o-linear-gradient(top, #eeeeee, #cccccc); - background-image: -webkit-gradient(linear, center top, center bottom, from(#eeeeee), to(#cccccc)); - background-image: -webkit-linear-gradient(top, #eeeeee, #cccccc); - background-image: linear-gradient(top, #eeeeee, #cccccc); - -moz-background-clip: padding; - -webkit-background-clip: padding-box; - background-clip: padding-box; - } -#form #reset, -#form #submit {float:right;height:30px;margin-top:10px;padding:0 5px 2px 5px;font-family:CabinItalic,sans-serif;font-size:16px;color:#666; - border: 1px solid #999999; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - } -#form #submit {background-color: #EF9; - filter: progid: DXImageTransform.Microsoft.gradient(startColorstr = '#eeffcc', endColorstr = '#ddff99'); - -ms-filter: "progid: DXImageTransform.Microsoft.gradient(startColorstr = '#eeffcc', endColorstr = '#ddff99')"; - background-image: -moz-linear-gradient(top, #eeffcc, #ddff99); - background-image: -ms-linear-gradient(top, #eeffcc, #ddff99); - background-image: -o-linear-gradient(top, #eeffcc, #ddff99); - background-image: -webkit-gradient(linear, center top, center bottom, from(#eeffcc), to(#ddff99)); - background-image: -webkit-linear-gradient(top, #eeffcc, #ddff99); - background-image: linear-gradient(top, #eeffcc, #ddff99); - -moz-background-clip: padding; - -webkit-background-clip: padding-box; - background-clip: padding-box; - } -#form #reset:hover, -#form #submit:hover {color:#333;border-color:#666;text-shadow:1px 1px 0px #FFF; - -moz-box-shadow: 0px 0px 2px #999999; - -webkit-box-shadow: 0px 0px 2px #999999; - box-shadow: 0px 0px 2px #999999; - } -#form #reset:active, -#form #submit:active { - -moz-box-shadow:inset 0px 0px 2px #999999; - -webkit-box-shadow:inset 0px 0px 2px #999999; - box-shadow:inset 0px 0px 2px #999999; - } -#foot {background:transparent url(white_spacer.gif) repeat-x top left;} -#foot, -#head {width:100%;height:20%;color:#333;} -#head {background:transparent url(white_spacer.gif) repeat-x bottom left;} -#nav {width:698px;text-align:left;} -#ribbon {width:100%;height:60%;background:#EEE;} -#ribbon .wrapper {} -#ribbon .wrapper .title {float:right;width:300px;height:80px;font-family:CabinRegular,sans-serif;font-size:16px;color:#333;} -#ribbon .wrapper .title .brand {font-family:CabinMediumItalic,sans-serif;font-size:36px;color:#000;text-shadow:1px 1px 1px #FFF;} - diff --git a/pacotes/wicket/doc/leaflet.html b/pacotes/wicket/doc/leaflet.html deleted file mode 100755 index c7ba3bb..0000000 --- a/pacotes/wicket/doc/leaflet.html +++ /dev/null @@ -1,266 +0,0 @@ - - - - - - - - - - - - - -Wicket - Lightweight Javascript for WKT [Leaflet Sandbox] - - - - - - - - -
-
- -
  -
-
-
-
-
-
-
Wicket
-  It whispers WKT in your application's ear. -
-
- Wicket is a lightweight Javascript library that reads and writes Well-Known Text (WKT) strings. It can also be extended to parse and to create geometric objects from various mapping frameworks, such as Leaflet and the Google Maps API. -
-
- - - - -
-
-
-
- - - diff --git a/pacotes/wicket/doc/red_dot.png b/pacotes/wicket/doc/red_dot.png deleted file mode 100755 index b4389c6..0000000 Binary files a/pacotes/wicket/doc/red_dot.png and /dev/null differ diff --git a/pacotes/wicket/doc/white_spacer.gif b/pacotes/wicket/doc/white_spacer.gif deleted file mode 100755 index c621c98..0000000 Binary files a/pacotes/wicket/doc/white_spacer.gif and /dev/null differ diff --git a/pacotes/wicket/package.json b/pacotes/wicket/package.json deleted file mode 100755 index bc9d480..0000000 --- a/pacotes/wicket/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "wicket", - "version": "1.1.0", - "description": "A modest library for moving between Well-Known Text (WKT) and various framework geometries", - "homepage": "https://github.com/arthur-e/Wicket", - "keywords": [ - "wkt", - "map", - "mapping", - "geometry", - "leaflet" - ], - "maintainers": [{ - "name": "K. Arthur Endsley", - "email": "kaendsle@mtu.edu", - "web": "https://github.com/arthur-e" - }], - "contributors": [{ - "name": "K. Arthur Endsley", - "email": "kaendsle@mtu.edu", - "web": "https://github.com/arthur-e" - }, { - "name": "cuyahoga", - "web": "https://github.com/cuyahoga" - }, { - "name": "Tom Nightingale", - "web": "https://github.com/thegreat" - }, { - "name": "Aaron Ogle", - "web": "https://github.com/atogle" - }, { - "name": "James Seppi", - "web": "https://github.com/jseppi" - }, { - "name": "tchannel", - "web": "https://github.com/tchannel" - }, { - "name": "Felipe Figueroa", - "web": "https://github.com/amenadiel" - }, { - "name": "Matthijs van Henten", - "web": "https://github.com/mvhenten" - }], - "bugs": { - "mail": "kaendsle@mtu.edu", - "url": "https://github.com/arthur-e/Wicket/issues" - }, - "licenses": [{ - "type": "GPLv3", - "url": "https://raw.github.com/arthur-e/Wicket/master/LICENSE" - }], - "repository": { - "type": "git", - "url": "https://github.com/arthur-e/Wicket" - }, - "scripts": { - "postinstall": "export PATH=$PATH:/usr/local/lib/node_modules/uglify-js/bin/;unzip ./node_modules/jasmine-core/dist/jasmine-standalone-2.0.0.zip -d ./node_modules/jasmine-core/dist/", - "build": "uglifyjs wicket.js -o wicket.min.js;uglifyjs wicket-gmap3.js -o wicket-gmap3.min.js;uglifyjs wicket-arcgis.js -o wicket-arcgis.min.js;uglifyjs wicket-leaflet.js -o wicket-leaflet.min.js;", - "test": "./node_modules/mocha/bin/mocha -R tap tests/wicket-spec.js" - }, - "devDependencies": { - "chai": "*", - "mocha": "*", - "uglify-js": "2.4.x", - "jasmine": "git://github.com/pivotal/jasmine#master" - } -} diff --git a/pacotes/wicket/tests/wicket-gmap3-spec.js b/pacotes/wicket/tests/wicket-gmap3-spec.js deleted file mode 100755 index aedb986..0000000 --- a/pacotes/wicket/tests/wicket-gmap3-spec.js +++ /dev/null @@ -1,880 +0,0 @@ -describe('Standard WKT Test Cases: ', function () { - var cases, wkt; - - wkt = new Wkt.Wkt(); - - cases = { - - point: { - str: 'POINT(30 10)', - cmp: [{ - x: 30, - y: 10 - }], - obj: new google.maps.Point(30, 10), - json: { - 'coordinates': [30, 10], - 'type': 'Point' - }, - }, - - marker: { - str: 'POINT(30 10)', - cmp: [{ - x: 30, - y: 10 - }], - obj: new google.maps.Marker({ - position: new google.maps.LatLng(10, 30) - }) - }, - - linestring: { - str: 'LINESTRING(30 10,10 30,40 40)', - cmp: [{ - x: 30, - y: 10 - }, { - x: 10, - y: 30 - }, { - x: 40, - y: 40 - }], - obj: new google.maps.Polyline({ - editable: false, - path: [ - new google.maps.LatLng(10, 30), - new google.maps.LatLng(30, 10), - new google.maps.LatLng(40, 40) - ] - }), - json: { - 'coordinates': [ - [30, 10], - [10, 30], - [40, 40] - ], - 'type': 'LineString' - }, - }, - - - polygon: { - str: 'POLYGON((30 10,10 20,20 40,40 40,30 10))', - cmp: [ - [{ - x: 30, - y: 10 - }, { - x: 10, - y: 20 - }, { - x: 20, - y: 40 - }, { - x: 40, - y: 40 - }, { - x: 30, - y: 10 - }] - ], - obj: new google.maps.Polygon({ - editable: false, - paths: [ - [ - new google.maps.LatLng(10, 30), - new google.maps.LatLng(20, 10), - new google.maps.LatLng(40, 20), - new google.maps.LatLng(40, 40) - ] - ] - }), - json: { - 'coordinates': [ - [ - [30, 10], - [10, 20], - [20, 40], - [40, 40], - [30, 10] - ] - ], - 'type': 'Polygon' - }, - - }, - - polygon2: { - str: 'POLYGON((35 10,10 20,15 40,45 45,35 10),(25 30,35 35,30 20,25 30))', - cmp: [ - [{ - x: 35, - y: 10 - }, { - x: 10, - y: 20 - }, { - x: 15, - y: 40 - }, { - x: 45, - y: 45 - }, { - x: 35, - y: 10 - }], - [{ - x: 25, - y: 30 - }, { - x: 35, - y: 35 - }, { - x: 30, - y: 20 - }, { - x: 25, - y: 30 - }] - ], - obj: new google.maps.Polygon({ - editable: false, - paths: [ - [ - new google.maps.LatLng(10, 35), - new google.maps.LatLng(20, 10), - new google.maps.LatLng(40, 15), - new google.maps.LatLng(45, 45) - ], - [ // Order in inner rings is reversed - new google.maps.LatLng(20, 30), - new google.maps.LatLng(35, 35), - new google.maps.LatLng(30, 25) - ] - ] - }), - json: { - 'coordinates': [ - [ - [35, 10], - [10, 20], - [15, 40], - [45, 45], - [35, 10] - ], - [ - [25, 30], - [35, 35], - [30, 20], - [25, 30] - ] - ], - 'type': 'Polygon' - }, - jsonStr: '{"coordinates": [[[35, 10], [45, 45], [15, 40], [10, 20], [35, 10]], [[20, 30], [35, 35], [30, 20], [20, 30]]], "type": "Polygon"}' - }, - - multipoint: { - str: 'MULTIPOINT((10 40),(40 30),(20 20),(30 10))', - cmp: [ - [{ - x: 10, - y: 40 - }], - [{ - x: 40, - y: 30 - }], - [{ - x: 20, - y: 20 - }], - [{ - x: 30, - y: 10 - }] - ], - obj: [ - new google.maps.Marker({ - position: new google.maps.LatLng(40, 10) - }), - new google.maps.Marker({ - position: new google.maps.LatLng(30, 40) - }), - new google.maps.Marker({ - position: new google.maps.LatLng(20, 20) - }), - new google.maps.Marker({ - position: new google.maps.LatLng(10, 30) - }), - ], - json: { - 'coordinates': [ - [10, 40], - [40, 30], - [20, 20], - [30, 10] - ], - 'type': 'MultiPoint' - }, - jsonStr: '{"coordinates": [[10, 40], [40, 30], [20, 20], [30, 10]], "type": "MultiPoint"}' - }, - - multilinestring: { - str: 'MULTILINESTRING((10 10,20 20,10 40),(40 40,30 30,40 20,30 10))', - cmp: [ - [{ - x: 10, - y: 10 - }, { - x: 20, - y: 20 - }, { - x: 10, - y: 40 - }], - [{ - x: 40, - y: 40 - }, { - x: 30, - y: 30 - }, { - x: 40, - y: 20 - }, { - x: 30, - y: 10 - }] - ], - obj: [ - new google.maps.Polyline({ - editable: false, - path: [ - new google.maps.LatLng(10, 10), - new google.maps.LatLng(20, 20), - new google.maps.LatLng(40, 10) - ] - }), - new google.maps.Polyline({ - editable: false, - path: [ - new google.maps.LatLng(40, 40), - new google.maps.LatLng(30, 30), - new google.maps.LatLng(20, 40), - new google.maps.LatLng(10, 30) - ] - }) - ], - json: { - 'coordinates': [ - [ - [10, 10], - [20, 20], - [10, 40] - ], - [ - [40, 40], - [30, 30], - [40, 20], - [30, 10] - ] - ], - 'type': 'MultiLineString' - }, - jsonStr: '{"coordinates": [[[10, 10], [20, 20], [10, 40]], [[40, 40], [30, 30], [40, 20], [30, 10]]], "type": "MultiLineString"}' - }, - - multipolygon: { - str: 'MULTIPOLYGON(((30 20,10 40,45 40,30 20)),((15 5,40 10,10 20,5 10,15 5)))', - cmp: [ - [ - [{ - x: 30, - y: 20 - }, { - x: 10, - y: 40 - }, { - x: 45, - y: 40 - }, { - x: 30, - y: 20 - }, ] - ], - [ - [{ - x: 15, - y: 5 - }, { - x: 40, - y: 10 - }, { - x: 10, - y: 20 - }, { - x: 5, - y: 10 - }, { - x: 15, - y: 5 - }] - ] - ], - obj: [ - new google.maps.Polygon({ - editable: false, - paths: [ - [ - new google.maps.LatLng(20, 30), - new google.maps.LatLng(40, 10), - new google.maps.LatLng(40, 45) - ] - ] - }), - new google.maps.Polygon({ - editable: false, - paths: [ - [ - new google.maps.LatLng(5, 15), - new google.maps.LatLng(10, 40), - new google.maps.LatLng(20, 10), - new google.maps.LatLng(10, 5) - ] - ] - }) - ], - json: { - 'coordinates': [ - [ - [ - [30, 20], - [10, 40], - [45, 40], - [30, 20] - ] - ], - [ - [ - [15, 5], - [40, 10], - [10, 20], - [5, 10], - [15, 5] - ] - ] - ], - 'type': 'MultiPolygon' - }, - jsonStr: '{"coordinates": [[[[30, 20], [10, 40], [45, 40], [30, 20]]], [[[15, 5], [40, 10], [10, 20], [5, 10], [15, 5]]]], "type": "MultiPolygon"}' - }, - - multipolygon2: { - str: 'MULTIPOLYGON(((40 40,20 45,45 30,40 40)),((20 35,45 20,30 5,10 10,10 30,20 35),(30 20,20 25,20 15,30 20)))', - cmp: [ - [ - [{ - x: 40, - y: 40 - }, { - x: 20, - y: 45 - }, { - x: 45, - y: 30 - }, { - x: 40, - y: 40 - }, ] - ], - [ - [{ - x: 20, - y: 35 - }, { - x: 45, - y: 20 - }, { - x: 30, - y: 5 - }, { - x: 10, - y: 10 - }, { - x: 10, - y: 30 - }, { - x: 20, - y: 35 - }, ], - [{ - x: 30, - y: 20 - }, { - x: 20, - y: 25 - }, { - x: 20, - y: 15 - }, { - x: 30, - y: 20 - }] - ] - ], - obj: [ - new google.maps.Polygon({ - editable: false, - paths: [ - [ - new google.maps.LatLng(40, 40), - new google.maps.LatLng(45, 20), - new google.maps.LatLng(30, 45) - ] - ] - }), - new google.maps.Polygon({ - editable: false, - paths: [ - [ - new google.maps.LatLng(35, 20), - new google.maps.LatLng(20, 45), - new google.maps.LatLng(5, 30), - new google.maps.LatLng(10, 10), - new google.maps.LatLng(30, 10) - ], - [ - new google.maps.LatLng(15, 20), - new google.maps.LatLng(25, 20), - new google.maps.LatLng(20, 30) - ] - ] - }) - ], - json: { - 'coordinates': [ - [ - [ - [40, 40], - [20, 45], - [45, 30], - [40, 40] - ] - ], - [ - [ - [20, 35], - [45, 20], - [30, 5], - [10, 10], - [10, 30], - [20, 35] - ], - [ - [30, 20], - [20, 25], - [20, 15], - [30, 20] - ] - ] - ], - 'type': 'MultiPolygon' - }, - jsonStr: '{"coordinates": [[[[40, 40], [20, 45], [45, 30], [40, 40]]], [[[20, 35], [10, 30], [10, 10], [30, 5], [45, 20], [20, 35]], [[30, 20], [20, 15], [20, 25], [30, 20]]]], "type": "MultiPolygon"}' - }, - - rectangle: { - str: 'POLYGON((-50 20,0 20,0 0,-50 0,-50 20))', - cmp: [ - [{ - x: -50, - y: 20 - }, { - x: 0, - y: 20 - }, { - x: 0, - y: 0 - }, { - x: -50, - y: 0 - }, { - x: -50, - y: 20 - }] - ], - obj: new google.maps.Rectangle({ - bounds: new google.maps.LatLngBounds(new google.maps.LatLng(0, -50), - new google.maps.LatLng(20, 0)) - }) - }, - - - - box: { - str: 'BOX(0 0,20 20)', - cmp: [{ - x: 0, - y: 0 - }, { - x: 20, - y: 20 - }], - obj: new google.maps.Rectangle({ - bounds: new google.maps.LatLngBounds(new google.maps.LatLng(0, 0), - new google.maps.LatLng(20, 20)) - }), - json: { - 'coordinates': [ - [ - [0, 0], - [0, 20], - [20, 20], - [20, 0], - [0, 0] - ] - ], - 'type': 'Polygon', - 'bbox': [0, 0, 20, 20] - } - }, - - geometrycollection: { - str: 'GEOMETRYCOLLECTION(POINT(30 10),LINESTRING(30 10,10 30,40 40),POLYGON((30 10,10 20,20 40,40 40,30 10)))', - json: { - "type": "GeometryCollection", - "geometries": [{ - "type": "Point", - "coordinates": [30, 10] - }, { - 'type': 'LineString', - 'coordinates': [ - [30, 10], - [10, 30], - [40, 40] - ] - }, - - { - "type": "Polygon", - "coordinates": [ - [ - [30, 10], - [10, 20], - [20, 40], - [40, 40], - [30, 10] - ] - ] - } - ] - } - } - - }; - - dataObjects = new google.maps.Data; - - - - - - describe('Converting objects into WKT strings: ', function () { - - afterEach(function () { - wkt.delimiter = ' '; - }); - - it('should convert a Marker instance into a basic POINT string', function () { - wkt.fromObject(cases.point.obj); - expect(wkt.type).toBe('point'); - expect(wkt.isCollection()).toBe(false); - expect(wkt.components).toEqual(cases.point.cmp); - expect(wkt.write()).toBe(cases.point.str); - }); - - it('should convert a Polyline instance into a basic LINESTRING string', function () { - wkt.fromObject(cases.linestring.obj); - expect(wkt.type).toBe('linestring'); - expect(wkt.isCollection()).toBe(false); - expect(wkt.components).toEqual(cases.linestring.cmp); - expect(wkt.write()).toBe(cases.linestring.str); - }); - - it('should convert a Polygon instance into a basic POLYGON string', function () { - wkt.fromObject(cases.polygon.obj); - expect(wkt.type).toBe('polygon'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.polygon.cmp); - expect(wkt.write()).toBe(cases.polygon.str); - }); - - it('should convert a Polygon instance with a hole into a POLYGON string with the same hole', function () { - wkt.fromObject(cases.polygon2.obj); - expect(wkt.type).toBe('polygon'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.polygon2.cmp); - expect(wkt.write()).toBe(cases.polygon2.str); - }); - - it('should convert a Rectangle instance into a POLYGON string', function () { - wkt.fromObject(cases.rectangle.obj); - expect(wkt.type).toBe('polygon'); - expect(wkt.isRectangle).toBe(true); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.rectangle.cmp); - expect(wkt.write()).toBe(cases.rectangle.str); - }); - - it('should convert an Array of Marker instances into a MULTIPOINT string', function () { - wkt.fromObject(cases.multipoint.obj); - expect(wkt.type).toBe('multipoint'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.multipoint.cmp); - expect(wkt.write()).toBe(cases.multipoint.str); - }); - - it('should convert an Array of Polyline instances into a MULTILINESTRING string', function () { - wkt.fromObject(cases.multilinestring.obj); - expect(wkt.type).toBe('multilinestring'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.multilinestring.cmp); - expect(wkt.write()).toBe(cases.multilinestring.str); - }); - - it('should convert an Array of Polygon instances into a MULTIPOLYGON string', function () { - wkt.fromObject(cases.multipolygon.obj); - expect(wkt.type).toBe('multipolygon'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.multipolygon.cmp); - expect(wkt.write()).toBe(cases.multipolygon.str); - }); - - it('should convert an Array of Polygon instances, some with holes, into a MULTIPOLYGON string with the same hole', function () { - wkt.fromObject(cases.multipolygon2.obj); - expect(wkt.type).toBe('multipolygon'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.multipolygon2.cmp); - expect(wkt.write()).toBe(cases.multipolygon2.str); - }); - - }); - - describe('Converting google.maps.Data objects into WKT strings: ', function () { - - afterEach(function () { - wkt.delimiter = ' '; - }); - - it('should convert a google.maps.Data.Point instance into a basic POINT string', function () { - var dataPoint = dataObjects.addGeoJson({ - "type": "Feature", - geometry: cases.point.json - })[0]; - wkt.fromObject(dataPoint.getGeometry()); - expect(wkt.type).toBe('point'); - expect(wkt.isCollection()).toBe(false); - expect(wkt.components).toEqual(cases.point.cmp); - expect(wkt.write()).toBe(cases.point.str); - }); - - it('should convert a google.maps.Data.LineString instance into a basic LINESTRING string', function () { - var dataLineString = dataObjects.addGeoJson({ - "type": "Feature", - geometry: cases.linestring.json - })[0]; - wkt.fromObject(dataLineString.getGeometry()); - expect(wkt.type).toBe('linestring'); - expect(wkt.isCollection()).toBe(false); - expect(wkt.components).toEqual(cases.linestring.cmp); - expect(wkt.write()).toBe(cases.linestring.str); - }); - - it('should convert a google.maps.Data.Polygon instance into a basic POLYGON string', function () { - var dataPolygon = dataObjects.addGeoJson({ - "type": "Feature", - geometry: cases.polygon.json - })[0]; - wkt.fromObject(dataPolygon.getGeometry()); - expect(wkt.type).toBe('polygon'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.polygon.cmp); - expect(wkt.write()).toBe(cases.polygon.str); - }); - - it('should convert a google.maps.Data.Polygon instance with a hole into a POLYGON string with the same hole', function () { - var dataPolygon2 = dataObjects.addGeoJson({ - "type": "Feature", - geometry: cases.polygon2.json - })[0]; - wkt.fromObject(dataPolygon2.getGeometry()); - expect(wkt.type).toBe('polygon'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.polygon2.cmp); - expect(wkt.write()).toBe(cases.polygon2.str); - }); - - - it('should convert a google.maps.Data.MultiPoint instance into a MULTIPOINT string', function () { - var dataMultiPoint = dataObjects.addGeoJson({ - "type": "Feature", - geometry: cases.multipoint.json - })[0]; - wkt.fromObject(dataMultiPoint.getGeometry()); - expect(wkt.type).toBe('multipoint'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.multipoint.cmp); - expect(wkt.write()).toBe(cases.multipoint.str); - }); - - it('should convert a google.maps.Data.MultiLineString instance into a MULTILINESTRING string', function () { - var dataMultiLineString = dataObjects.addGeoJson({ - "type": "Feature", - geometry: cases.multilinestring.json - })[0]; - wkt.fromObject(dataMultiLineString.getGeometry()); - expect(wkt.type).toBe('multilinestring'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.multilinestring.cmp); - expect(wkt.write()).toBe(cases.multilinestring.str); - }); - - it('should convert a google.maps.Data.MultiPolygon instance into a MULTIPOLYGON string', function () { - var dataMultiPolygon = dataObjects.addGeoJson({ - "type": "Feature", - geometry: cases.multipolygon.json - })[0]; - wkt.fromObject(dataMultiPolygon.getGeometry()); - expect(wkt.type).toBe('multipolygon'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.multipolygon.cmp); - expect(wkt.write()).toBe(cases.multipolygon.str); - }); - - it('should convert a google.maps.Data.MultiPolygon with holes, into a MULTIPOLYGON string with the same holes', function () { - var dataMultiPolygon2 = dataObjects.addGeoJson({ - "type": "Feature", - geometry: cases.multipolygon2.json - })[0]; - wkt.fromObject(dataMultiPolygon2.getGeometry()); - expect(wkt.type).toBe('multipolygon'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.multipolygon2.cmp); - expect(wkt.write()).toBe(cases.multipolygon2.str); - }); - - it('should convert a google.maps.Data.GeometryCollection into a GEOMETRYCOLLECTION string', function () { - var dataGeometryCollection = dataObjects.addGeoJson({ - "type": "Feature", - geometry: cases.geometrycollection.json - })[0]; - - wkt.fromObject(dataGeometryCollection.getGeometry()); - expect(wkt.type).toBe('geometrycollection'); - //expect(wkt.isCollection()).toBe(true); - - }); - - }); - - - describe('Coverting WKT strings into objects: ', function () { - - afterEach(function () { - wkt.delimiter = ' '; - }); - - it('should convert a basic POINT string to a Marker instance', function () { - wkt.read(cases.marker.str); - expect(wkt.type).toBe('point'); - expect(wkt.isCollection()).toBe(false); - expect(wkt.components).toEqual(cases.marker.cmp); - expect(wkt.toObject().getPosition()).toEqual(cases.marker.obj.getPosition()); - }); - - it('should convert a basic LINESTRING string to a Polyline instance', function () { - wkt.read(cases.linestring.str); - expect(wkt.type).toBe('linestring'); - expect(wkt.isCollection()).toBe(false); - expect(wkt.components).toEqual(cases.linestring.cmp); - expect(wkt.toObject().getPath()).toEqual(cases.linestring.obj.getPath()); - }); - - it('should convert a basic POLYGON string to a Polygon instance', function () { - wkt.read(cases.polygon.str); - expect(wkt.type).toBe('polygon'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.polygon.cmp); - expect(wkt.toObject().getPaths()).toEqual(cases.polygon.obj.getPaths()); - }); - - it('should convert a POLYGON string with a hole to a Polygon instance with the same hole', function () { - wkt.read(cases.polygon2.str); - expect(wkt.type).toBe('polygon'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.polygon2.cmp); - expect(wkt.toObject().getPaths()).toEqual(cases.polygon2.obj.getPaths()); - }); - - it('should convert a POLYGON string, with isRectangle=true, into a Rectangle instance', function () { - wkt.read(cases.rectangle.str); - wkt.isRectangle = true; - expect(wkt.type).toBe('polygon'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.rectangle.cmp); - expect(wkt.toObject().getBounds()).toEqual(cases.rectangle.obj.getBounds()); - expect(wkt.toObject().constructor).toEqual(google.maps.Rectangle); - }); - - it('should convert a MULTIPOINT string into an Array of Marker instances', function () { - var m; - - wkt.read(cases.multipoint.str); - expect(wkt.type).toBe('multipoint'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.multipoint.cmp); - - markers = wkt.toObject(); - for (m = 0; m < markers.length; m += 1) { - expect(markers[m].getPosition()).toEqual(cases.multipoint.obj[m].getPosition()); - } - }); - - it('should convert a MULTILINESTRING string into an Array of Polyline instances', function () { - wkt.read(cases.multilinestring.str); - expect(wkt.type).toBe('multilinestring'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.multilinestring.cmp); - expect(wkt.toObject()).toEqual(cases.multilinestring.obj); - }); - - it('should convert a MULTIPOLYGON string into an Array of Polygon instances', function () { - wkt.read(cases.multipolygon.str); - expect(wkt.type).toBe('multipolygon'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.multipolygon.cmp); - expect(wkt.toObject()).toEqual(cases.multipolygon.obj); - }); - - it('should convert a MULTIPOLYGON string with holes into an Array of Polygon instances with the same holes', function () { - wkt.read(cases.multipolygon2.str); - expect(wkt.type).toBe('multipolygon'); - expect(wkt.isCollection()).toBe(true); - expect(wkt.components).toEqual(cases.multipolygon2.cmp); - expect(wkt.toObject()).toEqual(cases.multipolygon2.obj); - }); - - it('should convert a PostGIS 2DBOX string into a Rectangle instance', function () { - wkt.read(cases.box.str); - expect(wkt.type).toBe('box'); - expect(wkt.isCollection()).toBe(false); - expect(wkt.components).toEqual(cases.box.cmp); - expect(wkt.toObject().getBounds()).toEqual(cases.box.obj.getBounds()); - }); - - }); - -}); \ No newline at end of file diff --git a/pacotes/wicket/tests/wicket-gmap3.html b/pacotes/wicket/tests/wicket-gmap3.html deleted file mode 100755 index a11c594..0000000 --- a/pacotes/wicket/tests/wicket-gmap3.html +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Jasmine Spec Runner v2.0.0 - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pacotes/wicket/tests/wicket-spec.js b/pacotes/wicket/tests/wicket-spec.js deleted file mode 100755 index 020963e..0000000 --- a/pacotes/wicket/tests/wicket-spec.js +++ /dev/null @@ -1,1952 +0,0 @@ -var Wkt = require('../wicket'); -var expect = require('chai').expect; - -describe('Consistent Design Patterns', function() { - - it('should read WKT string when instantiated', function() { - var wkt = new Wkt.Wkt('POINT(30 10)'); - - expect(wkt.components).deep.equal([{ - x: 30, - y: 10 - }]); - }); - - it('should correctly identify an Array', function() { - expect(Wkt.isArray([0, 1])).equal(true); - expect(Wkt.isArray({ - x: 0, - y: 1 - })).equal(false); - expect(Wkt.isArray(0)).equal(false); - expect(Wkt.isArray(new Date())).equal(false); - }); - -}); - -describe('Standard WKT Test Cases: ', function() { - var cases, wkt; - - wkt = new Wkt.Wkt(); - - cases = { - - point: { - str: 'POINT(30 10)', - cmp: [{ - x: 30, - y: 10 - }] - }, - - linestring: { - str: 'LINESTRING(30 10,10 30,40 40)', - cmp: [{ - x: 30, - y: 10 - }, { - x: 10, - y: 30 - }, { - x: 40, - y: 40 - }] - }, - - polygon: { - str: 'POLYGON((30 10,10 20,20 40,40 40,30 10))', - cmp: [ - [{ - x: 30, - y: 10 - }, { - x: 10, - y: 20 - }, { - x: 20, - y: 40 - }, { - x: 40, - y: 40 - }, { - x: 30, - y: 10 - }] - ] - }, - - polygon2: { - str: 'POLYGON((35 10,10 20,15 40,45 45,35 10),(20 30,35 35,30 20,20 30))', - cmp: [ - [{ - x: 35, - y: 10 - }, { - x: 10, - y: 20 - }, { - x: 15, - y: 40 - }, { - x: 45, - y: 45 - }, { - x: 35, - y: 10 - }], - [{ - x: 20, - y: 30 - }, { - x: 35, - y: 35 - }, { - x: 30, - y: 20 - }, { - x: 20, - y: 30 - }] - ] - }, - - multipoint: { - str: 'MULTIPOINT((10 40),(40 30),(20 20),(30 10))', - cmp: [ - [{ - x: 10, - y: 40 - }], - [{ - x: 40, - y: 30 - }], - [{ - x: 20, - y: 20 - }], - [{ - x: 30, - y: 10 - }] - ] - }, - - multipoint2: { - str: 'MULTIPOINT(10 40,40 30,20 20,30 10)', - cmp: [ - [{ - x: 10, - y: 40 - }], - [{ - x: 40, - y: 30 - }], - [{ - x: 20, - y: 20 - }], - [{ - x: 30, - y: 10 - }] - ] - }, - - multilinestring: { - str: 'MULTILINESTRING((10 10,20 20,10 40),(40 40,30 30,40 20,30 10))', - cmp: [ - [{ - x: 10, - y: 10 - }, { - x: 20, - y: 20 - }, { - x: 10, - y: 40 - }], - [{ - x: 40, - y: 40 - }, { - x: 30, - y: 30 - }, { - x: 40, - y: 20 - }, { - x: 30, - y: 10 - }] - ] - }, - - multipolygon: { - str: 'MULTIPOLYGON(((30 20,10 40,45 40,30 20)),((15 5,40 10,10 20,5 10,15 5)))', - cmp: [ - [ - [{ - x: 30, - y: 20 - }, { - x: 10, - y: 40 - }, { - x: 45, - y: 40 - }, { - x: 30, - y: 20 - }, ] - ], - [ - [{ - x: 15, - y: 5 - }, { - x: 40, - y: 10 - }, { - x: 10, - y: 20 - }, { - x: 5, - y: 10 - }, { - x: 15, - y: 5 - }] - ] - ] - }, - - multipolygon2: { - str: 'MULTIPOLYGON(((40 40,20 45,45 30,40 40)),((20 35,45 20,30 5,10 10,10 30,20 35),(30 20,20 25,20 15,30 20)))', - cmp: [ - [ - [{ - x: 40, - y: 40 - }, { - x: 20, - y: 45 - }, { - x: 45, - y: 30 - }, { - x: 40, - y: 40 - }, ] - ], - [ - [{ - x: 20, - y: 35 - }, { - x: 45, - y: 20 - }, { - x: 30, - y: 5 - }, { - x: 10, - y: 10 - }, { - x: 10, - y: 30 - }, { - x: 20, - y: 35 - }, ], - [{ - x: 30, - y: 20 - }, { - x: 20, - y: 25 - }, { - x: 20, - y: 15 - }, { - x: 30, - y: 20 - }] - ] - ] - }, - - box: { - str: 'BOX(0 0,20 20)', - cmp: [{ - x: 0, - y: 0 - }, { - x: 20, - y: 20 - }] - } - - }; - - describe('Reading WKT Strings: ', function() { - - afterEach(function() { - wkt.delimiter = ' '; - }); - - it('should read basic POINT string', function() { - wkt.read(cases.point.str); - - expect(wkt.type).equal('point'); - expect(wkt.isCollection()).equal(false); - expect(wkt.components).deep.equal(cases.point.cmp); - - // Now try it for URLs - wkt.delimiter = '+'; - wkt.read(cases.point.str.replace(/ /g, '+')); - expect(wkt.components).deep.equal(cases.point.cmp); - }); - - it('should read basic LINESTRING string', function() { - wkt.read(cases.linestring.str); - - expect(wkt.type).equal('linestring'); - expect(wkt.isCollection()).equal(false); - expect(wkt.components).deep.equal(cases.linestring.cmp); - - // Now try it for URLs - wkt.delimiter = '+'; - wkt.read(cases.linestring.str.replace(/ /g, '+')); - expect(wkt.components).deep.equal(cases.linestring.cmp); - }); - - it('should read basic POLYGON string', function() { - wkt.read(cases.polygon.str); - - expect(wkt.type).equal('polygon'); - expect(wkt.isCollection()).equal(true); - expect(wkt.components).deep.equal(cases.polygon.cmp); - - // Now try it for URLs - wkt.delimiter = '+'; - wkt.read(cases.polygon.str.replace(/ /g, '+')); - expect(wkt.components).deep.equal(cases.polygon.cmp); - }); - - it('should read basic POLYGON string with one (1) hole', function() { - wkt.read(cases.polygon2.str); - - expect(wkt.type).equal('polygon'); - expect(wkt.isCollection()).equal(true); - expect(wkt.components).deep.equal(cases.polygon2.cmp); - - // Now try it for URLs - wkt.delimiter = '+'; - wkt.read(cases.polygon2.str.replace(/ /g, '+')); - expect(wkt.components).deep.equal(cases.polygon2.cmp); - }); - - it('should read basic MULTIPOINT string with wrapped vertices', function() { - wkt.read(cases.multipoint.str); - - expect(wkt.type).equal('multipoint'); - expect(wkt.isCollection()).equal(true); - expect(wkt.components).deep.equal(cases.multipoint.cmp); - - // Now try it for URLs - wkt.delimiter = '+'; - wkt.read(cases.multipoint.str.replace(/ /g, '+')); - expect(wkt.components).deep.equal(cases.multipoint.cmp); - }); - - it('should read basic MULTIPOINT string without wrapped vertices', function() { - wkt.read(cases.multipoint2.str); - - expect(wkt.type).equal('multipoint'); - expect(wkt.isCollection()).equal(true); - expect(wkt.components).deep.equal(cases.multipoint2.cmp); - - // Now try it for URLs - wkt.delimiter = '+'; - wkt.read(cases.multipoint2.str.replace(/ /g, '+')); - expect(wkt.components).deep.equal(cases.multipoint2.cmp); - }); - - it('should read basic MULTILINESTRING string', function() { - wkt.read(cases.multilinestring.str); - - expect(wkt.type).equal('multilinestring'); - expect(wkt.isCollection()).equal(true); - expect(wkt.components).deep.equal(cases.multilinestring.cmp); - - // Now try it for URLs - wkt.delimiter = '+'; - wkt.read(cases.multilinestring.str.replace(/ /g, '+')); - expect(wkt.components).deep.equal(cases.multilinestring.cmp); - }); - - it('should read basic MULTIPOLYGON string', function() { - wkt.read(cases.multipolygon.str); - - expect(wkt.type).equal('multipolygon'); - expect(wkt.isCollection()).equal(true); - expect(wkt.components).deep.equal(cases.multipolygon.cmp); - - // Now try it for URLs - wkt.delimiter = '+'; - wkt.read(cases.multipolygon.str.replace(/ /g, '+')); - expect(wkt.components).deep.equal(cases.multipolygon.cmp); - }); - - it('should read basic MULTIPOLYGON string with two (2) polygons, one with one (1) hole', function() { - wkt.read(cases.multipolygon2.str); - - expect(wkt.type).equal('multipolygon'); - expect(wkt.isCollection()).equal(true); - expect(wkt.components).deep.equal(cases.multipolygon2.cmp); - - // Now try it for URLs - wkt.delimiter = '+'; - wkt.read(cases.multipolygon2.str.replace(/ /g, '+')); - expect(wkt.components).deep.equal(cases.multipolygon2.cmp); - }); - - it('should read basic PostGIS 2DBOX string', function() { - wkt.read(cases.box.str); - - expect(wkt.type).equal('box'); - expect(wkt.isCollection()).equal(false); - expect(wkt.components).deep.equal(cases.box.cmp); - - // Now try it for URLs - wkt.delimiter = '+'; - wkt.read(cases.box.str.replace(/ /g, '+')); - expect(wkt.components).deep.equal(cases.box.cmp); - }); - - }); // eo describe() - - describe('Writing Well-Formed WKT Strings: ', function() { - - afterEach(function() { - wkt.wrapVertices = false; - wkt.delimiter = ' '; - }); - - it('should write basic POINT string', function() { - wkt.components = cases.point.cmp; - wkt.type = 'point'; - - expect(wkt.write()).equal(cases.point.str); - - // Now try it for URLs - wkt.delimiter = '+'; - expect(wkt.write()).equal(cases.point.str.replace(/ /g, '+')); - }); - - it('should write basic LINESTRING string', function() { - wkt.components = cases.linestring.cmp; - wkt.type = 'linestring'; - - expect(wkt.write()).equal(cases.linestring.str); - - // Now try it for URLs - wkt.delimiter = '+'; - expect(wkt.write()).equal(cases.linestring.str.replace(/ /g, '+')); - }); - - it('should write basic POLYGON string', function() { - wkt.components = cases.polygon.cmp; - wkt.type = 'polygon'; - - expect(wkt.write()).equal(cases.polygon.str); - - // Now try it for URLs - wkt.delimiter = '+'; - expect(wkt.write()).equal(cases.polygon.str.replace(/ /g, '+')); - }); - - it('should write basic POLYGON string with one (1) hole', function() { - wkt.components = cases.polygon2.cmp; - wkt.type = 'polygon'; - - expect(wkt.write()).equal(cases.polygon2.str); - - // Now try it for URLs - wkt.delimiter = '+'; - expect(wkt.write()).equal(cases.polygon2.str.replace(/ /g, '+')); - }); - - it('should write basic MULTIPOINT string with wrapped vertices', function() { - wkt.components = cases.multipoint.cmp; - wkt.type = 'multipoint'; - wkt.wrapVertices = true; - - expect(wkt.write()).equal(cases.multipoint.str); - - // Now try it for URLs - wkt.delimiter = '+'; - expect(wkt.write()).equal(cases.multipoint.str.replace(/ /g, '+')); - }); - - it('should write basic MULTIPOINT string without wrapped vertices', function() { - wkt.components = cases.multipoint2.cmp; - wkt.type = 'multipoint'; - wkt.wrapVertices = false; - - expect(wkt.write()).equal(cases.multipoint2.str); - - // Now try it for URLs - wkt.delimiter = '+'; - expect(wkt.write()).equal(cases.multipoint2.str.replace(/ /g, '+')); - }); - - it('should write basic MULTILINESTRING string', function() { - wkt.components = cases.multilinestring.cmp; - wkt.type = 'multilinestring'; - - expect(wkt.write()).equal(cases.multilinestring.str); - - // Now try it for URLs - wkt.delimiter = '+'; - expect(wkt.write()).equal(cases.multilinestring.str.replace(/ /g, '+')); - }); - - it('should write basic MULTIPOLYGON string', function() { - wkt.components = cases.multipolygon.cmp; - wkt.type = 'multipolygon'; - - expect(wkt.write()).equal(cases.multipolygon.str); - - // Now try it for URLs - wkt.delimiter = '+'; - expect(wkt.write()).equal(cases.multipolygon.str.replace(/ /g, '+')); - }); - - it('should write basic MULTIPOLYGON string with two (2) polygons, one with one (1) hole', function() { - wkt.components = cases.multipolygon2.cmp; - wkt.type = 'multipolygon'; - - expect(wkt.write()).equal(cases.multipolygon2.str); - - // Now try it for URLs - wkt.delimiter = '+'; - expect(wkt.write()).equal(cases.multipolygon2.str.replace(/ /g, '+')); - }); - - it('should write basic PostGIS 2DBOX string', function() { - wkt.components = cases.box.cmp; - wkt.type = 'box'; - - expect(wkt.write()).equal(cases.box.str); - - // Now try it for URLs - wkt.delimiter = '+'; - expect(wkt.write()).equal(cases.box.str.replace(/ /g, '+')); - }); - - }); - -}); // eo describe() - -describe('Arbitrary WKT Test Cases: ', function() { - var cases, wkt; - - wkt = new Wkt.Wkt(); - - function randomLat(a, b) { - var n; - - a = a || 0; - b = b || 90; - n = Math.random() * (a + (b - a)); - return (Math.random() < 0.5) ? -n : n; - }; - - function randomLng(a, b) { - var n; - - a = a || 0; - b = b || 180; - n = Math.random() * (a + (b - a)); - return (Math.random() < 0.5) ? -n : n; - }; - - function randomCoords(n, a1, b1, a2, b2) { - var i, c, cs; - - i = 0; - a1 = a1 || 0; - b1 = b1 || 180; - a2 = a2 || 0; - b2 = b2 || 90; - cs = []; - - while (i < n) { - cs.push({ - x: randomLng(a1, b1), - y: randomLat(a2, b2) - }); - i += 1; - } - - return cs; - }; - - it('should be able to read WKT strings with bizarre whitespace', function() { - wkt.read(' LINESTRING ( 30 10, 10 30, 40 40) '); - expect(wkt.write()).equal('LINESTRING(30 10,10 30,40 40)'); - }); - - it('should be able to read WKT strings with (somewhat) arbitrary precision', function() { - wkt.read('MULTIPOINT((9.12345 40),(40 30),(20 19.999999),(30 10.000001))'); - expect(wkt.write()).equal('MULTIPOINT((9.12345 40),(40 30),(20 19.999999),(30 10.000001))'); - }); - - describe('Working with Random Coordinates: ', function() { - var c; - - it('should read and write arbitrary POINT string', function() { - c = wkt.components = randomCoords(1); - wkt.type = 'point'; - - expect(wkt.read(wkt.write()).components).deep.equal(c); - }); - - it('should read and write long, arbitrary LINESTRING string', function() { - c = wkt.components = randomCoords(100); - wkt.type = 'linestring'; - - expect(wkt.read(wkt.write()).components).deep.equal(c); - }); - - it('should read and write long, arbitrary POLYGON string', function() { - c = wkt.components = [randomCoords(100)]; - wkt.type = 'polygon'; - - expect(wkt.read(wkt.write()).components).deep.equal(c); - }); - - }); -}); - -describe('Edge Cases: ', function() { - var wkt = new Wkt.Wkt(); - - afterEach(function() { - wkt.wrapVertices = false; - wkt.delimiter = ' '; - }); - - it('should read a POINT string with single-digit coordinates', function() { - var test = { - str: 'POINT(4 4)', - cmp: [{ - x: 4, - y: 4 - }] - }; - - wkt.read(test.str); - - expect(wkt.type).equal('point'); - expect(wkt.isCollection()).equal(false); - expect(wkt.components).deep.equal(test.cmp); - - // Now try it for URLs - wkt.delimiter = '+'; - wkt.read(test.str.replace(/ /g, '+')); - expect(wkt.components).deep.equal(test.cmp); - }); - - it('should read a LINESTRING string with single-digit coordinates', function() { - var test = { - str: 'LINESTRING(4 4,3 5,6 7)', - cmp: [{ - x: 4, - y: 4 - }, { - x: 3, - y: 5 - }, { - x: 6, - y: 7 - }] - }; - - wkt.read(test.str); - - expect(wkt.type).equal('linestring'); - expect(wkt.isCollection()).equal(false); - expect(wkt.components).deep.equal(test.cmp); - - // Now try it for URLs - wkt.delimiter = '+'; - wkt.read(test.str.replace(/ /g, '+')); - expect(wkt.components).deep.equal(test.cmp); - }); - - it('should read a POLYGON string with single-digit coordinates', function() { - var test = { - str: 'POLYGON((4 4,3 5,6 7,7 5,4 4))', - cmp: [ - [{ - x: 4, - y: 4 - }, { - x: 3, - y: 5 - }, { - x: 6, - y: 7 - }, { - x: 7, - y: 5 - }, { - x: 4, - y: 4 - }] - ] - }; - - wkt.read(test.str); - - expect(wkt.type).equal('polygon'); - expect(wkt.isCollection()).equal(true); - expect(wkt.components).deep.equal(test.cmp); - - // Now try it for URLs - wkt.delimiter = '+'; - wkt.read(test.str.replace(/ /g, '+')); - expect(wkt.components).deep.equal(test.cmp); - }); - - it('should read a POLYGON string with excess precision', function() { - var test = { - str: 'POLYGON((4.1234 4,3 5,6 7,7 5.5678,4 4))', - cmp: [ - [{ - x: 4.1234, - y: 4 - }, { - x: 3, - y: 5 - }, { - x: 6, - y: 7 - }, { - x: 7, - y: 5.5678 - }, { - x: 4, - y: 4 - }] - ] - }; - - wkt.read(test.str); - - expect(wkt.type).equal('polygon'); - expect(wkt.isCollection()).equal(true); - expect(wkt.components).deep.equal(test.cmp); - - // Now try it for URLs - wkt.delimiter = '+'; - wkt.read(test.str.replace(/ /g, '+')); - expect(wkt.components).deep.equal(test.cmp); - }); - -}); // eo describe() - -describe('Merged WKT Test Cases: ', function() { - var cases = { - - pointA: { - str: 'POINT(30 10)', - cmp: [{ - x: 30, - y: 10 - }] - }, - - pointB: { - str: 'POINT(25 45)', - cmp: [{ - x: 25, - y: 45 - }] - }, - - linestringA: { - str: 'LINESTRING(25 15,15 35,35 35)', - cmp: [{ - x: 25, - y: 15 - }, { - x: 15, - y: 35 - }, { - x: 35, - y: 35 - }] - }, - - linestringB: { - str: 'LINESTRING(30 10,10 30,40 40)', - cmp: [{ - x: 30, - y: 10 - }, { - x: 10, - y: 30 - }, { - x: 40, - y: 40 - }] - }, - - polygonA: { - str: 'POLYGON((30 10,10 20,20 40,40 40,30 10))', - cmp: [ - [{ - x: 30, - y: 10 - }, { - x: 10, - y: 20 - }, { - x: 20, - y: 40 - }, { - x: 40, - y: 40 - }, { - x: 30, - y: 10 - }] - ] - }, - - polygonB: { - str: 'POLYGON((35 15,15 25,25 45,45 45,35 15))', - cmp: [ - [{ - x: 35, - y: 15 - }, { - x: 15, - y: 25 - }, { - x: 25, - y: 45 - }, { - x: 45, - y: 45 - }, { - x: 35, - y: 15 - }] - ] - }, - - polygon2A: { - str: 'POLYGON((35 10,10 20,15 40,45 45,35 10),(20 30,35 35,30 20,20 30))', - cmp: [ - [{ - x: 35, - y: 10 - }, { - x: 10, - y: 20 - }, { - x: 15, - y: 40 - }, { - x: 45, - y: 45 - }, { - x: 35, - y: 10 - }], - [{ - x: 20, - y: 30 - }, { - x: 35, - y: 35 - }, { - x: 30, - y: 20 - }, { - x: 20, - y: 30 - }] - ] - }, - - polygon2B: { - str: 'POLYGON((135 110,110 120,115 140,145 145,135 110),(120 130,135 135,130 120,120 130))', - cmp: [ - [{ - x: 135, - y: 110 - }, { - x: 110, - y: 120 - }, { - x: 115, - y: 140 - }, { - x: 145, - y: 145 - }, { - x: 135, - y: 110 - }], - [{ - x: 120, - y: 130 - }, { - x: 135, - y: 135 - }, { - x: 130, - y: 120 - }, { - x: 120, - y: 130 - }] - ] - }, - - multipointA: { - str: 'MULTIPOINT((10 40),(40 30),(20 20),(30 10))', - cmp: [ - [{ - x: 10, - y: 40 - }], - [{ - x: 40, - y: 30 - }], - [{ - x: 20, - y: 20 - }], - [{ - x: 30, - y: 10 - }] - ] - }, - - multipointB: { - str: 'MULTIPOINT((15 45),(45 35),(25 25),(35 15))', - cmp: [ - [{ - x: 15, - y: 45 - }], - [{ - x: 45, - y: 35 - }], - [{ - x: 25, - y: 25 - }], - [{ - x: 35, - y: 15 - }] - ] - }, - - multilinestringA: { - str: 'MULTILINESTRING((10 10,20 20,10 40),(40 40,30 30,40 20,30 10))', - cmp: [ - [{ - x: 10, - y: 10 - }, { - x: 20, - y: 20 - }, { - x: 10, - y: 40 - }], - [{ - x: 40, - y: 40 - }, { - x: 30, - y: 30 - }, { - x: 40, - y: 20 - }, { - x: 30, - y: 10 - }] - ] - }, - - multilinestringB: { - str: 'MULTILINESTRING((15 15,25 25,15 45),(45 45,35 35,45 25,35 15))', - cmp: [ - [{ - x: 15, - y: 15 - }, { - x: 25, - y: 25 - }, { - x: 15, - y: 45 - }], - [{ - x: 45, - y: 45 - }, { - x: 35, - y: 35 - }, { - x: 45, - y: 25 - }, { - x: 35, - y: 15 - }] - ] - }, - - multipolygonA: { - str: 'MULTIPOLYGON(((30 20,10 40,45 40,30 20)),((15 5,40 10,10 20,5 10,15 5)))', - cmp: [ - [ - [{ - x: 30, - y: 20 - }, { - x: 10, - y: 40 - }, { - x: 45, - y: 40 - }, { - x: 30, - y: 20 - }, ] - ], - [ - [{ - x: 15, - y: 5 - }, { - x: 40, - y: 10 - }, { - x: 10, - y: 20 - }, { - x: 5, - y: 10 - }, { - x: 15, - y: 5 - }] - ] - ] - }, - - multipolygonB: { - str: 'MULTIPOLYGON(((130 120,110 140,145 140,130 120)),((115 15,140 110,110 120,15 110,115 15)))', - cmp: [ - [ - [{ - x: 130, - y: 120 - }, { - x: 110, - y: 140 - }, { - x: 145, - y: 140 - }, { - x: 130, - y: 120 - }, ] - ], - [ - [{ - x: 115, - y: 15 - }, { - x: 140, - y: 110 - }, { - x: 110, - y: 120 - }, { - x: 15, - y: 110 - }, { - x: 115, - y: 15 - }] - ] - ] - } - - }; - - it('should merge POINT strings together', function() { - var a = new Wkt.Wkt(cases.pointA.str), - b = new Wkt.Wkt(cases.pointB.str); - - a.merge(b); - expect(a.type).equal('multipoint'); - expect(b.type).equal('point'); - expect(a.isCollection()).equal(true); - expect(b.isCollection()).equal(false); - expect(a.write()).equal('MULTIPOINT((30 10),(25 45))'); - expect(a.components).deep.equal([ - [{ - x: 30, - y: 10 - }, { - x: 25, - y: 45 - }] - ]); - - }); - - it('should merge LINESTRING strings together', function() { - var a = new Wkt.Wkt(cases.linestringA.str), - b = new Wkt.Wkt(cases.linestringB.str); - - a.merge(b); - expect(a.type).equal('multilinestring'); - expect(b.type).equal('linestring'); - expect(a.isCollection()).equal(true); - expect(b.isCollection()).equal(false); - expect(a.write()).equal('MULTILINESTRING((25 15,15 35,35 35),(30 10,10 30,40 40))'); - expect(a.components).deep.equal([ - [{ - x: 25, - y: 15 - }, { - x: 15, - y: 35 - }, { - x: 35, - y: 35 - }], - [{ - x: 30, - y: 10 - }, { - x: 10, - y: 30 - }, { - x: 40, - y: 40 - }] - ]); - - }); - - it('should merge POLYGON strings together', function() { - var a = new Wkt.Wkt(cases.polygonA.str), - b = new Wkt.Wkt(cases.polygonB.str); - - a.merge(b); - expect(a.type).equal('multipolygon'); - expect(b.type).equal('polygon'); - expect(a.isCollection()).equal(true); - expect(b.isCollection()).equal(true); - expect(a.write()).equal('MULTIPOLYGON(((30 10,10 20,20 40,40 40,30 10)),((35 15,15 25,25 45,45 45,35 15)))'); - expect(a.components).deep.equal([ - [ - [{ - x: 30, - y: 10 - }, { - x: 10, - y: 20 - }, { - x: 20, - y: 40 - }, { - x: 40, - y: 40 - }, { - x: 30, - y: 10 - }] - ], - [ - [{ - x: 35, - y: 15 - }, { - x: 15, - y: 25 - }, { - x: 25, - y: 45 - }, { - x: 45, - y: 45 - }, { - x: 35, - y: 15 - }] - ] - ]); - - }); - - it('should merge POLYGON strings together even if they have holes', function() { - var a = new Wkt.Wkt(cases.polygon2A.str), - b = new Wkt.Wkt(cases.polygon2B.str); - - a.merge(b); - expect(a.type).equal('multipolygon'); - expect(b.type).equal('polygon'); - expect(a.isCollection()).equal(true); - expect(b.isCollection()).equal(true); - expect(a.write()).equal('MULTIPOLYGON(((35 10,10 20,15 40,45 45,35 10),(20 30,35 35,30 20,20 30)),((135 110,110 120,115 140,145 145,135 110),(120 130,135 135,130 120,120 130)))'); - expect(a.components).deep.equal([ - [ - [{ - x: 35, - y: 10 - }, { - x: 10, - y: 20 - }, { - x: 15, - y: 40 - }, { - x: 45, - y: 45 - }, { - x: 35, - y: 10 - }], - [{ - x: 20, - y: 30 - }, { - x: 35, - y: 35 - }, { - x: 30, - y: 20 - }, { - x: 20, - y: 30 - }] - ], - [ - [{ - x: 135, - y: 110 - }, { - x: 110, - y: 120 - }, { - x: 115, - y: 140 - }, { - x: 145, - y: 145 - }, { - x: 135, - y: 110 - }], - [{ - x: 120, - y: 130 - }, { - x: 135, - y: 135 - }, { - x: 130, - y: 120 - }, { - x: 120, - y: 130 - }] - ] - ]); - - }); - - it('should merge MULTIPOINT strings together', function() { - var a = new Wkt.Wkt(cases.multipointA.str), - b = new Wkt.Wkt(cases.multipointB.str); - - a.merge(b); - expect(a.type).equal('multipoint'); - expect(b.type).equal('multipoint'); - expect(a.isCollection()).equal(true); - expect(b.isCollection()).equal(true); - expect(a.write()).equal('MULTIPOINT((10 40),(40 30),(20 20),(30 10),(15 45),(45 35),(25 25),(35 15))'); - expect(a.components).deep.equal([ - [{ - x: 10, - y: 40 - }], - [{ - x: 40, - y: 30 - }], - [{ - x: 20, - y: 20 - }], - [{ - x: 30, - y: 10 - }], - [{ - x: 15, - y: 45 - }], - [{ - x: 45, - y: 35 - }], - [{ - x: 25, - y: 25 - }], - [{ - x: 35, - y: 15 - }] - ]); - - }); - - it('should merge MULTILINESTRING strings together', function() { - var a = new Wkt.Wkt(cases.multilinestringA.str), - b = new Wkt.Wkt(cases.multilinestringB.str); - - a.merge(b); - expect(a.type).equal('multilinestring'); - expect(b.type).equal('multilinestring'); - expect(a.isCollection()).equal(true); - expect(b.isCollection()).equal(true); - expect(a.write()).equal('MULTILINESTRING((10 10,20 20,10 40),(40 40,30 30,40 20,30 10),(15 15,25 25,15 45),(45 45,35 35,45 25,35 15))'); - expect(a.components).deep.equal([ - [{ - x: 10, - y: 10 - }, { - x: 20, - y: 20 - }, { - x: 10, - y: 40 - }], - [{ - x: 40, - y: 40 - }, { - x: 30, - y: 30 - }, { - x: 40, - y: 20 - }, { - x: 30, - y: 10 - }], - [{ - x: 15, - y: 15 - }, { - x: 25, - y: 25 - }, { - x: 15, - y: 45 - }], - [{ - x: 45, - y: 45 - }, { - x: 35, - y: 35 - }, { - x: 45, - y: 25 - }, { - x: 35, - y: 15 - }] - ]); - - }); - - it('should merge MULTIPOLYGON strings together', function() { - var a = new Wkt.Wkt(cases.multipolygonA.str), - b = new Wkt.Wkt(cases.multipolygonB.str); - - a.merge(b); - expect(a.type).equal('multipolygon'); - expect(b.type).equal('multipolygon'); - expect(a.isCollection()).equal(true); - expect(b.isCollection()).equal(true); - expect(a.write()).equal('MULTIPOLYGON(((30 20,10 40,45 40,30 20)),((15 5,40 10,10 20,5 10,15 5)),((130 120,110 140,145 140,130 120)),((115 15,140 110,110 120,15 110,115 15)))'); - expect(a.components).deep.equal([ - [ - [{ - x: 30, - y: 20 - }, { - x: 10, - y: 40 - }, { - x: 45, - y: 40 - }, { - x: 30, - y: 20 - }, ] - ], - [ - [{ - x: 15, - y: 5 - }, { - x: 40, - y: 10 - }, { - x: 10, - y: 20 - }, { - x: 5, - y: 10 - }, { - x: 15, - y: 5 - }] - ], - [ - [{ - x: 130, - y: 120 - }, { - x: 110, - y: 140 - }, { - x: 145, - y: 140 - }, { - x: 130, - y: 120 - }, ] - ], - [ - [{ - x: 115, - y: 15 - }, { - x: 140, - y: 110 - }, { - x: 110, - y: 120 - }, { - x: 15, - y: 110 - }, { - x: 115, - y: 15 - }] - ] - ]); - - }); - - it('should merge POINT strings into MULTIPOINT strings', function() { - var a = new Wkt.Wkt(cases.multipointA.str), - b = new Wkt.Wkt(cases.pointB.str); - - a.merge(b); - expect(a.type).equal('multipoint'); - expect(b.type).equal('point'); - expect(a.isCollection()).equal(true); - expect(b.isCollection()).equal(false); - expect(a.write()).equal('MULTIPOINT((10 40),(40 30),(20 20),(30 10),(25 45))'); - expect(a.components).deep.equal([ - [{ - x: 10, - y: 40 - }], - [{ - x: 40, - y: 30 - }], - [{ - x: 20, - y: 20 - }], - [{ - x: 30, - y: 10 - }], - [{ - x: 25, - y: 45 - }] - ]); - - }); - - it('should merge LINESTRING strings into MULTILINESTRING strings', function() { - var a = new Wkt.Wkt(cases.multilinestringA.str), - b = new Wkt.Wkt(cases.linestringB.str); - - a.merge(b); - expect(a.type).equal('multilinestring'); - expect(b.type).equal('linestring'); - expect(a.isCollection()).equal(true); - expect(b.isCollection()).equal(false); - expect(a.write()).equal('MULTILINESTRING((10 10,20 20,10 40),(40 40,30 30,40 20,30 10),(30 10,10 30,40 40))'); - expect(a.components).deep.equal([ - [{ - x: 10, - y: 10 - }, { - x: 20, - y: 20 - }, { - x: 10, - y: 40 - }], - [{ - x: 40, - y: 40 - }, { - x: 30, - y: 30 - }, { - x: 40, - y: 20 - }, { - x: 30, - y: 10 - }], - [{ - x: 30, - y: 10 - }, { - x: 10, - y: 30 - }, { - x: 40, - y: 40 - }] - ]); - - }); - - it('should merge POLYGON strings into MULTIPOLYGON strings', function() { - var a = new Wkt.Wkt(cases.multipolygonA.str), - b = new Wkt.Wkt(cases.polygonB.str); - - a.merge(b); - expect(a.type).equal('multipolygon'); - expect(b.type).equal('polygon'); - expect(a.isCollection()).equal(true); - expect(b.isCollection()).equal(true); - expect(a.write()).equal('MULTIPOLYGON(((30 20,10 40,45 40,30 20)),((15 5,40 10,10 20,5 10,15 5)),((35 15,15 25,25 45,45 45,35 15)))'); - expect(a.components).deep.equal([ - [ - [{ - x: 30, - y: 20 - }, { - x: 10, - y: 40 - }, { - x: 45, - y: 40 - }, { - x: 30, - y: 20 - }, ] - ], - [ - [{ - x: 15, - y: 5 - }, { - x: 40, - y: 10 - }, { - x: 10, - y: 20 - }, { - x: 5, - y: 10 - }, { - x: 15, - y: 5 - }] - ], - [ - [{ - x: 35, - y: 15 - }, { - x: 15, - y: 25 - }, { - x: 25, - y: 45 - }, { - x: 45, - y: 45 - }, { - x: 35, - y: 15 - }] - ] - ]); - - }); - -}); - -describe('GeoJSON Cases:', function() { - var cases = { // See: http://en.wikipedia.org/wiki/GeoJSON#Geometries - - point: { - str: 'POINT(30 10)', - json: { - 'coordinates': [30, 10], - 'type': 'Point' - }, - jsonStr: '{"coordinates": [30, 10], "type": "Point"}' - }, - - linestring: { - str: 'LINESTRING(30 10,10 30,40 40)', - json: { - 'coordinates': [ - [30, 10], - [10, 30], - [40, 40] - ], - 'type': 'LineString' - }, - jsonStr: '{"coordinates": [[30, 10], [10, 30], [40, 40]], "type": "LineString"}' - }, - - polygon: { - str: 'POLYGON((30 10,10 20,20 40,40 40,30 10))', - json: { - 'coordinates': [ - [ - [30, 10], - [10, 20], - [20, 40], - [40, 40], - [30, 10] - ] - ], - 'type': 'Polygon' - }, - jsonStr: '{"coordinates": [[[30, 10], [10, 20], [20, 40], [40, 40], [30, 10]]], "type": "Polygon"}' - }, - - polygon2: { - str: 'POLYGON((35 10,45 45,15 40,10 20,35 10),(20 30,35 35,30 20,20 30))', - json: { - 'coordinates': [ - [ - [35, 10], - [45, 45], - [15, 40], - [10, 20], - [35, 10] - ], - [ - [20, 30], - [35, 35], - [30, 20], - [20, 30] - ] - ], - 'type': 'Polygon' - }, - jsonStr: '{"coordinates": [[[35, 10], [45, 45], [15, 40], [10, 20], [35, 10]], [[20, 30], [35, 35], [30, 20], [20, 30]]], "type": "Polygon"}' - }, - - multipolygon: { - str: 'MULTIPOLYGON(((30 20,10 40,45 40,30 20)),((15 5,40 10,10 20,5 10,15 5)))', - json: { - 'coordinates': [ - [ - [ - [30, 20], - [10, 40], - [45, 40], - [30, 20] - ] - ], - [ - [ - [15, 5], - [40, 10], - [10, 20], - [5, 10], - [15, 5] - ] - ] - ], - 'type': 'MultiPolygon' - }, - jsonStr: '{"coordinates": [[[[30, 20], [10, 40], [45, 40], [30, 20]]], [[[15, 5], [40, 10], [10, 20], [5, 10], [15, 5]]]], "type": "MultiPolygon"}' - }, - - multipolygon2: { - str: 'MULTIPOLYGON(((40 40,20 45,45 30,40 40)),((20 35,10 30,10 10,30 5,45 20,20 35),(30 20,20 15,20 25,30 20)))', - json: { - 'coordinates': [ - [ - [ - [40, 40], - [20, 45], - [45, 30], - [40, 40] - ] - ], - [ - [ - [20, 35], - [10, 30], - [10, 10], - [30, 5], - [45, 20], - [20, 35] - ], - [ - [30, 20], - [20, 15], - [20, 25], - [30, 20] - ] - ] - ], - 'type': 'MultiPolygon' - }, - jsonStr: '{"coordinates": [[[[40, 40], [20, 45], [45, 30], [40, 40]]], [[[20, 35], [10, 30], [10, 10], [30, 5], [45, 20], [20, 35]], [[30, 20], [20, 15], [20, 25], [30, 20]]]], "type": "MultiPolygon"}' - }, - - multipoint: { - str: 'MULTIPOINT((10 40),(40 30),(20 20),(30 10))', - json: { - 'coordinates': [ - [10, 40], - [40, 30], - [20, 20], - [30, 10] - ], - 'type': 'MultiPoint' - }, - jsonStr: '{"coordinates": [[10, 40], [40, 30], [20, 20], [30, 10]], "type": "MultiPoint"}' - }, - - multilinestring: { - str: 'MULTILINESTRING((10 10,20 20,10 40),(40 40,30 30,40 20,30 10))', - json: { - 'coordinates': [ - [ - [10, 10], - [20, 20], - [10, 40] - ], - [ - [40, 40], - [30, 30], - [40, 20], - [30, 10] - ] - ], - 'type': 'MultiLineString' - }, - jsonStr: '{"coordinates": [[[10, 10], [20, 20], [10, 40]], [[40, 40], [30, 30], [40, 20], [30, 10]]], "type": "MultiLineString"}' - }, - - box: { - str: 'BOX(0 0,20 20)', - json: { - 'coordinates': [ - [ - [0, 0], - [0, 20], - [20, 20], - [20, 0], - [0, 0] - ] - ], - 'type': 'Polygon', - 'bbox': [0, 0, 20, 20] - } - } - - }; - - describe('GeoJSON Construction:', function() { - - it('should create valid JSON for WKT Point type', function() { - var a = new Wkt.Wkt(cases.point.str); - expect(a.toJson()).deep.equal(cases.point.json); - }); - - it('should create valid JSON for WKT LineString type', function() { - var a = new Wkt.Wkt(cases.linestring.str); - expect(a.toJson()).deep.equal(cases.linestring.json); - }); - - it('should create valid JSON for WKT Polygon type', function() { - var a = new Wkt.Wkt(cases.polygon.str); - expect(a.toJson()).deep.equal(cases.polygon.json); - }); - - it('should create valid JSON for WKT Polygon type with a hole', function() { - var a = new Wkt.Wkt(cases.polygon2.str); - expect(a.toJson()).deep.equal(cases.polygon2.json); - }); - - it('should create valid JSON for WKT MultiPolygon type', function() { - var a = new Wkt.Wkt(cases.multipolygon.str); - expect(a.toJson()).deep.equal(cases.multipolygon.json); - }); - - it('should create valid JSON for WKT MultiPolygon type with a hole', function() { - var a = new Wkt.Wkt(cases.multipolygon2.str); - expect(a.toJson()).deep.equal(cases.multipolygon2.json); - }); - - it('should create valid JSON for WKT MultiPoint type', function() { - var a = new Wkt.Wkt(cases.multipoint.str); - expect(a.toJson()).deep.equal(cases.multipoint.json); - }); - - it('should create valid JSON for WKT MultiLineString type', function() { - var a = new Wkt.Wkt(cases.multilinestring.str); - expect(a.toJson()).deep.equal(cases.multilinestring.json); - }); - - it('should create valid JSON for WKT Box type', function() { - var a = new Wkt.Wkt(cases.box.str); - expect(a.toJson()).deep.equal(cases.box.json); - }); - - }); - - describe('GeoJSON Deconstruction (from Objects):', function() { - - it('should write the WKT string corresponding to a GeoJSON Point', function() { - var a = new Wkt.Wkt(cases.point.json); - expect(a.write()).deep.equal(cases.point.str); - }); - - it('should write the WKT string corresponding to a GeoJSON LineString', function() { - var a = new Wkt.Wkt(cases.linestring.json); - expect(a.write()).deep.equal(cases.linestring.str); - }); - - it('should write the WKT string corresponding to a GeoJSON Polygon', function() { - var a = new Wkt.Wkt(cases.polygon.json); - expect(a.write()).deep.equal(cases.polygon.str); - }); - - it('should write the WKT string corresponding to a GeoJSON Polygon with a hole', function() { - var a = new Wkt.Wkt(cases.polygon2.json); - expect(a.write()).deep.equal(cases.polygon2.str); - }); - - it('should write the WKT string corresponding to a GeoJSON MultiPolygon', function() { - var a = new Wkt.Wkt(cases.multipolygon.json); - expect(a.write()).deep.equal(cases.multipolygon.str); - }); - - it('should write the WKT string corresponding to a GeoJSON MultiPolygon with a hole', function() { - var a = new Wkt.Wkt(cases.multipolygon2.json); - expect(a.write()).deep.equal(cases.multipolygon2.str); - }); - - it('should write the WKT string corresponding to a GeoJSON MultiPoint', function() { - var a = new Wkt.Wkt(cases.multipoint.json); - expect(a.write()).deep.equal(cases.multipoint.str); - }); - - it('should write the WKT string corresponding to a GeoJSON MultiLineString', function() { - var a = new Wkt.Wkt(cases.multilinestring.json); - expect(a.write()).deep.equal(cases.multilinestring.str); - }); - - }); - - describe('GeoJSON Deconstruction (from Strings):', function() { - it('should provide support for JSON.parse() in the environment...', function() { - expect(typeof JSON).deep.equal('object'); - expect(typeof JSON.parse).deep.equal('function'); - }); - - it('should parse a GeoJSON Point string', function() { - var a = new Wkt.Wkt(cases.point.jsonStr); - expect(a.write()).deep.equal(cases.point.str); - }); - - it('should parse a GeoJSON LineString string', function() { - var a = new Wkt.Wkt(cases.linestring.jsonStr); - expect(a.write()).deep.equal(cases.linestring.str); - }); - - it('should parse a GeoJSON Polygon string', function() { - var a = new Wkt.Wkt(cases.polygon.jsonStr); - expect(a.write()).deep.equal(cases.polygon.str); - }); - - it('should parse a GeoJSON Polygon string with a hole', function() { - var a = new Wkt.Wkt(cases.polygon2.jsonStr); - expect(a.write()).deep.equal(cases.polygon2.str); - }); - - it('should parse a GeoJSON MultiPolygon string', function() { - var a = new Wkt.Wkt(cases.multipolygon.jsonStr); - expect(a.write()).deep.equal(cases.multipolygon.str); - }); - - it('should parse a GeoJSON MultiPolygon string with a hole', function() { - var a = new Wkt.Wkt(cases.multipolygon2.jsonStr); - expect(a.write()).deep.equal(cases.multipolygon2.str); - }); - - it('should parse a GeoJSON MultiPoint string', function() { - var a = new Wkt.Wkt(cases.multipoint.jsonStr); - expect(a.write()).deep.equal(cases.multipoint.str); - }); - - it('should parse a GeoJSON MultiLineString string', function() { - var a = new Wkt.Wkt(cases.multilinestring.jsonStr); - expect(a.write()).deep.equal(cases.multilinestring.str); - }); - - }); - -}); diff --git a/temas/teste.map b/temas/teste.map new file mode 100644 index 0000000..10134c3 --- /dev/null +++ b/temas/teste.map @@ -0,0 +1,35 @@ +MAP + FONTSET "/var/www/i3geo/symbols/fontes.txt" + SYMBOLSET "/var/www/i3geo/symbols/simbolosv6.sym" + LAYER + CONNECTION "ses" + CONNECTIONTYPE POSTGIS + DATA "waygeo from (select st_transform(way,4326) AS waygeo,osm_id,highway from public.planet_osm_line) as foo using unique osm_id using srid=4326" + METADATA + "CLASSE" "SIM" + "TEMA" "Teste" + + END # METADATA + NAME "teste" + PROCESSING "LABEL_NO_CLIP=True" + PROCESSING "POLYLINE_NO_CLIP=True" + STATUS DEFAULT + TEMPLATE "none.htm" + TILEITEM "location" + TYPE LINE + classitem "highway" +class + expression "motorway" + style + color 0 0 0 + width 8 + end + style + color 128 155 192 + width 6 + end + end + + END # LAYER +END # MAP + diff --git a/testainstal/index.php b/testainstal/index.php index 8b66552..29e92bb 100755 --- a/testainstal/index.php +++ b/testainstal/index.php @@ -193,7 +193,6 @@ if (! function_exists("ms_GetVersion")) { if (get_cfg_var("safe_mode") == 1) { echo ''; } -// TODO ao fechar versao verificar esses acentos echo <<Acentuação
diff --git a/versao.php b/versao.php
index 898ae5b..4660829 100755
--- a/versao.php
+++ b/versao.php
@@ -4,10 +4,7 @@ Utilizado como um include em ms_configura.php
 */
 /**
  * TODO Verificar ao fechar versao
- * v7 numero da versao esta correto?
- * v7 guia de instalacao esta correto?
- * v7 guia de migracao esta correto?
- * v7 gerar repositorio no SVN com o nome i3geo6
+ * numero da versao esta correto?
  */
-$mensagemInicia = 'V. 7.0 beta';
+$mensagemInicia = 'V. 8.0 alfa';
 ?>
--
libgit2 0.21.2