How do I standardize geographical data where the format (city/state/country) does not exist? - tableau-api

I am trying to show the current distribution of individuals across a world map, but I am running into trouble trying to standardize location data.
This is a simple feat with the locations of the American and Canadian individuals as they all follow a similar structure (City -> State -> Country). I would ideally like to show these on the city level so that each state with multiple individuals doesn't only contain one dot.
However, there are cities such as Kampala, Bicester, or Bucharest that do not have a state or province and the next largest region is the country itself.
If I use the city as the level of granularity, I see what I'm looking for in the US/Canada area but miss all of the geographical areas without a state. If I show only the State/Country, not only do I miss those without a state, but I also am only seeing one dot for each state whereas I want to see a dot for each city in the state that an individual resides in.
I tried to edit the unknown locations but was still unable to resolve the state/province conundrum. I am unsure how to get around this and can't find any resources discussing this issue. Can anyone point me in the right direction on how to standardize inconsistently formatted location data?

Related

Tableau Map Report

I am working on creating a map sales report to show the sales by product for various territories. The territories are based upon zip codes and are custom territories that overflow into multiple states or are partially in a state. I have gotten everything set up and it looks good for the most part...EXCEPT 2 areas.
1.) one of the sales numbers shows up in Alaska which is not viewable if a user is zoomed in on the USA (we are US-based so it's only relevant to show anyways). Is there a way to force a sales number to show up on a user-defined location? For instance, can I show this on the State of Washington instead of Alaska or can it only default to the largest (area) part of a user-created territory map?
2.) being that we are US-based is there a way to move the states Alaska and Hawaii closer to the US? I know that utilizing the dashboard is a workaround, but it does not look good.
I'm not sure this could be a complete answer, but I think this question has more than one take.
That being said, if your worksheet is based on zip codes in order to create a map, I don't think you can force Tableau to visualize data out of their original position based on the specific geographic role.
The only thing that come to my mind is switching your approach from geographical role (country, state, city, zip, etc) to a more generic lat/long coordinates.
Doing so, you can manually match your Alaska zip codes to lat/long more "continental" areas.
Anyway this would require a lot of data manipulation prior to Tableau.
An alternative way of accomplish something similar to what you say in your second point could lead you to use 3 seperate worksheets in a single dashboard: continental, Alaska, Hawaii.
I did something on US data and I was facing the same problem for Hawaii, so I decided to use a floating worksheet putting it on the bottom left corner of the continental map.

How can I log my position regularly in a GIS Model?

I have a GIS model where a truck leaves a main distributor, visits several customers along a route to make deliveries, and then return to the distributor once it is empty. The route is chosen based on proximity of agents to the main distributor and to each other. I'm trying to figure out how to log the route the truck took in order to make the deliveries, though I have not been able to do so yet. Any help is greatly appreciated. Thank you!
If you want to log street names (as you do):
You can't.
Not with the free GIS map service that pulls data from OSM. I believe that you could do it from Google Maps services but it is very expensive... Your only chance is to download OpenStreeMap shapefiles of the area of interest, convert them into a network of paths and pull the street names from there.
The OSM shapefiles should have street names in their dbf files and you can specify in the AnyLogic GIS map object in which column of your dbf file the street names are located. Then, upon converting to path objects, AnyLogic will name the path object according to the street name.
But to be honest, this is not trivial and might be overkill for you. Maybe think about logging something else?
In order to log coordinates i would use a collection of type GISRoute. This is the type you are getting anyway when calculating route for your truck. And GISRoute contains an array of segments (GISMarkupSegment). And every segment has a start and end (type Point) with its lat and lon (methods getLatitude, getLongitude).

How to find relation between two columns of csv (containing labels and related data) file using doc2vec?

I am working on a problem related to doc2vec where i need to find labels that are related to a particular word. For ex (csv file):
Data Label / Tags
In a future world devastated by disease, a convict is sent back sci-fi
in time to gather information about the man-made virus that
wiped out most of the human population on the planet.
You have slipped under my skin, invaded my blood and seized my action
heart. That sounds more like a poison than a person,” was all I
could say. His confession had both shocked and thrilled me.
Plenty of data like this is available on which the model can be trained. Now, I want the results like, when I enter a particular word like virus, it gives me corresponding labels (sci-fi) where ever the word is used and also give those labels (action), where the word virus itself is not present but it's semantically related words (like poison, poisonous) are present. The semantically related words can be easily fetched from the model. I just want to list the labels.
I want to know if something could be applied rather than using keyword search. Any particular method which could help me solve this problem.
Thanks

Offline foward geocoding

In my location based iPhone app I like to let it also work with no network availability. I have a normal google map. The app works with forward geocoding so when a city or country is typed in, I need the longitude and latitude. Can this work on a offline basis and how?
You can find a database here:
http://dev.maxmind.com/geoip/geolite
Go for the CSV/Zip GeoLite City database. It has an archive of data going back to 2009. Make sure to download the latest one, at the bottom (GeoLiteCity_20130101.zip). You could also go for the gzip, or binary data version, but I don't know the exact format of the binary data. It's explained somewhere on the website.
The CSV archive has two CSV files. GeoLiteCity-Location.csv has a rather large database of cities (which you would probably want to convert into a format that would be able to be searched faster than an array, and hopefully take up less space). It contains the country, region (eg State), city, latitude and longitude for just under 400,000 cities across the globe. The other file contains IP ranges for those cities, if you also need that.

Group annotations with same name

I'm currently developing an iOS app which shows realtime data, now I receive 33,265 timingpoints from the API, which are all stops. So stops on opposite sides of the street are counted as 2, bus stations which have multiple platforms are also counted as many times as there are platforms.
Now, this is confusing on a map. You'd want all data for example a bus station on one screen and don't browse past 10 platforms to get the bus you'd like to take. So how can I group these annotation, which have the same name, and often are near or overlapping each other?
You can find an example of the JSON results from the API here: http://pastebin.com/RiKS4G0Q
Just make a new entity Location and have a to-one relationship to each stop (reverse is to-many, of course). Now one stop can share a location and you can present the dat in an appropriate way. During import, you could decide to create a new location if the coordinates are close enough to each other (and maybe the stop names correspond).