KML LineString Length - kml

Using MSVS C#, I'm creating a KML file. For the sake of simplicity, assume that it has 2 Point placemarks with name tags A and B, respectively. The third placemark is a LineString using the coordinates from the points, with a name tag "A > B". I want the description of this placemark to say "Distance: xxx km", where xxx is the distance between A and B.
Is there a KML or Google Earth tag that I can write to the KML file that will output the distance when the file is loaded into Google Earth and I click on the line? Better yet, can I keep track of these as the app generates the KML file or in the KML file itself so that the document can have a description that has the total distance of all LineStrings?
Thanks.

After posting this, I came across a Vicenty formula written in Java that does what I want. It was a simple matter to port it to C#.
It can be found at https://www.neovasolutions.com/2019/10/04/haversine-vs-vincenty-which-is-the-best/
It's a shame a forum designed to help developers would have someone downgrade a question without even bothering to post a response that might be of use, even if it's a link to where such a question was answered. If this was an admin who did this, kindly delete my account—I certainly don't need the bigotry and scrutiny. In the future, I'll try to find my answers elwewhere.

Related

How to create Perth Metropolitan Area Map in SVG

I am working on a project where Users can interact with a Map via mouse click to see more details of an area. It is Perth Metropolitan Area Map. This Map is generated from PDF using online "PDF to SVG converter".
When I looked at generated SVG code it is so huge can't understand full of it. and did some research to see if i can find any simpler version of the Map, I see there are various options to construct SVG, detailed below.
Shapefiles : Creating maps based on real world data, I thought this is good option to go. but the problem I observed here is we need to depend on GIS tools and open databases where GIS data is available. It is too heavy for our requirement.
Geo JSON / Topo JSON : I see this is simple way to represent Maps in plain, but I could not figure out a way to generate required JSON files. After exploring more on this I understood these technologies are dependent on GIS / Shapefiles.
Inscape : UI editor to draw SVG - It is just generating lot of SVG code again.
After reviewing above all I kind of thinking may be I should learn to write own SVG map.
Can somebody advice whether I am in right direction or Are there any simple approaches to create a Map like this Perth Metropolitan Area Map ?
Thanks in advance.

Extract KML from Fusion Tables into Google Earth

I am trying to extract my KML file from Google's Fusion Tables into Google Earth. I follow what I think are the necessary steps via KML Network Link instructions. I must be missing something because no matter what I do the data will not show in Google Earth. I have the Fusion file shared as Unlisted, but am I supposed create a public URL as well in order for the points to show in google earth?
Sorry for the basic/beginner question. It's SO basic I can't find a question already addressing the issue.
Thanks in advance.
I can think of two things to check.
1) Your Fusion Table must be "exportable". Edit->Modify Table Info. Make sure the exportable checkbox is selected.
2) Did you rely on geo-coding addresses when creating your table? The lat/long values of geo-coded addresses in Fusion Tables will not be exported in the KML, and addresses might not display in Google Earth.
Eric

CAPTCHAS and img name /displayed value association

Unfortunately I am having trouble summing up this question in one phrase/line, thus I am forced to initially hint as to what my understanding is before asking the question in fear of me asking a question based on wrong facts or assumptions. As I understand “and please correct me if am wrong”, as I understand captchas work like so:
Have numerous images, and associate each image name/source to its displayed characters value.
Display image, then have user input what they see.
Match user's input against the character value which is associated with that image's name/source.
Assuming my understanding is correct: Given an unlimited amount of time,
Can't one associate image
names/sources with the displayed
characters increasing the chance of
cracking the captcha as they gather
more associations?
In that case, wouldn't the security strength of captchas be parallel the size of the image database?
NOTICE: As i suspected my question was based on wrong understanding.
Short answer! These are dynamic images and they are not stored anywhere. You wont even find them in the source code..
Wikipedia has good explanation about this. Alternatively check out the related questions in SO.
Edit: Goto this page where you can see an example of a captcha. Use firebug to see the HTML code for this image and you will see something like this.
<img height="57" width="300" src="http://www.google.com/recaptcha/api/image?c=03AHJ_VutaG4ahxWuQv0e6edYypp_FM8QuFIZkG75AnAm8iu3WRmwQ41jqcvojmKmbSKXxkf_s9fk61-axEp77_omKZZEYliE35BND_hXNh3Jac6ZUAeD08wOMZPj4W2s-A39vAI84eim5q-z9kFnmoSmon1jG2LmmFw" style="display: block;">
Did you notice the source? It does not point to an image file.
You can copy this url and generate the image (just open it in a browser). So you can develop an application which can download this image and then scan for color change in pixels and try to match for alphabets and numbers but if you notice almost all the alphabets and numbers are connected and closer so it is difficult to seperate different alphabets.
Even if you manage to seperate most of the alphabtes are not perfect. example :
(source: watblog.com)

