Skip to content

Commit

Permalink
imposted the isn2wgs module by @gudmundur to make the code more modular
Browse files Browse the repository at this point in the history
  • Loading branch information
kristjanmik committed Mar 29, 2013
1 parent e4e8bd3 commit 6e4b9bf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 4 additions & 4 deletions node/fasteignamat.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var request = require("request"),
cheerio = require("cheerio"),
isnet93_to_wgs84 = require("./isnet93_to_wgs84");
isn2wgs = require('isn2wgs');

function general_info(fastanr,callback) {
if (fastanr[3] && fastanr[3] !=='-') fastanr = fastanr.slice(0,3)+'-'+fastanr.slice(3);
Expand Down Expand Up @@ -72,10 +72,10 @@ function geocode(landnr,callback) {
try {
var ret = {};
body = JSON.parse(body);
ret.center = isnet93_to_wgs84.apply(this,body.features[0].geometry.coordinates);
ret.center = isn2wgs(this,body.features[0].geometry.coordinates);
ret.bbox = [
isnet93_to_wgs84(body.bbox[0],body.bbox[1]),
isnet93_to_wgs84(body.bbox[2],body.bbox[3])
isn2wgs(body.bbox[0],body.bbox[1]),
isn2wgs(body.bbox[2],body.bbox[3])
];
ret.properties = body.features[0].properties;
callback(null,ret);
Expand Down
6 changes: 4 additions & 2 deletions node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
"main": "fasteignamat.js",
"dependencies" : {
"cheerio": "0.10.x",
"request": "2.16.x"
"request": "2.16.x",
"isn2wgs": "0.0.1"
},
"repository": {
"type": "git",
"url": "https://github.com/ZJONSSON/fasteignamat-functions"
}
},
"version": "0.0.2"
}

0 comments on commit 6e4b9bf

Please sign in to comment.