How to open several KML files with separate colors so that I can recognize intersecting paths in Google Earth? - maps

I have about 140 KML files each containing a path and numerous pins along it. I want to open all the files but I need them to have different colors so that I can recognize where the paths intersect. How can I do this?

You can edit and assign different colors to each of your KML files. However, the simplest approach is using the random color mode in a line style added to each KML file.
<Document>
<Style id="s1">
<LineStyle>
<colorMode>random</colorMode>
</LineStyle>
</Style>
<Placemark>
<name>p1</name>
<styleUrl>#s1</styleUrl>
<LineString>
<coordinates>...</coordinates>
</LineString>
</Placemark>
<Placemark>
<name>p2</name>
<styleUrl>#s1</styleUrl>
<LineString>
<coordinates>...</coordinates>
</LineString>
</Placemark>
...
</Document>
You could use a multi-file text editor such as NotePad++ to globally replace tag with tag plus the Style elements in all files. NotePad++ has a Find in Files option to search for files with targeted search and make changes in all matching files.

Related

blogdown not showing plots from .Rmarkdown files but from .Rmd

I'm using blogdown to create my website. Now I found this problem:
ggplots embedded in .Rmarkdown files doesn't appear. When I rename the file to .Rmd the graphic is okay. But I need to use .Rmarkdown because I want to use the beauty syntax highlighting and other features only available in .Rmarkdown files.
When I print the fig.path with
knitr::opts_chunk$get('fig.path')
I see the difference:
In .Rmd
"2020-06-17-rmd_files/figure-html/"
In .Rmarkdown
"/post/2020-06-17-rmarkdown_files/figure-html/"
But I don't see why the paths are changed.
How do I solve this?
I found a solution (at https://discourse.gohugo.io/t/raw-html-getting-omitted-in-0-60-0/22032):
After adding
[markup.goldmark.renderer]
unsafe= true
in the config.toml the plots appear.

How to download images and bounding boxes from imageNet such that they have matching names?

I am doing object detection for a specific class, say, chairs .
I want to download images of chairs from imageNet. I also want to download the annotation xml files (bounding boxes) from imageNet.
Both these things are provided on imageNet and I have successfully been able to download them using a tool called ImageNet_Utils
https://github.com/tzutalin/ImageNet_Utils
But the downloaded images and bounding boxes don't have matching names. So it is impossible to tell which xml file is for which image.
How do I download images and bounding boxes from imageNet such that corresponding image and annotation xml files have matching names?
The download image URLs page says
The URLs are listed in a single txt file, where each line contains an
image ID and the original URL
Unfortunately, as of 2020-03-06, all the URL mapping files link to a Oops! The URL is not valid page. However, can however get mappings for each node individually. They are available by wnid: http://www.image-net.org/api/text/imagenet.synset.geturls.getmapping?wnid=n03273913
A bounding box annotation file will contain this element.
<filename>n03273913_16800</filename>
The n03273913 is the synset id and the 16800 is the image id. In the synset mapping file you'll find the line
n03273913_16800 http://farm1.static.flickr.com/186/425238103_8fe80b37de.jpg
You can download the image from that location.
There's a c++ library known as dlib. You can pass your downloaded images from dlib, it has GUI support for drawing blocks in images and save them in vector formats in an XML file. You can refer here for the documentation

File Attributes/Description

I have to put some attributes on a file like you see it on an jpeg file, there you can add many attributes about the image and resolution and also but information in about the camera.
I also saw it on an mp3 file where you can add information about the song, album ,producer etc...
Is there any way to add these attributes to something like an pdf, txt.
Thanks for your time.
I have to put some attributes on a file like you see it on an jpeg file, there you can add many attributes about the image and resolution and also but information in about the camera.
That is part of the JPEG/Exif file specification.
I also saw it on an mp3 file where you can add information about the song, album ,producer etc...
That is part of the MP3 file specification.
Is there any way to add these attributes to something like an pdf, txt.
Metadata is part of the PDF file specification. There is nothing like that for plain text files.

X3DOM - Dynamically Change ImageTexture with an Inline X3D file?

When loading in an external X3D file via the "inline" tag, I am unable to change the textures my X3D file uses with html.
I am able to edit the X3D file itself and change the textures just fine, but I need to be able to change html values for the textures so that I can hook it up to PHP/SQL later.
Does anyone know how to make it so you can change textures for an inline X3D file? so far I have no found a way, and only am able to change textures without using inline/external X3D models.
I realized you can assign a namespace to the "inline" X3D file you are externally loading, and then take the "DEF" id of the mesh you want to texture by prefixing it with the inline namespace followed by TWO underscores.
Then you can use javascript to do the following: document.getElementById('inlineNameSpace__DEFID').setAttribute('item', 'value');
So, for now I am handling this with javascript and it's working swell!

Extract coordinate data from embedded Google Maps pins

Thanks in advance.
I'm trying to get the coordinates for the pins in this embedded Google Map: http://www.tcatbus.com/learn/system-map
Is there any way? I looked into KMZ extraction but was unable to find the file. Any other suggestions?
The KMZ format is a zipped KML, and KML is in turn XML. A "pin" is represented by a <point> within a <placemark> tag in the mark-up as follows:
<Placemark>
<name>Pin Name</name>
<description>Pin Description</description>
<Point>
<coordinates>-2.465543,51.280132,0 </coordinates>
</Point>
</Placemark>
You can extract the KML from a KMZ simply by unzipping it, or open in Google Earth and export as KML (the latter method has the advantage that it will validate the KMZ file in case what you have is not actually KMZ). A tutorial on KML is available here.

Resources