Need to display U.S. metro areas on a map - gis

I need to display U.S. metro areas on a map and overlay some other data on the map. I have google searched for the metro data but I can't seem to find any good sources.
I was hoping to find data that I could use to display polygons of each metro area region on a map. I am using a Bing Maps Control to display the map but I'm not 100% tied to it.
I found a possible sources here https://mapzen.com/data/metro-extracts/ but the shape data looks huge for what I need. 22mb for one region?
I also found some data from opendata here http://opendata.arcgis.com/datasets/0ca49e3a5476488f98a8b1d2a81899e4_8?geometry=-130.807%2C26.621%2C-56.979%2C51.777&uiTab=table&selectedAttributes%5B%5D=MTFCC&chartType=bar&filterByExtent=true&mapSize=map-maximize&orderByFields=OID+DESC which looks like what I want but I can't get the data to download.
I'm assuming there has to be a good source for this data somewhere.
Any other suggestions where to get the metro area polygon(kml..shapefile..etc) data?

If you want boundaries of cities, Bing Maps actually makes these available through the GeoData API: https://msdn.microsoft.com/en-us/library/dn306801.aspx This would let you retrieve the boundaries for individual cities.
If you need all these boundaries in a single file, the US Census makes a file available: https://www.census.gov/geo/maps-data/data/cbf/cbf_ua.html It's 9mb when zipped, unzipped it is 27MB which is about the same size as the data sets you have come across. It is possible to reduce the size of these and also convert them to other formats. I would recommend using GeoJSON over Shapefiles and KML. GeoJSON is much more popular than these other formats now and is much better suited for web based applications.
Looking into this data I see that there is over 3000 polygons. You will struggle to get any web based mapping application to render that may polygons. Especially when each polygon has a decent number of polygons.
I created a low resolution version of this data that is accurate to about 1km. It is a little over 2MB when unzipped. You can find the zipped GeoJSON file here: https://onedrive.live.com/redir?resid=D35222484A76A01!406125&authkey=!ALpJIthBQ-MroSI&ithint=file%2czip

The official source for information about U.S. metro areas (Metropolitan and Micropolitan Statistical Areas) is the CensusBureau You may need to combine the resources there with official county boundary shapefiles.

You could use Google Maps API for Android to get images of U.S. metro areas.
If you want a polygon that is more than a simple square or rectangle, which it sounds like you do, you can specify coordinates for a polygon to obtain an image for your app. Sounds like quite a lot of work, but it is possible. See details here:
https://developers.google.com/maps/documentation/android-api
https://developers.google.com/maps/documentation/android-api/shapes

Related

Can google map be connected as Mapbox-gl base layer?

Trying to create 3d-like google map. Hence i'm searching for something like 3d leaflet, where you can choose base layer provider (google, bing or openstreetmap)
The question is if having google map as base layer is possible with mapbox gl js?
(regardless of policy)
Generally speaking, if you can find a source of raster tiles in EPSG:3857, accessible by URLs that conform to the XYZ tile numbering scheme, then you can use it as a raster tile source in Mapbox-GL-JS.
From what I know of Google Maps, it mostly uses vector tiles these days, although there is some kind of raster tile service in the mix. It's in the right projection (which Google pretty much invented, after all), but I don't think it is accessible by XYZ. I see URLs that look like this:
https://www.google.com/maps/vt/pb=!1m4!1m3!1i15!2i29569!3i20111!2m3!1e0!2sm!3i450157898!3m7!2sen!5e1105!12m4!1e68!2m2!1sset!2sRoadmap!4e0!5m1!1e0!23i4111425!23i1358757!23i1358902
So, probably no, unless you can find a way around that.
And, as you suggest, doing this would certainly violate Google's terms and conditions, and possibly Mapbox's as well.

Poor rendering time when plotting large shape files on Google Maps

First, I'd like to let it be known that this is my first journey into developing mapping applications with such a large set of data. So, I am in way locked into the techniques or technologies listed below...
The Overview
What I am trying to accomplish is the ability to load my company's market information for the United States onto some form of web-based mapping software. Currently I am trying to accomplish this with Google Maps JS api and GeoJSON data, but am not against other alternatives. There are roughly 163 files (ranging from 6MB to 200KB) that I have exported from ArcGIS into GeoJSON files, and then loaded into a database (currently as GeoJSON strings). We have developed a UI that loads the data based on the current map bounds and Max/Min calculations in the corresponding records.
The problem I'm running into is the render time on the map itself, which is annoying when switching between different regions, states, or zoom levels. The API calls to load the data are acceptable in regards to the size of the data being retrieved. My boss said it is great for a proof of concept, but would like to see it much, much faster.
The Questions
What suggestions could you offer to increase the render time?
Are there better options (3rd party libs, techniques, etc) for what I'm trying to accomplish?
It was suggested by a co-worker to export the map shapes and just use the images for overlaying the information based on the coords. Any input on this?
One solution to your problem could be reducing number of vertices in polygon or polyline layers (files) while preserving feature's shape. In that way geoJSON file would be smaller and easier to render.
You can use tools available in ArcGIS for Desktop.
See
How to Simplify Line or Polygon
or
Simplify Polygon
I'm sure there are similar tools in QGIS or any other open source GIS software.
There are other solutions to your problem like prerendering data in map tiles that could be overlayed over Google Maps basemap(s). That is probably the fastest solution but more complicated.
Maybe this could be good starting point.
Just couple of random thoughts.
On one project I worked on I noticed terrible performance with geoJson I loaded via REST service.
I found out that browser's JavaScript engine had hard time parsing large geoJson responses. I finally decided to load data in batches (multiple requests). Performance increased enormously.
I noticed you use 163 files (layers?). Do you display them at the same time (no no no) or you have some control panel to switch layers on/off? If you display them at the same time then performance will suffer for sure and you should look into generating map tiles with thematically grouped layers. In that way you'd come up with couple of tile layers that you can switch on and off.
Also, if data used to generate tiles changes frequently than tiles aren't good idea. Then maybe you should look into Web Map Services. WMS generates maps on the fly from data stored in database. GeoServer supports WMS and it's easy to configure and use.

