Full search only returns featureclass P

Hi .... using

geonames_query('search', $query, $options)

.. I only seem to get back featureclass items P.

I want to get back featurecode items such as those outlined at ... http://www.geonames.org/export/codes.html

eg. Getting back airports for Australia ...
http://ws.geonames.org/search?q=australia&featureCode=AIRP&maxRows=10&st...

I tried setting featureclass but it doesn't seem to help ...

<?php
$statecap_maxrows = 20;
$statecap_style = "FULL";
$statecap_featurecode = "AIRP";
$statecap_admincode1 = "02";
$statecap_country = "AU";
$statecap_q = "Australia";
$statecap_featureclass = "S";

$statecap_query = array('name' => $statecap_q, 'maxrows' => $statecap_maxrows, 'style' => $statecap_style, 'country' => $statecap_country, 'featureclass' => $statecap_featureclass, 'featurecode' => $statecap_featurecode, 'admincode1' => $statecap_admincode1 );

$statecap_options = array('columns' => array('name','lat', 'lng', 'geonameid', 'countrycode', 'countryname', 'fcl', 'fcode', 'distance', 'fcodename', 'fclname', 'population', 'elevation', 'alternatenames', 'admincode1', 'admincode2', 'adminname1', 'adminname2', 'timezone', 'dstoffset', 'gmtoffset'));

$statecap_result = geonames_query('search',$statecap_query,$statecap_options);

Can you let me know if it doesn't give more back than fcl P or if I am doing this incorrectly?

Appreciate your help!

serosero's picture

The nearbyplace service does

The nearbyplace service does only support place names -- check out the service descriptions on geonames.org.

A related question is about

A related question is about nearbyplace.

Usage: $result = geonames_query('nearbyplace', $query, $options)
$query = array(lat, lng, radius=20, radius, maxrows, style)

Nearby place only seems to return featureclass for places (ie/ towns/cities). Can I use it to find other nearby features - eg/ airports?

Or can you suggest an alternate way this should be done?

Cheers

changed $statecap_query =

changed

$statecap_query = array('name' => $statecap_q, 'maxrows' => $statecap_maxrows, 'style' => $statecap_style, 'country' => $statecap_country, 'featureclass' => $statecap_featureclass, 'featurecode' => $statecap_featurecode, 'admincode1' => $statecap_admincode1 );

to

$statecap_query = array('query' => $statecap_q, 'maxrows' => $statecap_maxrows, 'style' => $statecap_style, 'country' => $statecap_country, 'featureclass' => $statecap_featureclass, 'featurecode' => $statecap_featurecode, 'admincode1' => $statecap_admincode1 );

and that sorted it out

Syndicate content