code to create a geometry kml element with coordinates - kml

I have a fusion table : 1hxNUdyIjqYRyv9wFhLcNzGyC-a8lcOlrPFEVB7oR with address. I want to use marker cluster. For this, I need to get coordinates of this address.
It's possible to create kml geometry ?
I've try to download my table in kml and open it with google earth then save in kml again. But when I create a table with this, he doesn't work very well..some coordinates are missing..
Thanks for your help

You can't download these coordinates, they have been geocoded internally.
You can only download data that have been stored in the table(all you see in the rows-view).

Related

Azure Search - Highlights - Locating in image

Just looking for guidance or even a general outline on approach here.
I am using azure search to OCR a batch of pdfs. I have turned on hit highlighting and I am successfully getting results back there that I am looping through / displaying in my view for the end user. I was looking on expanding that functionality to show the pdf images with the highlighting on the images themselves like in the JFK azure example. I am not proficient in react and seem to be getting lost there.
I am assuming I need to save off the OCR images to a data store for reference using the normalized_images that are created? I do have pdfs locally I can load but assume the OCR images maybe different. Have turned on GeneratedNormalizedImagesPerPage and turned on cache which creates files in my storage account.
Then I assume I need to pull the associated image, display it, use the highlight results and pull a corresponding bounding box where the phrase was detected? Problem with that approach is that I do not see any association between the highlight hit and the location (bounding box) of the hit nor the associated image file the hit was on.
Probably way off on approach here but any guidance is appreciated.
Edit 1
I did noticed the items on this page in the JFK example: https://github.com/microsoft/AzureSearch_JFK_Files/tree/master/JfkWebApiSkills/JfkWebApiSkills
Would trying to replicate the ImageStore (so those are stored in my storage account) and then the HocrGenerator (appears to handle points in a doc) into my skillset for my index be the approach?
There are a few steps here:
you need to save the layoutText from the OCR skill somewhere the UI can access it. The JFK Files demo converts it to a HOCR (to display in the UI) and saves it in index as a field in the index so that it is retrieved in the search results. HOCR isn't necessary and you may find it more efficient to store the layout in blobs using a knowlege store object projection.
save the extracted images into blob storage using a file projection into the knowledge store. Keep in mind that the images may be resized in the process and the coordinates will match the resized image saved to the store. If you want to map the coordinates to the original image see this.
At search time, map the highlight to the the metadata. You will find this code in the nodejs frontend, however it may be simpler to follow in the original demo by following the code here. Essentially you just find the first occurrence of the highlighted word in the metadata, display the associated image, and calculate the bounding region of the word.

Loading Google Maps from a kml file on server

