Commit 6dd44250 authored by Clément Igonet's avatar Clément Igonet

Update all

parent 05d9bbec
......@@ -85,23 +85,23 @@ function groundBlock(bound, url) {
}
function roofBlock(way) {
"use strict";
return {
"type": "Feature",
"properties": {
"id": +way.id,
"type": "roof",
"color": getRGB(way.color),
"roofShape": way.roofShape,
"height": way.osmBldPartHeight
},
"geometry": {
"type": "Polygon",
"coordinates": [way.nodes]
}
};
}
// function roofBlock(way) {
// "use strict";
// return {
// "type": "Feature",
// "properties": {
// "id": +way.id,
// "type": "roof",
// "color": getRGB(way.color),
// "roofShape": way.roofShape,
// "height": way.osmBldPartHeight
// },
// "geometry": {
// "type": "Polygon",
// "coordinates": [way.nodes]
// }
// };
// }
function geoBldPartBlock(way) {
return {
......@@ -114,7 +114,11 @@ function geoBldPartBlock(way) {
'type': 'buildingPart',
'minHeight': +way.minHeight,
'minLevel': +way.bldMinLevel,
'name': way.name
'name': way.name,
'roof:shape': way.roofShape,
// 'roof:height': way.osmBldPartHeight
'roof:height': way.roofHeight,
'roof:material': way.roofMaterial
},
'geometry': {
'type': 'Polygon',
......@@ -133,7 +137,7 @@ function convert(options, onConvert) {
var bounds;
var blocks = [],
geoBldParts = {},
roofs = {},
// roofs = {},
nodeMap = {},
onWay = false,
onRelation = false;
......@@ -204,9 +208,9 @@ function convert(options, onConvert) {
if (attrs.ref in geoBldParts) {
var geoBld = getGeoBuilding(geoBlds, +relation.id);
geoBld.features[geoBld.features.length] = geoBldParts[attrs.ref];
if (roofs[attrs.ref] && options.loD > 1 && options.geoJsonExtended && options.geoJsonExtended == true) {
geoBld.features[geoBld.features.length] = roofs[attrs.ref];
}
// if (roofs[attrs.ref] && options.loD > 1 && options.geoJsonExtended && options.geoJsonExtended == true) {
// geoBld.features[geoBld.features.length] = roofs[attrs.ref];
// }
}
} else if (onRelation && name === 'tag') {
switch (attrs.k) {
......@@ -240,24 +244,24 @@ function convert(options, onConvert) {
xmlStream.on('endElement', function(name) {
if (name === 'way') {
onWay = false;
if (way.roofShape) {
var roof = roofBlock(way);
}
// if (way.roofShape) {
// var roof = roofBlock(way);
// }
var geoBldPart = geoBldPartBlock(way);
if (way.isBld) {
var geoBld = getGeoBuilding(geoBlds, +way.id);
geoBld.features[geoBld.features.length] = geoBldPart;
if (roof && options.loD > 1 && options.geoJsonExtended && options.geoJsonExtended == true) {
geoBld.features[geoBld.features.length] = roof;
}
// if (roof && options.loD > 1 && options.geoJsonExtended && options.geoJsonExtended == true) {
// geoBld.features[geoBld.features.length] = roof;
// }
if (turf.inside(turf.centroid(geoBld), bounds)) {
blocks[blocks.length] = JSON.parse(JSON.stringify(geoBld));
}
} else {
geoBldParts[+way.id] = geoBldPart;
if (roof) {
roofs[+way.id] = roof;
}
// if (roof) {
// roofs[+way.id] = roof;
// }
}
} else if (name === 'relation') {
// <tag k="type" v="building"/>
......
{
"name": "osm2x3d",
"description": "Open Earth View project - Open Street Map to 3D formats converter",
"version": "0.0.17",
"devDependencies": {
"pkgfiles": "2.3.0"
},
"dependencies": {
"body-parser": "~1.0.0",
"chai": "",
"chai-fuzzy": "",
"loglevel": "",
"node-getopt": "",
"node-xml-compare": "",
"rgbcolor": "0.0.4",
"sax": "",
"turf": ""
},
"main": "./web_server.js",
"scripts": {
"test": "./test/osm2x3dTester.sh",
"prepublish": "pkgfiles"
},
"files": [
"lib",
"scripts",
"test/integration",
"test/production",
"test/unit/*Mocha.js",
"test/unit/resources/18_134118_95589",
"test/unit/resources/bounds",
"test/unit/resources/esb/esb_*",
"test/osm2x3dTester.sh",
"tools/junit.sh",
"package.json",
"README.md",
"web_server.js"
],
"author": "Clement IGONET <clement@igonet.fr>",
"keywords": [],
"repository": {
"type": "git",
"url": "git@git.framasoft.org:pizaninja/OpenEarthView.git"
},
"devDependencies": {},
"license": "LGPL-3.0"
"name": "osm2x3d",
"description": "Open Earth View project - Open Street Map to 3D formats converter",
"version": "0.0.17",
"devDependencies": {},
"dependencies": {
"body-parser": "~1.0.0",
"node-expat": "",
"chai": "",
"chai-fuzzy": "",
"loglevel": "",
"node-getopt": "",
"node-xml-compare": "",
"pkgfiles": "",
"rgbcolor": "0.0.4",
"sax": "",
"turf": "",
"xslt": ""
},
"main": "./web_server.js",
"scripts": {
"test": "./test/osm2x3dTester.sh"
},
"files": [
"lib",
"scripts",
"test/integration",
"test/production",
"test/unit/*Mocha.js",
"test/unit/resources/18_134118_95589",
"test/unit/resources/bounds",
"test/unit/resources/esb/esb_*",
"test/osm2x3dTester.sh",
"tools/junit.sh",
"package.json",
"README.md",
"web_server.js"
],
"author": "Clement IGONET <clement@igonet.fr>",
"keywords": [],
"repository": {
"type": "git",
"url": "git@git.framasoft.org:pizaninja/OpenEarthView.git"
},
"license": "LGPL-3.0"
}
......@@ -18,7 +18,7 @@ $ server.sh
```
$ wget "localhost:8082/osmCache/osmXml?tile=zoom,xtile,ytile
Example:
$ wget "localhost:8082/osmCache/osmXml?tile=18/77196/98527
$ wget "localhost:8082/osmCache/osmXml?tile=18,77196,98527
```
## Unit Tests
......
This diff is collapsed.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta charset="UTF-8">
<title>Open Earth View</title>
<!--<script src="http://www.x3dom.org/download/dev/x3dom-full.js"></script>-->
<script type="text/javascript" src="bower_components/bower-x3dom/x3dom-full.js"></script>
......@@ -18,12 +18,11 @@
<div id="x3dContainer">
<x3d id="x3dElement" showlog="true" showstat="false">
<Scene id="scene">
</Scene>
</Scene>
</x3d>
</div>
</div>
<div id="info"> info </div>
<script>
</script>
</body>
</html>
......@@ -84,7 +84,7 @@ Osm2X3dGround.prototype.init = function () {
// updateGroundView(lat, lon, rdist);
// updateGroundView();
// <viewpoint onviewpointChanged="viewFunc(event);"></viewpoint>
self.viewpoint.addEventListener("viewpointChanged", view_changed, false);
curViewPoint = x3dElement.runtime.viewpoint();
rotationCenter = curViewPoint._vf.centerOfRotation;
......
{
"X3D": {
"@showstat": true,
"@showlog": true,
"@version": "3.0",
"@profile": "Immersive",
"@xmlns:xsd": "http://www.w3.org/2001/XMLSchema-instance",
"@xsd:noNamespaceSchemaLocation": "http://www.web3d.org/specifications/x3d-3.0.xsd",
"Scene": {
"-children": [{
"NavigationInfo": {
"@type": ["fly"],
"@transitionTime": 5
}
}, {
"Background": {
"@groundColor": [0.1, 0.1, 0.8],
"@skyColor": [0.1, 0.1, 0.8]
}
}, {
"GeoViewpoint": {
"@description": "Initial GeoViewpoint",
"@orientation": [1, 0, 0, -1.57],
"@position": [35.0, 70.0, 30000000]
}
}, {
"Shape": {
"-appearance": [{
"Appearance": {
"-texture": [{
"ImageTexture": {
"@url": "images/earth_big.png"
}
}]
}
}],
"-geometry": {
"GeoElevationGrid": {
"@geoGridOrigin": [-90, 90, 0],
"@height": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"@xDimension": 21,
"@xSpacing": 18,
"@yScale": 200,
"@zDimension": 11,
"@zSpacing": 18
}
[{
"Shape": {
"-appearance": [{
"Appearance": {
"-texture": [{
"ImageTexture": {
"@url": "images/earth_big_00.png"
}
}
}]
}]
}
}],
"-geometry": {
"GeoElevationGrid": {
"@geoGridOrigin": [0, -180, 0],
"@height": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"@xDimension": 11,
"@xSpacing": 18,
"@yScale": 200,
"@zDimension": 6,
"@zSpacing": 18
}
}
}
}
}, {
"Shape": {
"-appearance": [{
"Appearance": {
"-texture": [{
"ImageTexture": {
"@url": "images/earth_big_10.png"
}
}]
}
}],
"-geometry": {
"GeoElevationGrid": {
"@geoGridOrigin": [0, 0, 0],
"@height": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"@xDimension": 11,
"@xSpacing": 18,
"@yScale": 200,
"@zDimension": 6,
"@zSpacing": 18
}
}
}
}, {
"Shape": {
"-appearance": [{
"Appearance": {
"-texture": [{
"ImageTexture": {
"@url": "images/earth_big_01.png"
}
}]
}
}],
"-geometry": {
"GeoElevationGrid": {
"@geoGridOrigin": [-90, -180, 0],
"@height": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"@xDimension": 11,
"@xSpacing": 18,
"@yScale": 200,
"@zDimension": 6,
"@zSpacing": 18
}
}
}
}, {
"Shape": {
"-appearance": [{
"Appearance": {
"-texture": [{
"ImageTexture": {
"@url": "images/earth_big_11.png"
}
}]
}
}],
"-geometry": {
"GeoElevationGrid": {
"@geoGridOrigin": [-90, 0, 0],
"@height": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"@xDimension": 11,
"@xSpacing": 18,
"@yScale": 200,
"@zDimension": 6,
"@zSpacing": 18
}
}
}
}]
......@@ -30,25 +30,13 @@
alert('getJSON request failed! ' + textStatus + ' ' + errorThrown);
});
}
// loadX3DJSON(
// '#x3domjson',
// 'scene.json'
// );
loadX3DJSON(
'#x3domjson',
// 'helloWorld.json'
// 'http://www.openearthview.net/3dtile.php?format=x3djson&zoom=18&xtile=134118&ytile=95589'
// 'A1_GeoElevationGrid.json'
'earth.json'
// 'WorldTest.json'
// 'A2_AnimatedGeoViewpoint.json'
// 'A3_GeoInline.json'
// 'A4_GeoLocation.json'
// 'A5_GeoOrigin.json'
// 'Box.json'
// 'GeospatialCoordinateAxesNsewExample.json'
// 'GeoTouchSensorExample.json'
// 'HelloEarth.json'
// 'http://www.web3d.org/x3d/content/examples/Basic/GeoSpatial/HelloEarthOpenStreetMap.json'
// 'HelloEarthOpenStreetMap.json'
// 'HelloEarthOpenAerialMap.json'
// 'World.json'
'earth_old.json'
);
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment