Tableau: Heat map with two "Points of interest" - geocoding

First off - sorry I can't attach an excel file or CSV with the proper data, but I'll write it in here as best I can.
Basically, I want to generate a heatmap that has two fixed points layered atop. These two fixed points are generated using coordinates I've created. I've been able to do with with ONE fixed point, using a double axis, but not sure how to add the other point. That dataset looked like this:
zip count place1 LONG LAT place2 LAT2 LONG2
95020 120 MY HOME -122.9011 37.3326 FRIENDS HOME 37.335895 -121.99833
95122 90 MY HOME -121.9011 37.3326 FRIENDS HOME 37.335895 -121.99833
94086 66 MY HOME -121.9011 37.3326 FRIENDS HOME 37.335895 -121.99833
95127 163 MY HOME -121.9011 37.3326 FRIENDS HOME 37.335895 -121.99833
To generate the one fixed point I did the following:
Added LONG and LAT measure to Columns and Rows TWICE
Made both a dual axis
This created two "Marks" - LAT and LAT(2).
I added sum(COUNT) and ZIP to LAT
I made LAT(2) the "Circle" type, as opposed to "Filled Map" for LAT
Changed colors
Results: http://i.imgur.com/WJ9CRxe.png
How can I add a circle for LAT2 and LONG2?

Perhaps, a sample workbook can be shared to try resolving the issue as the explanation is not clear.

Related

Google - translating latitude, longitude into Geotarget locations

I have a bunch of locations (cities, counties, street level addresses) that I want to translate into the 100k locations found here: https://developers.google.com/adwords/api/docs/appendix/geotargeting
Let's say I've got:
location | latitude | longitude |
-----------------------------------------------------
New York, NY, USA | 40.70 | -74.00 |
And I want to map this to:
"21167","New York","New York, United States","US","State"
Is there a way of doing that? parsing text and matching it like that isn't an option.
The Google Geocode API only gives me a list of coordinates based on an address, not an ID from that file.
One thing I thought of would be to take each canonical_name from the file, open up Maps, get the coordinates for all locations and map my lat, long addresses to the nearest point.
Could it be done in a better/more accurate way?
Long story short, this can't be done for free.
I made a selenium script that inputs the address in the Maps search, hits Enter (this centers the map to the coordinates I think), then pulls the coordinates from somewhere within the HTML or the URL it redirects to. I think.
For stuff I couldn't find a match for, I got the latitude & longitude for the locations in the Geotargets CSV and picked the nearest one to my address.

How to get lat-long values of all areas in a city

I have tried to find a lot over the Internet but I am unable to get a perfect utility/API for my requirement.
I am interested in getting the latitude, longitude values of all areas in a city.
Currently i am using this google maps api
https://developers.google.com/maps/documentation/geocoding/start
But, when i enter a city name, it is giving only one lat-long pair for that city. Is there any way that if i give a city name, i can get all the areas and their corresponding latitude, longitude values?
Thanks.
There's a nice documentation for this at: Places API
I used this to get the latitude / longitude for one of my own projects and I also have an example of this.
If you look at the example, you can just type a location and it will immediately get the lat / long of the location and zoom in, you can also do this for more locations at the same time. Remember there is a limit for the maps api so it can only process so many data at the same time. Hope this may help you out! :)

Create class with 2D easily searched information

I am attempting to make somewhat of a pseudo-database of players by creating instances of a Player class for football. So, the information in my Player would have certain values such as
self.age
self.height
self.weight, etc.
as well as seasonal data, which I would format something like the following:
player_year year yards comp_perc rushing
X1 2008 400 65 70
X2 2009 500 35 100
Once I have created an instance of each player, I would then pickle everything in order to save it once I have scraped everything. My issue is then that I would like a way of cleanly looking through the tables for each player, such as wanting all 'yards' stats from 'player_year' X2 from each player. Is the cleanest way of doing this a 2d dictionary such as
dict['x1']['yards']
and if so, how would I be able to read this in neatly row by row. I would also like to mention that 'X1' would need to be created by my code as it is not a part of the scraped data.
Thanks for the help!

Arcpy.CompositeBands can't access the input datasets but the path is correct. Any ideas?

I have about 30 rasters with 4 bands each that I am trying to create composites so that I can eventually bring all of the rasters together into 1 large raster. But the first step is to create composite rasters. I would like to do this all at once and I found a few examples on various sites on how to do it, including ESRI's. I've pieced them together to create my own code, unfortunately I keep getting error 000271: Cannot open the input datasets. I know the path is correct because arcpy.ListRasters() returns the files in the folder in a large list, so the problem is definitely with the CompositeBands tool. I've looked up possible solutions to this problem, but I did not understand the solutions or how they worked, so if you do have an answer or suggestion, could you comment on your code (if you write one) or answer so I know what is going on and why? About the data - they are all ERDAS Imagine image rasters with 4 image color bands : R, G, B, and whatever N is. All but a few rasters have bands named Layer_1, Layer_2 and so on. The few are called Band_1, Band_2 and so on. Here is my code:
arcpy.env.workspace = r'\\network\folder\subfolder1\subfolder2\All_RGBN'
ws = arcpy.env.workspace
outws = r'\\network\folder\subfolder1\subfolder2\RGBN_Composit'
for ras in arcpy.ListRasters("*.img"):
name = outws+"\\"+ras
try:
arcpy.CompositeBands_management("Layer_1.img;Layer_2.img;Layer_3.img,Layer_4.img", name)
except:
arcpy.CompositeBands_management("Band_1.img;Band_2.img;Band_3.img,Band_4.img", name)
Thanks!
If your rasters have multiple bands, they are already composite. Composite Bands should be used when your bands are distinct raster datasets that you want to merge into one raster.
If you want to merge all your rasters (composite or not) into one single dataset, you should create a Mosaic Dataset or a Raster Catalog and load your rasters into it.
And FYI, you get an error message in the Composite Band tool because your raster bands (inputs) are not correctly referenced, you should write something like:
ras + "\\Layer_x" instead of "Layer_x.img"
But doing this will output the exact same raster as the original one.

SAS gmap and label centering

I have a Problem where I could not find an easy solution and I am looking for some ideas or tipps.
I am working with SAS on a project which result should be a map of europe, where the countries get colored after a certain algorithm. I use the maps.europe data and the %annomac and %maplabel macros to label the countries.
This works pretty fine, except for Portugal and Spain - because theese countries have island far away from the coastside, the calculated centroid from %maplabel of the country is not in the center of the country:
Unfortunately I just can cut portugal completely out of the map but not the Islands
I have tried already this method:
Try to cut the parts of the map via gproject which contains the islands - this delievered unexplaniable results to me (just showing some parts of europe, even if I set the parameters extremly wide)
and now I am a bit stuck.
I already thought about this ideas:
Comnbining the map.europe with the map.spain and and map.portugal where I delete the islands before, but I am not sure how to do that that the labeling and all still works for theese combined data.
Is it possible to set the label points for portugal and spain manually and overwrite the data from the %maplabel macro?
Or is there an even easier solution?
Thanks for your help and best regards
stephan
I'm not familiar with those macros, but given how GMAP works, I would indeed override the annotate dataset. You may want to read up on how annotate datasets work, but in general:
The GMAP statement will have an option, annotate= and some dataset. Find that dataset, let's say it's called ANNODS.
Then look at that dataset. Identify a row that has function=text and label=PORTUGAL. That is the row you need to modify the x/y coordinates of in order to move the label around (x1 and y1). You might need to play around with this some to get the right coordinates.
Then run the PROC GMAP, and you should have a newly moved-over Portugal.