GeoNames Home | Postal Codes | Download / Webservice | About 

GeoNames Forum
  [Search] Search   [Recent Topics] Recent Topics   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
Query Data from a SQL Server Database  XML
Forum Index -> FAQ - frequently asked questions
Author Message
jdsu



Joined: 03/09/2010 15:50:35
Messages: 2
Offline

This data structure seems great but it confuses me.
After importing the data into a SQL Server Database
How would i properly Query it using SQL or even better Linq.
A Simple Example: Walking the Children
(i understand there may be variations based on Country)

//Returns All countries
var countries = from country in client.countryinfoes
select country.name;

//Returns Canadian Cities in Ontario(08) Provence whose name starts with L
var cities = from city in client.geonames
where city.country == "CA" && city.fcode== "AREA" && city.admin1 == "08" && city.name.StartsWith("L")
select city.name;
marc



Joined: 08/12/2005 07:39:47
Messages: 4412
Offline

the cities have feature class 'P': http://www.geonames.org/export/codes.html#P.PPL

Marc

[WWW]
 
Forum Index -> FAQ - frequently asked questions
Go to:   
Powered by JForum 2.1.5 © JForum Team