From: <jen...@us...> - 2009-04-21 17:11:11
|
Revision: 1722 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1722&view=rev Author: jenslehmann Date: 2009-04-21 17:11:00 +0000 (Tue, 21 Apr 2009) Log Message: ----------- avoid computerized scientific notation in double representation hacked Triplify to avoid limited output Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java Modified: trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java =================================================================== --- trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java 2009-04-21 13:06:39 UTC (rev 1721) +++ trunk/src/dl-learner/org/dllearner/scripts/matching/DBpediaLinkedGeoData.java 2009-04-21 17:11:00 UTC (rev 1722) @@ -93,8 +93,8 @@ String label = null; String[] classes = null; int decimalCount = 0; - double geoLat = 0; - double geoLong = 0; + Double geoLat = null; + Double geoLong = null; while ((line = br.readLine()) != null) { @@ -124,15 +124,23 @@ case 1 : label = line; break; case 2 : classes = line.substring(1, line.length()).split(","); break; case 3 : - geoLat = new Double(line); + geoLat = new Double(line); + // we avoid "computerized scientific notation" e.g. 9.722222457639873E-4 + // since it causes problems in the REST interface + if(geoLat.toString().contains("E")) { + geoLat = 0.0; + } decimalCount = 0; String[] tmp = line.split("."); if(tmp.length == 2) { decimalCount = tmp[1].length(); } break; - case 4: geoLong = new Double(line); + case 4: geoLong = new Double(line); + if(geoLong.toString().contains("E")) { + geoLong = 0.0; } + } itemCount++; } @@ -295,7 +303,7 @@ if(!quiet) System.out.println(dbpediaPoint.getLabel()); - URL linkedGeoDataURL = new URL("http://linkedgeodata.org/triplify/near/"+dbpediaPoint.getGeoLat()+","+dbpediaPoint.getGeoLong()+"/"+distanceThresholdMeters); + URL linkedGeoDataURL = new URL("http://linkedgeodata.org/triplify/nearhacked/"+dbpediaPoint.getGeoLat()+","+dbpediaPoint.getGeoLong()+"/"+distanceThresholdMeters); double highestScore = 0; String bestURI = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |