| Author |
Message |
|
|
Hallo
Ich würde gerne euren Wetterservice benützen und habe folgendes Problem:
Die folgenden zwei Anfragen liefern beide aktuelle Wetterdaten, wobei das Attribut "observation" noch geparst wird und die einzelnen Werte wie z.B. Temperatur u.s.w. noch separat aufgeführt werden.
1.) http://ws.geonames.org/weatherIcaoJSON?ICAO=LSZH
2.) http://ws.geonames.org/findNearByWeatherJSON?lat=42&lng=-2
Für mein Problem müsste ich jedoch den weatherJSON-Service nützen, und dieser liefert nur das attribut "observation" ohne es zu parsen (Anfrage siehe unten).
Gibt es eine Möglichkeit ebenfalls direkt an die einzelnen Messdaten (Temperatur...) zu gelangen, wie dies bei den zwei oberen Services möglich ist?
3.) http://ws.geonames.org/weatherJSON?north=44.1&south=-9.9&east=-22.4&west=55.2
Schon mal danke
Christian
|
 |
|
|
Hi,
great work, exaclty what I was looking for. Could you send me the postal codes dump for europe or at least Germany and Austria?
My eMail is a a.faenger[AT]e-sign.com
Thank you very much!
Andreas
|
 |
|
|
Thats great thanks, working well now.
The service is still likely to be running in 8 months sin't it? as that is when my project finishes?
|
 |
|
|
Ahhh... I see. Thank you. One last question: I need a lot more complete data myself - I'm building a 'location' form for a website. I'm more than happy to pay for the data if necessary - I just don't know where to buy it. Any pointers?
What I'm building is similar to this:
http://www.meetic.co.uk/meetic.php?url=/search/iframe_geoadvancedsearch.php?choix_pays=UK&choix_region=-1&choix_ville=-1
|
 |
|
|
Thanks Marc, but I really still don't see that data in the dump file. I do realize your webservice extracts the administrative subdivision, but it simply isn't reflected in the database dumps.
A good way to verify that is to open the 'fr' file and search for 'eure' for example (a French department). "haute normandie" (a region, which is accurately returned by your webservice, is a no-show in the dump file, too.
Cheers,
Steve.
|
 |
|
|
Hi
I was wondering if anyone knows on where I can find some basic country data.
For example is there any service to which I could give a country name as a parameter and have suitable latitude and longitude values returned?
For example if it was given GB or United kingdom it would return a latitude and longitude roughly in the center of the UK
Thanks
|
 |
|
|
Thanks Marc! I'm sorry, I just can't see that data, please help me see the light
Here's a line from the France file, it's for the city called Rouen, that's located in Eure, #27:
6299435 Rouen Rouen LFOP,URO 49.3833333333333 1.18333333333333 S AIRP FR 0 157 150 2006-10-28
As you can see there's no reference to the region. If I open the UK file and extract one line:
2639389 Richmond Richmond 51.45 -0.2833333 P PPL GB 00 8360 0 33 Europe/London 2006-01-17
Richmond is in Surrey, that's not indicated either.
I'm obviously missing the obvious here, any help would be much appreciated! Cheers!
Steve.
|
 |
|
|
Hi, fantastic site! - However I have a problem: I can't seem to find the region/county information as part of the country files - France for example doesn't have any 'regions' nor 'postal codes'.
I understand the postal code are a separate download, is this the case for 'regions', too? If so, could I please have a copy of the worldwide file? steve.dogers at gmail.com
If it's not available, do you know where I could find such information? I'm happy to pay for it.
|
 |
|
|
Hi,
I'm testing mashing up different webservices and would be very interested in a dump of the postal codes too, as this is what's still missing before prototyping
Could you send the dump at steve(at)tango.lu
Thanks in advance
|
 |
|
|
|
How often is the postal codes updated and what source is it?
|
 |
|
|
Anonymous wrote:
Admittedly I forgot about places like that!
Ultimately you would have to resolve some records by using shape files.
I found some global ones here: (big question mark over distribution!)
http://fri.sfasu.edu/data/geographic/world/shape/
or http://fri.sfasu.edu/data/geographic/world/zip/
(country,time zone,primary admin,etc.,etc.. copyright=uncertain).
ERSI
http://www.esri.com/
(viewer,documentation of file format,etc.)
----
those sfasu.edu sites are offline, but the Wayback Machine will retrieve all the content for you.
|
 |
|
|
|
Lat Long for EGCN (Doncaster Sheffi) is in the North Sea!
|
 |
|
|
Ich würde die Abfrage in so einem Fall auch auf dem Server machen. Das heisst für jeden Event vorgängig (beim Insert) die Koordinaten bestimmen und bei der Suche die Koordinaten der gesuchten PLZ bestimmen und dann auf dem Server alle Events im gesuchten Abstand zu PLZ.
Eventuell könnte man aus Performancegründen die lat/lng auch in die Where-Bedingungen einbauen. Wenn der Datenbankhersteller die kreisförmige Suche nicht ermöglicht, kann man auch eine viereckige Suche auf der Datenbank verwenden und es danach noch wie oben in php auf eine kreisförmige Suche reduzieren.
Marc
|
 |
|
|
danke für das umformatieren mitlerweile habe ich die DB angepasst
und die Lösung war dadurch einfach, ist diesmal aber in PHP nicht mehr in JS damit die Abfrage direkt auf dem serwer statfindet.
function dist($lat1, $lng1,$lat2,$lng2) {
$a1 = 2*pi()*$lat1/360;$b1 = 2*pi()*$lng1/360;
$a2 = 2*pi()*$lat2/360;$b2 = 2*pi()*$lng2/360;
$d = acos(cos($a1)*cos($b1)*cos($a2)*cos($b2)+cos($a1)*sin($b1)*cos($a2)*sin($b2)+sin($a1)*sin($a2));
$d1=$d*6372;
}
$lat1=$lat1; $lng1=$lng1 //koordinate Benützer generiert durch PLZ eingabe und dem php script übergeben
$kmd=$kmd //$kmd = maximale Distanzangabe vom benützer
$result1=mysql_query("SELECT * FROM ivents");
$tresult1=mysql_fetch_row($result1);
while($row = mysql_fetch_row($result1)){
$lng2=$row[11];
$lat2=$row[12];
$d1= dist($lat1, $lng1, $lat2, $lng2);
if($d1<=$kmd){
echo '<div id.......................';
}}
|
 |
|
|
Hello,
the database dump of European postal codes would be a great help for our travel info application! Could you please send us some details about receiving the files to info(at)artinno.cz?
Thank you very much in advance!
thomas
|
 |
|
|
habe es noch nicht hingekriegt, habe aber der Hauptfehler gefunden.
die Matrixdaten würden in der DB auf 8 Stellen gerundet, was +- 5Km bedeutete.
|
 |
|
|
damit das Obrige Beispiel funktioniert muss natürlich noch das jsr_class.js
script eingebunden werden:
Code:
function JSONscriptRequest(fullUrl) {
this.fullUrl = fullUrl; this.noCacheIE = '&noCacheIE=' + (new Date()).getTime();
this.headLoc = document.getElementsByTagName("head").item(0);this.scriptId = 'YJscriptId' + JSONscriptRequest.scriptCounter++;
}
JSONscriptRequest.scriptCounter = 1;
JSONscriptRequest.prototype.buildScriptTag = function () {
this.scriptObj = document.createElement("script"); this.scriptObj.setAttribute("type", "text/javascript");
this.scriptObj.setAttribute("src", this.fullUrl + this.noCacheIE); this.scriptObj.setAttribute("id", this.scriptId);
}
JSONscriptRequest.prototype.removeScriptTag = function () { this.headLoc.removeChild(this.scriptObj); }
JSONscriptRequest.prototype.addScriptTag = function () { this.headLoc.appendChild(this.scriptObj);}
|
 |
|
|
Wollte meine DB nach Ewents abfragen die neher als 50 km sind
da die findNearbyPostalCodesJSON Abfrage nach 500 Ergebnisse stehen bleibt und ich nicht nach dessen ergebniss meine DB durchsunchen kann hoffe ich auf diesem weg eine Lösung zu finden.
Das Problem kann man anhand des skripts sehen:
Code:
<html>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
<body>
<form id="searchForm" onsubmit="search1(); return false;" style="display:inline">
land = <input id="land" type="hidden" name=land value="ch">
<select name ="country" onchange="javascript:land.value=this.value"><option value=""> all countries</option><option value="AT"> Austria</option><option value="AU"> Australia</option><option value="BE"> Belgium</option><option value="CH" selected> Switzerland</option><option value="CZ"> Czech Republic</option>
<option value="DE"> Germany</option></select><br>
PLZ=<input id="iplz" type=text name=iplz value="8000">
KM=<input id="ikm" type=text name=ikm value="50">
<input type=submit value=searchplzungebung>
</form><br>
<div id="resultDiv" style="position:absolute;top:100;left:0">PLZ und KM eingeben dann suchen</div>
</body></html>
<script type="text/javascript">
function search1() {
durchl=1;
request = 'http://ws.geonames.org/findNearbyPostalCodesJSON?postalcode=' + encodeURIComponent(document.getElementById("iplz").value) + '&country=' + encodeURIComponent(document.getElementById("land").value) + '&radius=' + encodeURIComponent(document.getElementById("ikm").value) + '&maxRows=500&callback=getnplz';
aObj = new JSONscriptRequest(request);
aObj.buildScriptTag();
aObj.addScriptTag();
}
function entfm1(lat1,lng1){
lat2=eingcorx;lng2=eingcory;
erdradiusKM = 6372.0; //durchschnittswert
erdradius_MILES = 3963.0;
a1 = 2*Math.PI*lat1/360;b1 = 2*Math.PI*lng1/360
a2 = 2*Math.PI*lat2/360;b2 = 2*Math.PI*lng2/360
d = Math.acos(Math.cos(a1) * Math.cos(b1) * Math.cos(a2) * Math.cos(b2) + Math.cos(a1) * Math.sin(b1) * Math.cos(a2) * Math.sin(b2) + Math.sin(a1) * Math.sin(a2));
er= d * erdradiusKM;
// erMiles= d * erdradiusKM*erdradius_MILES/erdradiusKM //Fals angaben in miles benötigt
}
function getnplz(dbnplz) { //Antwort abfangen
if (dbnplz == null) { alert("null"); return; } //ist antwort null->abbruch
dbnplz = dbnplz.postalCodes //Daten abspeichern
var html = '<u><b>PLZ = KM abstand</b></u><br>';
eingcorx=dbnplz[0].lat
eingcory=dbnplz[0].lng
for (i=0;i< dbnplz.length;i++) {
var name = dbnplz[i];
durchl++;if(durchl>=9){durchl=1;html = html+"<br>"}
entfm1(name.lat,name.lng)
er=Math.round(er*100)/100 // auf 2 Stellen Runden
// html = html + '<a href="javascript:entfm1(' + name.lat +',' + name.lng + ');">' +name.placeName + name.postalCode+'</a> = '+er+'KM<br>';
html = html + name.postalCode + ' = ' + er + 'KM ; ';
}
document.getElementById('resultDiv').innerHTML = html;
}
</script>
Wenn ich meine DB nach den Koordinaten abfragen.
Kriege ich aber kein Kreiss sondern ein Viereck als Ergebniss.
Die lösung wehre über die Matrix abzufragen habs aber noch nicht geraft.
Ist jemand mit sowas vertraut?
d1 = Math.acos(Math.cos(a1) * Math.cos(b1) * Math.cos(a2) * Math.cos(b2) + Math.cos(a1) * Math.sin(b1) * Math.cos(a2) * Math.sin(b2) + Math.sin(a1) * Math.sin(a2));
d2 = Math.acos(Math.cos(a3) * Math.cos(b3) * Math.cos(a4) * Math.cos(b4) + Math.cos(a3) * Math.sin(b3) * Math.cos(a4) * Math.sin(b4) + Math.sin(a3) * Math.sin(a4));
if(d1>=d2-50km && d1<=d2+50km){alert("juhu es trift zu!")}
Bin um jede Hilfe dankbar. Bin schon am verzweifeln denn ich muss meine DB und die Einträge für die neue Abfrageart aktualisieren
|
 |
|
|
Thanks for fixing!
Very much appreciated
Pete.
|
 |
|
|
I understand that originally Darwin (city of Australia) was called Palmerston, but how come a search query still returns "Palmerston" as the PPLA result today?
I'm calling http://ws.geonames.org/search?q=Darwin&country=Australia and getting the first result, listed as PPLA, of "Palmerston". There is no geoname in the results which refers specifically to "Darwin", as in the populated city.
I need a service which provides the place name that is commonly known to the public. Am I missing something? Should I be supplying a parameter which requests "common name"?
Any help appreciated. I like this service and don't want to go hunting for another one.
Regards,
Peter.
|
 |
|
|