I need to make a clean, nice-looking map for a presentation based on a Google map. Any easy way to do this?

I want to make a very clean map that only shows relevant information - e.g., only the streets that matter. I was going to just draw a map while looking at Google's, but that turned out to be very slow. Is there any way to make this easier, perhaps with some combination of mapping software and Google's API?
(If I should of put this on another SE site, please tell me)
Building upon Suvi's nice answer.
There is a very useful open-source project that collects street data for the entire globe. It's called OpenStreetMap. On their website you can extract the specific street data you need. It only takes a few clicks and bam! you got the map you need. Their data can also be accessed (perphaps easier for some) from here and here. Those links can provide you with the shapefile(map) that you need. Your newly aquired map can then be loaded in the free QGIS software that was mentioned. There you can easily select the streets you are interested in.
When you mean you want to only show "streets that matter", you are out of luck with using Google Maps. Because you have no control over the ROADMAP data that google provides. Now what you can do, is use another mapping software such as ArcGIS or Quantum GIS (which is free). Both these softwares allow you to load road data shapefiles, and you can query (select) which roads you want to display and customize the look of it to your liking.
If you want a quick approach (without having to download softwares), I believe ArcGIS has an online portal which allows you to display information you want on top of their base maps. You will still need the shapefile for your streets though. Check this link out, make yourself an account and experiment around with it http://www.arcgis.com/home/. If you click on the Map tab, it takes you to a screen which should allow you to upload shapefiles.
You said you were ' going to just draw a map'. If all you need is a very clean map, you can consider using iMap Builder which is a mapping software supports both map shape files, and custom Google maps. I have used to create some simple map projects before and worked great for me. You can use their pre-made map templates which shows just the map outlines without any details, you can then add routes / points / mouse-over speech bubbles etc as you need.

Google Maps: Get points contained within a user-drawn polygon?

A local real estate agent is wanting to add Google maps to his web site that display his listings. However, rather than just showing map markers to all his properties, he wants the web site visitor to be able to draw an arbitrary polygon on the map, click a button, and then display all his houses within those bounds.
My understanding is that this is going to take some GIS voodoo. But before I start looking into the complexity of PostGIS, I'm wondering if there's a better way to do this? The site runs on a standard LAMP stack, but I'm hoping to convince him to move over to Python/Nginx/PostgreSQL.
I don't think there is a need to move to PostGIS.
First chances are that your client gets the list through an MLS database via an address (123 fooview street). Update that list into a kml file
Using Google maps tutorial or this map tool draw a polygon
using this website (js provided inside the maps) you can do the point in polygon(match if any of your addresses are within polygon boundaries). I think they do it in more than one application.
EDIT
another way of doing point-in-polygon in google maps
I don't think this is going to require as much GIS voodoo as you think. I would approach this in three steps:
Generate a latitude and longitude coordinate for each listing. You may already have this information in your database. If you don't, there are several free tools available to do this. We have programmed a Google maps application at work that links directly to our SQL backend infrastructure that I can help you set up in your application if needed.
Use GLatLng to return coordinates for the arbitrary points the respondent is interested in: http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GLatLng
Use some math to create an area of the points (will be easier if you only allow 4 points for the arbitrary shape) and then use a for loop to compare each listing's lat/long pair to the area.
If your area is too large to compare all listings to the arbitrary area, do some pre-filtering based on state/county/city/whatever data you have available.
Hope this helps,
-Chase

Map Visualizations

We are looking for a great looking map visualization to plot transaction as we process them. We get inbound messages from all over the united states (latitude, longitude). We currently have a Google Maps solution in place, but it just doesn't have the visual impact we are looking for. We really like how this map looks:
http://leftronic.com/doc/screen02.jpg
Do you guys know of any great looking map visualizations?
So, just to clarify, the difference between Google maps and what you are looking for is that Google maps is too busy. Google maps is great if you are trying to get directions to your friend's house, but not for data visualization. Are we on the same page?
If you are looking for visualizations with less clutter, there are several alternatives to Google Maps depending on what you want. If you would like the ease of use of Google Maps, you might want to stick with a Google solution:
Google Geomaps
Google Intensity Maps
For more flexibility but potentially more work you can try Protovis. Protovis also has many other visualizations you can use in addition to maps. You may have to find your own geographic data with protovis. They do have sample geographic data for the U.S. and for the world. Protovis runs entirely in the browser through javascript.
Another possibility is an OpenLayers front end and GeoServer backend. This solution is extremely customizeable and allows the server to do the heavy duty GIS work so the browser doesn't have to. It also requires the most work.
I don't, but here is what I would do:
Get a mercator projection map of the us, like the 2nd image here.
given an address, find it's lat-long with a tool like this.
convert the lat-long into image coordinates. this should be a simple formula, because you used the mercator projection
use a tool like gd to plot a circle at the corresponding point in the image.
Conic projections might look nicer than mercator, but the math is uglier (trig is involved)
Dundas Data Visualization has a superb map component. What platform are the maps being displayed in?