United States State shapes for Office

I want to create visuals along the lines of CNN's "red-state, blue-state" shadings of the states in the U.S. for my project. I'm planning to do something fancier than just shading the state's shape in a color. Are there open source libraries of state shapes/polygons (or - if not open source - others) that I can import into Word, Excel, etc. that I can use to show complicated graphs based on states?
I have Map Point, but haven't been able to figure out how to shade the states in a complex way.
you could try google charts, it looks like http://www.woot.com is doing something similar to what you need
Here is a good example using google maps... I've used code like that before.. perhaps from this exact example.
http://econym.org.uk/gmap/example_states2.htm
EDIT: you might want to consider converting the states.xml into JSON... it'll be smaller (136k of XML right now!) and should load faster in most browsers.
There might be a couple parts to the question you are asking, but to address the first part "Are there open source libraries of state shapes/polygons...", here's a resource to check out:
http://commons.wikimedia.org/wiki/Category:SVG_maps_of_the_United_States
It's a list of various SVG(scalable vector graphics) files which can be imported into a number of applications. Basically a giant xml representation of lines and endpoints. This can be directly converted to XAML, if you're into a more programmatic way of charting(ie, C# w/ Silverlight).
However, to address the second part regarding MS Office, Visio can import SVG files for manipulation as well. I'm unsure what type of graphs you were looking for, but I hope this can assist in some small way on your path to awesomeness ;)

How to get a description of a URL

I have a list of URLs and am trying to collect their "descriptions." By description I mean what comes up, for example, if you Googled the link. For example, http://stackoverflow.com">Google: http://stackoverflow.com shows the description as
A language-independent collaboratively
edited question and answer site for
programmers. Questions and answers
displayed by user votes and tags.
This the data I'm trying to accumulate for the URLs I have.
I tried parsing the URL's meta-descriptions, however most of them are lacking a meta-description (yet Google and other search engines manage to get a description somehow).
Any ideas? Should I just "google" each link and scrape the data? I have a feeling Google wouldn't like this...
Thanks guys.
Different search engines have different algorithms to get the description out of the page if/when they are lacking the description meta tag. Some ignore the tag even it it's there.
If you want the description Google has, the most accurate way to get it would be to scrape it. Otherwise, you could write your own or look around on the web for code that does it.
These are called snippets.
Google use proprietary (and possibly patented) methods to garner this information, so there is no simple answer.
As you suggest, they will use meta-description information if it is there. (How to set the meta-information to help Google.)
They will also honour requests from the page authors to NOT include snippets. (How to prevent Google from displaying snippets) You should probably respect this too (as well as robots.txt, of course.)
You may have some luck with existing auto-summary packages, such as OTS.
You may want to check AboutUs.org (i.e. http://www.aboutus.org/StackOverflow.com).
But, there's little chance that the site will have an aboutus page and not have a meta description.
Some info that might explain how google does this:
Webmasters/Site owners Help
Adding a URL to google
I am not familiar with Google APIs, but perhaps there is an official way to get such information.
Interesting. some sources are better than others.
For "audiotuts.com" google has a worse description than AboutUs.com.
Google
Nov 18th in General by Joel Falconer ·
1. Recently, an AUDIOTUTS reader asked me about creative process. While this
is a topic that can’t be made into a
...
AboutUs.com:
AUDIOTUTS is a blog/tutorial site for
musicians, producers and audio
junkies! It is the sister site of the
popular PSDTUTS, VECTORTUTS and
NETTUTS.
I hate problems like these... they should be trivial but they aren't!
If you can assume English content, you can first look for Meta Description, and if that doesn't work, you can look for the first two or three sentence-like word sequences.
A product I worked on looked for the first P or DIV that contained more than one sequence of > n "words" delimited by periods. It would use the two or three sentence-like sequences, up to x total words, as a summary paragraph. It wasn't 100% accurate, but good enough for the average case. The number of words was adjusted a few times to eliminate things like navigation elements.

Resources