I want to query a map like a database!
January 19, 2011 11:44 AM   Subscribe

I'd like to query geographical and population-based data. "$city <> 200,000" and so on and so forth. What is this called and where can I find data like this? Willing to spend some money if necessary.

Other things that would be nice to have (but not required):
- Non US data
- Geographical stuff like "$city has river" or "$city is a port city".

I am very capable when it comes to databases, SQL, etc. so I can handle data in pretty much any machine-readable format. Also I enjoy learning new tools, so don't be afraid of suggesting difficult answers!
posted by unixrat to Science & Nature (8 answers total) 6 users marked this as a favorite
Response by poster: I should have known that the < symbol would cause problems. Oops! Meant to say <= / lte / less than or equal to. It was just an example.
posted by unixrat at 11:46 AM on January 19, 2011

Response by poster: Other examples provided by a friend I was talking to...

Search for cities with populations between 15000 - 25000
Within 30 miles radius, must be x other cities with populations less that 25000
Within 30 to 90 miles radius, must be at least one city with population > 75000
Within 10 miles radius, must be an institution of higher learning
posted by unixrat at 11:48 AM on January 19, 2011

You'd probably have to do a lot of rolling your own, but I'd suggest starting with the Census Bureau's TIGER stuff, combined with the American FactFinder datasets.
posted by jferg at 11:53 AM on January 19, 2011

Querying a map like a database is exactly what GIS is. Along with the datasets mentioned above, maybe take a look at this list of opensource GIS tools to get started.
posted by kmz at 12:07 PM on January 19, 2011 [1 favorite]

Wait, this might be a better software list.
posted by kmz at 12:09 PM on January 19, 2011 [1 favorite]

PUMs data is also a pretty decent set for economic and population data.

Also, the queries you are typing are no small feat, simple to write, large datasets to chunk through.

I'm a SAS dude, so I'd be using SAS/GIS SAS/GRAPH and using it to crunch this stuff. (If you don't have SAS on hand, I'd be a little out of my league in telling you the best way to put geographic boundaries on things and calculating distances. Also, SAS is a couple grand for the packages you'd find useful).

Be aware, there are like 3 or 4 different semi-common coordinate projection systems in use across various datasets, make sure you convert your location specific datasets so that they all speak in the same ones.
posted by Nanukthedog at 12:47 PM on January 19, 2011

Specifically for some of this, check out the RDF version of wikipedia. Then learn enough sparql to query it. It can answer questions exactly like this.
posted by cschneid at 4:52 PM on January 19, 2011

WolframAlpha might be able to help with some of your simpler queries.

If you purchase a copy of Mathematica, it includes large datasets about cities, states, countries, etc. which you can mash up and analyze in endless ways. Some examples here. Mathematica does cost a fair amount of money, though.
posted by Hither at 9:08 PM on January 19, 2011

« Older I'm probably the only one on the planet that...   |   Please Recommend a Detox Retreat Newer »
This thread is closed to new comments.