OpenMap - 5m Countour Lines - Paris - gis

apologies if this question has been answered already - from the similar questions list it doesn't look exactly like it has.
I am looking for 5 metre contour lines, for the Paris area, to use in ArcGIS i.e. as a shapefile. It looks like this might be available through OpenMap Tiles but I am unsure, and before making the purchase (it said $13), any confirmation of the product would be much appreciated.
I have read about using data from STRM to create these contours but that is beyond me!
Thank you.

If you want to save $13 you could use ogr2ogr to convert a pbf to a shapefile.
https://gdal.org/programs/ogr2ogr.html
But you need to keep the input and output under 2GB. I would suggest downloading only the Ile-de-France subregion from GeoFabrik
http://download.geofabrik.de/europe/france/ile-de-france.html

Related

How to encode poker cards?

I am currently working on a poker AI and I am stuck on this question: What is the best way to encode poker cards for my AI? I am using deep reinforcement learning techniques and I just don't know how to anwser my question.
The card information is stored as a string. For example: "3H" would be "three of hearts". I thought about ranking the cards and then attaching values to them such that a high-rated card like AH ("Ace of hearts") would get a high number like 52 or something like that. The problem with this approach is that it doesn't take the suits into acccount.
I have seen some methods where they just assign a number to each and every card such that at the end there are 52 numbers from 0-51 (https://www.codewars.com/kata/52ebe4608567ade7d700044a/javascript). The problem I see with that is that my neural net wouldn't or at least have difficulties getting the connection between similar cards like Aces ('cause as in the link above one Ace is labeled with a 0 the other one with 13 etc.).
Can someone please help me with this question such that the encodings take care of the: suits, values, ranks, etc and my NN would be able to get the connections between similar cards.
Thanks in andvance

Relay Calculator: How to show binary results in a display?

I'm trying to create a calculator(real calculator), from scratch, with only simple parts (relay, diode, etc.). But I got to a chronic problem, how the hell do I convert binary numbers, ex:00101110 to decimal? so that I can make my display show 46 for example. Making the display translate a 0000...1001 (0...9) is easy, but what about after that? when a number comes with two or more decimal places (ex:10000000 =128). I know it can be tricky to explain, so is there somewhere I can find the answer, maybe a schematic?
This isn't a programming language, it's literally a relay computer (remember the old IBM, Harvard Mark I?). I just want to make a relay calculator that does binary calculations (the calculation part is theoretically finished. For now only sum.)
What I can't do is make the result in binary become something that can be shown on a 7segment display.
An easy example is: "0000 0111" this I can make the display show the number 7, because it has only one decimal place. Now with "0011 0100" the situation changes, the number would be 52, simply making the "52" appear on a display is not a challenge, the problem here is: how does a processor translate binary numbers from 0000 to infinity, in a way that can you put it on a display?
I don't necessarily need a definitive answer, whatever, even if a website, a book, a light at the end of the tunnel.

wordnet on different text?

I am new to nltk, and I find wordnet functionality pretty useful. It gives synsets, hypernyms, similarity, etc. But however it fails to give similarity between locations like 'Delhi'-'Hyderabad' obviously as these words are not in the wordnet corpus.
So, I would like to know, if somehow I can update the wordnet corpus OR create wordnet over a different corpus e.g. Set of pages extracted from wikipedia related to travel? If at all we can create wordnet over different corpus, then what would be the format, steps to do the same, any limitations?
Please can you point me to links that describe the above concerns. I have searched the internet, googled, read portions of nltk book, but I don't have a single hint to above question.
Pardon me, if the question sounds completely ridiculous.
For flexibility in measuring the semantic similarity of very specific terms like Dehli or Hyderabad, what you want is not something hand-crafted like WordNet, but an automatically-learned similarity measure from a very large database. These are statistical similarity approaches. Of course, you want to avoid having to train such a model on data yourself...
Thus one thing that may be useful is the Google Distance (wikipedia, original paper). It seems fairly simple to implement such a measure in a language like R (code), and the original paper reports 87% agreement with WordNet.
The similarity measures in Wordnet work as expected because Wordnet measures semantic similarity. In that sense, both are cities, so they are very similar. What you are looking for is probably called geographic similarity.
delhi = wn.synsets('Delhi', 'n')[0]
print delhi.definition()
# a city in north central India
hyderabad = wn.synsets('Hyderabad', 'n')[0]
print hyderabad.definition()
# a city in southern Pakistan on the Indus River
delhi.wup_similarity(hyderabad)
# 0.9
melon = wn.synsets('melon', 'n')[0]
delhi.wup_similarity(melon)
# 0.3
There is a Wordnet extension, called Geowordnet. I kind of had the same problem as you at one point and tried to unify Wordnet with some of its extensions: wnext. Hope that helps.

Lat Lng to Makani Converter

Is there anyone knows how to convert a latitude and longitude coordinate to a Makani Code?
Makani is the new addressing system being implemented in Dubai. I wonder how they convert coordinate points to 10 digit unique code called Makani.
see this Makani Website
Just for your information, the Makani number IS based on a standard position system, the MGRS (Millitary Grid Reference System), so the conversion is straight forward enough, or so you would expect.
The problem is the implementation, you need to be accurate to 1m with the selected Co-Ordinates for where the guys at Makani decided to pick, or else your 'converted' Makani number WILL NOT be recognized by the system.
There are actually ways around this however; take for example....
Arabian Ranches, Al Mahra, Villa 124 (Street 4 Villa 12)
Makani Number: 26038 71480
MGRS Reference: 40R CN 26038 71480
Just drop onto Google Maps, select 'somewhere' on this Villa, and get the Co-ordinates...
Lat/Long: 25.049095, 55.275528
Convert this to Military Grid you get...
MGRS Reference: 40R CN 26036 71492
(Just to clarify CN is a 100Km Square Grid and the numbers are X,Y Meter References within that grid, so physically, my Lat/Lon Pick was actually only 2M West [26038-26036] and 12M North [71492-71480] of the Makani Guys Pick, unfortunately, the accuracy makes the error dramatic)
Goto Makani and enter 26036 71492, and you get a 'No Data Found' Error However; Makani DOES let you search by MGRS, so if you enter the complete '40R CN 26036 71492' into the Makani search, it shows the correct location, with the highlighted Makani Pin.
Hope this helps...
I know it's late for answering the problem now, but I think the solution is worth it.
After googling the problem for quite some time, at last, found some solution which is practical and works.
here it is,
You can use this
Dubai-Makani-No-Api , It's
Javascript Module for getting details about Makani Numbers.
OR
the government of Dubai provides a Makani Public Web Service Access API Given
Here and Here
you can view the API for a more sophisticated requirement.

How to find the Shortest Path between all the nodes in a graph without having a pre-defined start or end points?

What I want to get is: the path which connect all the points in my graph, but without having to tell the algorithm where to start and where to finish.
It need to use the driving direction in google-maps api but without setting a start or end point.
It is not the TSP problem because I don't have a "start city" and I don't have to get back to the "start city" neither.
As expressed in this question: Find the shortest path in a graph which visits certain nodes,
I could just use permutation because I have a few nodes, but the problem is that I need to analyze several groups of this few nodes So I would like the function to be the less time consuming posible.
NOTE: Im not looking for a Minimum Spaning Tree as this one neither: https://math.stackexchange.com/questions/130863/connecting-all-points-on-a-plane-with-shortest-path-possible
I want a path which tell me you will save gas if you go first here, then overthere, then overthere, and finally there.
Question: is there any library which can help me with that? Or is it a know problem that has already an exact answer? How could I solve it?
It sounds like you want an all pairs shortest path algorithm. This is the class of shortest path algorithms that attempt to compute the shortest path (or the length of the shortest path) between every pair of vertices in the graph.
These is a well-known problem, and solutions exist. Here's some reading material that describes other possible algorithms. There might be implementations of Johnson's algorithm for your chosen language and development environment.
Keep in mind, this is an expensive problem, computationally speaking.
If I understand you correctly, you want 1 route to visit all the nodes, without a predefined start/end and you want that to be minimal. A possible solution could be to modify your graph a bit to allow a travelling salesman algorithm to get a complete tour.
You start with your graph and add 1 extra node E. You connect that node to all other nodes in your graph and set the cost of all those edges to a very high constant M. You then unleash a travelling salesman algorithm on that graph which will give you a path P starting at E, passing all nodes and returning to E. If you remove the 2 edges in P that connected E to the rest of your path you will have what you were looking for.
A quick intuitive proof that it is indeed what you were looking for: Suppose it's not the cheapest way to connect all nodes. Let's call the supposedly better path Q. Q and P both connect all nodes in your original graph. The end points of Q would be A and B. Both of these would be connected to node E with an edge of cost M. If you would add those 2 edges to Q, you would get a better TSP solution than P, which is not possible as P was the best.
As you are using google map, your particular instance of TSP might satisfy the Triangle inequality.
Are you really speaking of distances or travel time ?
In the case of distances:
try Googling: "triangle traveling salesman problem"
IMPORTANT: The result is a very good approximation of the best result with guaranteed uper bound, not always the best.
One way to go would be using (self-organized) kohonen networks.
Assume you have n cities on a map (works the same in any dimension).
Take a chain of n connected "neurons" and place it randomly on the map.
Then you do several iterations, one iteration contains:
choose any city. (e.g. go through them in a ordered fashion)
determine the "closest" neuron, call it x. (e.g. euclidian distance)
Move this x closer to the city (e.g. take the direction vector from the neuron to the city and multiply it with a learning rate 0
Move neighbors of this neuron also towards this city (but less than in 3., dependend of distance from the neighbors to the "current closest" neuron x)
One can choose various functions in step 2, 3 and 4.
Notice also that this might not give the globally shortest path since it depends on where the start chain is located and different other things. For this on may consider doing several runs with different starting conditions or (depending of the problem) one can help a bit with pre-knowlege.
I hope this helps to complete this question for further readers...