My website (www.boatingtrax.com) presents maps from google earth and google maps. I prepare the kml files and load the file to my server. I put links to the various kml files on my site (https://www.boatingtrax.com/notices-to-mariners/news-south-wales-notices-mariners/) and google earth formats are generated. NICE!
I update the kml files daily and a new google earth map is generated.
Google Maps is different. I can produce a google map using the kml file and embed the map on site or share the link Both work well. Also nice!
But I have to do that every time I change the kml files (which is daily). Painful!
Could anyone point me to a process so that I can keep Google Maps updated automatically?
Any help appreciated.
If I understand correctly, your issue is that every time you upload a new KML, it has a new filename, and therefore you need to change your Maps API code to point at the new file each time?
If so, you should probably check out KML Network Links. A KML NetworkLink is a small KML file that contains a pointer to another KML file.
In your case, what I would do is create one NetworkLink KML with a static filename, which always points at your latest data KML. Have your Maps API code load the NetworkLink file, and it will show the target KML. Each time you add a new data KML, you just have to upload a new copy of the NetworkLink KML (with the same filename), which points at the new data KML.
For details on KML Network Links, see these resources:
KML Tutorial - Network Links
KML Reference - NetworkLink
A few things to note... Maps API has some caching of KML files built in, so there may be a delay (minutes?) from when you update the NetworkLink file to when you see the new data on your map. Google Earth supports long strings of nested NetworkLinks, but Maps will only follow a limited number of NetworkLinks (10, I think?), so be careful if you go down the road of nesting them. Also, Google Maps API does not support all the KML elements which Earth does... details here.

Cannot view/access attribute data from KML file in QGIS

Using QGIS, when I convert a SHP file with several columns of attribute data into a KML for use in a Google Environment (e.g. Google Earth, Fusion Tables, Google Maps), I'm not able to view the attribute data following the conversion (while still using QGIS) — all I can see are two columns headers "Name" and "Description" with no cell values. Yet, if I take that same KML and load it into Google Fusion Tables, for example, suddenly all the attributes from the original SHP files are visible.
Is there a way to view the attributes of a KML while in QGIS?
I have not enough reputation to put this in a comment, thats why I give you the hit here...
Think, same problem is discussed here:Not Importing ExtendedData from KML and solution comes with gdal-2.0.2-4

Do KML files have to be on the same domain as the openlayers map?

I'm fairly new to openlayers and I'm trying to simply get a kml to show up on an openlayers map. I have the map and basemap rendering properly in a jsfiddle, after copying out the HTML and javascript from this example here.
I am trying to load a kml that I have hosted on my own domain. The link to it is here. It is just a subset of some water wells data in Alberta, Canada. The code I am using to access the data is:
var vector = new ol.layer.Vector({
source: new ol.source.Vector({
url: 'http://www.cdnpolimap.com/alberta_wells.kml',
format: new ol.format.KML()
})
});
However when I look at other people's maps (mostly in other stackoverflow question), I notice that they are all accessing it without all the http://www......" stuff before it. Am I correct in assuming that the javascript file must be saved on the same domain as the kml and then access it using a relative path? And so therefore I can't access the data when writing in a jsfiddle?
I hosted everything on a single domain and I can now confirm that yes, the kml resource has to exist on the same domain as the js script.

Protect KML file from downloading or accessing

I am trying to protect my KML file, from being downloaded or its data extracted easily. All I want is the file to be viewed in google maps or google earth, but no one is allowed to download it or extract the data "easily" (the kml file isnt going to be available publicly). My kml files are a result of deep and exclusive analysis that is a signature I want to hide from competitors.
Also are there any alternatives to convert kml to a format that data cant be obtained easily from it. My KML files have polygons in 3D.
I understand the concept of everything that can be seen can be downloaded or extracted somehow,
I have 4 answers or 0 answers, depending on your project.
Using Google Maps Api for Business (~ 10.000$ per year) you can
generate a Client ID and use that to protect a Fusion Table (can
create in Google Drive) where you can import your KML and which you
then can display using the Google Maps Api. It would be the perfect solution, but without Google Maps Api for Business your Fusion Table is not protected and so anybody can access
it in Google Drive and view and copy-paste the Kml
representation of the polygons.
Using Google Maps Engine (/Lite) you can import your
Kml to Google as well (if you use Lite then you first need to import to Google
"My Maps" and from within Google Maps Engine Lite you can then
import from "My Maps"). I don't know the pricing for non-lite. A
Google Maps Engine Map can be shared so its only viewable and in
this only viewable version I have not found a way to download or
view the raw-kml-data which would be what we want. Sounds all good,
but you are limited to 3 layers in Maps Engine Lite and I have not found a way to import all my polygons (districts in
my case) into one layer at once. I can only import them bit by bit as it seems (managed to import 10 polygons with a total of 353 Points into one layer). Each import results in one layer, can't move stuff from one layer to another and for some reason there are some polygons that I can't seem to import. Edit:
I can import all polygons, one polygon (due to algorithmic simplification of my polygons) got an intersection (line crossing) and as soon as I fixed that part the import didn't throw any errors anymore, but I see now that I can only embed that map using an iframe having the legend included as well, so this solution is nothing for me.
Restrict access to a KML on your server to Google servers only using a white list of Google Maps servers which might request your
KML. Problem: can't find such a list online... must collect in some
way first.
Also there are blog entries Protecting KML Files from general public access in Google
Maps
and Protect KML / KMZ Files from Unauthorized Access Using
Cryptography
Your question is based on a fallacy of computer security known as "security through obscurity". The fallacy is this. You say you don't want it downloaded "easily." You can make it hard, but as long as its possible as soon as one person figures it out they write a script to do it automatically and its then "easy." There is no answer to your question because it is impossible. Any content you make available is pirateable, and any data is reconstructable.
Why not just save the kml file(s) and cut/paste onto a password encrypted usb drive, like Kingston or Kanguru defender. Then just open the kml from your usb disk.
you can check the $_SERVER["HTTP_USER_AGENT"] variable and if is from google then generate the kml from php.
$agent = "Kml-Google";
$google = strpos($_SERVER["HTTP_USER_AGENT"], $agent);
($google !== FALSE) or die;
header('Content-Type: application/vnd.google-earth.kml+xml kml');
header('Content-Disposition: attachment; filename="otras.kml"');
?>
<?xml version="1.0" encoding="UTF-8"?>
<kml xml ...

Resources