I am checking the traffic flow api mentioned below of here maps.
traffic.api.here.com/traffic/6.1/flow.json?bbox=12.9181%2C77.6218%3B12.9163%2C77.6239&app_id=<>&app_code=<>
How do I uniquely identify the flow items. There is some PC (TMC point code) which I thought of considering, but not able to understand if that will be unique across area/city/country. Is PC unique across a city? I am new to TMC concept. Is it like a country is divided into TMC tables and PC is unique in a given table?
TMC is country specific. You can refer to https://developer.here.com/documentation/traffic/topics/resource-type-tmc-code.html for understanding TMC Code Types. It is a fixed 5 characters of the below format ECC+CCD+Table , where the following rules apply: ECC is the Extended Country Code. CCD is the TMC country code. Table is the defined TMC Table
For example, to filter for the New England region in the USA, concatenate the US extended country code (A0) with the TMC country code (1) and the New England region table ID (29), producing the following parameter/value pair:
&tables=A0129
Related
Good evening everyone,
I am using OBIEE and I am trying to extract a file containing some candidates' information to keep in our records, as my organization will need to delete most data soon.
I have data related to recruiting that people put in their applications for job vacancies.
I am trying to have a single row per candidate per application (i.e. if a candidate applied to 2 different jobs, it will count as 2 rows), and insert the highest education, the related insitution, their most recent job title, and the most recent employer name.
I have these facts:
ID,
degree_type,
institution,
job title,
employer.
and they all have the starting date and the graduation date.
When I extract the report, I get something like this:
ID
degree_type
institution
job_title
employer
001
Doctorate
Univ. A
eater
google
001
Master's
Univ. B
sleeper
samsung
001
Other
Univ. A
jumper
apple
002
Bachelor's
Univ. C
clapper
nutella
002
Master's
Univ. D
somethinger
fujitsu
002
Doctorate
Univ. A
somethinger
fujitsu
003
Other
Univ. E
eater
EU
003
Doctorate
Univ. Z
spy
UN
As you can see, each person might or might not have different levels of education, and when I extract this analysis, I have one ID with multiple rows, as many as every degree and every job experience, sorted by chronological order.
This creates some readability issues. Besides, we only want the highest degree and the most recent job.
So something like this.
ID
degree_type
institution
job_title
employer
001
Doctorate
Univ. A
eater
google
002
Doctorate
Univ. A
somethinger
fujitsu
003
Doctorate
Univ. Z
eater
EU
Instead, when I try to apply filters or step, I can only manage to obtain a result based on either
A) the most recent degree and the most recent employer, or
B) each degree and each work experience that was carried out in the same time period of the degree.
Option A does not work for multiple reasons, e.g., if someone got a certification after a PhD, I will have a person with "other" whereas they should have "doctorate"
Option B is not useful at the moment, as we only want one row. Besides, if I worked after getting a degree, that work experience would not appear as it only shows the work carried out during the studies.
I am new with OBIEE, and I am not familiar with SQL. I usually use R, and for completely different reasons.
If I could assign a value to each degree and then filter by the highest (eg., IF there is a doctorate, THEN show it and STOP. ELSE show master's. IF not master's and doctorate, THEN show bachelor's and STOP.) And then add the work experience by date, that would be great.
Is there a way to do this?
Thank you so much! And apologies if it does not make any sense.
PS> I saw this reply already How To Get Highest Education Using MySQL?
but that person has multiple columns for each degree, whereas I have them altogether.
I am assuming that OBIEE is just a DB and you can use SQL to get the info.
I also assume that the ID column you provide represents unique ID per Employee.
Your task requires intermediate if not advanced SQL techniques to solve. Here are the steps.
you need to codify the sort order of the degree level - in 3NF (third normal form) you would add a reference table to store one row per degree and include degree_name varchar column (primary key) to equal the values you list in your post, but then another column degree_sort integer that sorts the degrees the way you want. You would join to this table on the varchar value and return the degree_sort value
Handling ties: Another complexity is how to handle the possibility of a employee having multiple jobs at the doctorate (I presume that is the highest) education level - you would need a "start_date" or some data point to break ties.
Here's a stack post that explains an analogous scenario, getting the record that represents the latest revision of a document (revision is your degree level, document is your employee ID):
https://stackoverflow.com/a/38854846/1279373
Your partition clause would be:
PARTITION BY id ORDER BY degree_sort DESC, start_date DESC
Note: The where clause (see sql in the referred to answer) handles "return only the rows with rank 1"; use ASC (ascending) and DESC (descending) in the ORDER BY clause to rank "low to high" or "high to low".
Here in Italy the land is politically divided into regions, provinces and municipalities. For example I live in the city of Varazze, whose province is Savona, in the region of Liguria.
I created a Firestore database that accepts businesses whose addresses are composed like the example up here. Nothing difficult as I use an external service which give me consistent and correct geo data. The rest of the information for the business is entered by the user.
Now I need to search into this db of businesses by region and/or province and/or municipality. To set up the UI with the filter, I absolutely need to show only regions, provinces and municipalities that have a business into the db and not all those available (FYI: Italy has 21 regions, 107 provinces and ~8000 municipalities).
Looking down the internet and here on SO, I understand that the best strategy is to create a new collection to store distinct data about the location, separated from the businesses collection, in order to enable a quicker lookup. So every time I add or edit a business I check if it's region, province and municipality exists in the "search collection" (let's name this way) and if not, add it.
But how to structure this collection?
If I use the municipality as key, I'll have a quick lookup for the municipality itself (at top will be 8000 records), but if I need to search by a region or province the result is poor because firestore does not have any way to "distinct" the results (something like SELECT DISTINCT province FROM geocollection WHERE Region='Liguria' if you want to visualize it in SQL) and I have to do it on a server or at worst on the client (not an option this last one).
I don't know if staring with the region and keeping the structure region -> province -> municipality is the way to go. Or going for the province, being halfway between.
Another way could be to have separate collection for regions, provinces and municipalities.
What I'm asking here is what is the best solution, in terms of performance and data complexity.
A good way to go on this would be to have a collection Regions, then each Region has a Collection Provinces, and each province has a collection Municipalities.
And the documents have the name of the geografic region as ID, This will allow you to lookup by the ID on the corrisponding collections.
I'm using the Here Geocoder API using free-form input and getting random results when searching for postcodes in the Isle of Man.
I haven't tried all postcodes but the couple I have tested (from customer complaints) do appear to have a problem.
You can test the postcodes on the examples page and see the response yourself - https://developer.here.com/api-explorer/rest/geocoder
When searching for the postcode IM4 4LH the response returns an address for IP4 4LH but if you search for IM4 4 you get the right general area.
Another example is if you search for IM5 1HD you get the right response but if you search for IM51HD you instead get a response with IP5 1HD as the postcode.
IM4 4LH & IM5 1HD are legitimate postcode areas so I was wondering if there is something else we can do to more accurately target postcodes.
I know results could be more accurate with more search data but I would have thought a postcode on it's own would be more than enough.
Any help would be appreciated.
Thanks,
Jason
In the core map for United Kingdom and for Isle of Man only sector postal codes are available. E.g. " IM5 1".
The Geocoder additionally uses an extra product which provides the full postal codes (seven digits). Until last quarter they were covering only United Kingdom. E.g. postal code " IP5 1HD" is coming from these products.
Starting from this quarter it will cover also Isle of Man. This still need to be integrated into the Geocoder database. As soon as we are done, full postal codes will also be available for Isle of Man.
We work on it but cannot yet commit on a timeline.
I asked a question a little over a week ago.
Firestore order by two fields
The response I got said that:
"The API supports the capability you want, although I don't see an example in the documentation that shows it.
The ordering of the query terms is important. Suppose you have a collection of cities and the fields of interest are population (h1) and name (h2). To get the cities with population in range 1000 to 2000, ordered by name, the query would be:
citiesRef.orderBy("population").orderBy("name").startAt(1000).endAt(2000)
This query requires a composite index, which you can create manually in the console. Or as the documentation there indicates, the system will help you:"
***But what this returns is not cities with population between 1000 and 2000 ordered by name but rather cities with population 1000 ordered by name followed by cities with population 1001 ordered by name followed by 1002 ordered by name and so on up to 2000.
I wondering if there is a way to get all cities between 1000 and 2000 in population ordered by name.
Thanks.
I think you're looking for where clauses on population:
citiesRef
.where("population", ">=", 1000)
.where("population","<",2000)
Because Cloud Firestore doesn't support ordering by a different field than the supplied inequality, you won't be able to sort by name directly from the query. Instead you'd need to sort client-side once you've fetched the data.
Trying to build a dialog with a single text box where a user can (among others) enter just a street name in Germany, and the dialog should then display a list of all the postal codes (PLZ) possible for that street name in the whole of Germany. So basically I would need a list of all the PLZ + street name combinations in Germany ordered by streets in bigger cities first (or bigger streets first, if possible). I Have tried several different HERE APIs, but cannot yield any results when doing a search with only the street name, with country set to Germany. If I additionally fill in the city (streetname + city), then I get a nice response with all I need. So is there any way to get results for queries containing only street name and country (where country='DEU'), and without any city? The search would need to be location agnostic, only assumption being that the user is in Germany.
This kind of minimalistic search seems to work at here.com map site. The only problem on the here.com site is that it's locating me on a wrong city, and thus the 3 results it's giving me are not really relevant for my location. For instance, I'm in Berlin and here.com locates me in Leipzig, and I'm searching with "Chausseestr.".
Any thoughts if an address search with only the street name and country is feasible?
Thanks!
This looks like a structured Geocoding request, but unfortunately a street only geocoding request is too broad to return a valid response. Neither does a request combining street with country. Your best bet here would be to split Germany up into a series of non-overlapping bounding box geocoding requests covering say the north-east, north-west and south of the country and to amalgamate the results.
This request looks for 'Hauptstrasse' in Eastern Germany and returns up to 100 post codes only
http://geocoder.cit.api.here.com/6.2/geocode.json?street=hauptstrasse&responseattributes=none&locationattributes=none,ar&app_id=APP_ID&app_code=APP_CODE&gen=3&addressattributes=none,pst&country=deu&mapview=LAT,LONG;LAT,LONG&maxresults=100
street sets the street name to look for,
country=deu restricts the results to Germany
responseattributes=none removes confidence meta info from the response
locationattributes=none,ar restricts the responses to address only
addressattributes=none,pst restricts the addresses to post code only
mapview defines the limit of the bounding box of the request.
maxresults=100 ensures up to 100 results are returned.
Repeat this with Western Germany, Southern Germany and so on.
What works for here.com, and may work for your dialog box, is to use the suggestion end point from the places api. Try making a series of suggestion requests as the text box is filled setting the X-Map-Viewport to cover Germany :
http://places.cit.api.here.com/places/v1/suggest?X-Map-Viewport=LNG,LAT,LNG,LAT&q=haupt&app_id=APP_ID&app_code=APP_CODE&accept=application/json&size=100
There is even a ready made JavaScript component which could do this.
have you considered just try the geocoding ? and not taking just the first result, I would suppose this is what you see on the service example you are refering to. Thus do actually loop through all of replies. Of course see the API you are using, and make sure you are setting some nice number for the max results before doing any queries.
At least in some HERE offerings the reply data also includes address, thus you could fetch the postal code from there.
Also if it is not there, then do revercegeo query with the location gotten, then at least you should be getting it
Never too late to answer such a question.
Install QGIS (free).
Then "Plugins" -> "Manage and install plugins..." -> install "OSMDownloader"
Then "Vector" -> "Openstreetmap" -> "Download data" after you've zoomed into the area of interest
When you have the .xml file, use simple unix command line utils to slice and dice accordingly.
Quick hack (bit of a caveman solution but worked for me):
$ grep -A1 'addr:post' OSM_input.xml | egrep -v '^--$' | sed 'N;s/\n/ /' | grep 'addr:street' | awk -F'v="' '{print$2"#"$3}' | sed 's/"\/> <tag k="addr:street" //' | sed 's/"\/>/,/' > output.txt
The output.txt will contain a mostly accurate (needs some manual cleanup) file whose format is: zipcode#streetname (one per line).