Message Boards Message Boards

0
|
2976 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Working out the boundary length of mid-size geographical regions

Posted 10 years ago

Wolfram|Alpha readily accepts the following input:

China boundary length

It gladly reports that the boundary length of China is 22772 miles, and a host of other information that I'll never need.

However - I'm trying to work out the boundary length of Hunan, a region of China. So I type:

Hunan boundary length

And Wolfram|Alpha reports that the standard computation time exceeded.

What I'm looking for is a simple piece of information, and if Alpha already knows the answer, it'll give it to me. Otherwise it's probably analysing Google Maps to manually work out the perimeter. So how would I go about working out the boundary length of Hunan?

POSTED BY: r williams
2 Replies
Posted 10 years ago

I will suggest this, thank you.

I have no idea how to use Mathematica, so I'll place faith into the accuracy of your answer and thank you heartily.

POSTED BY: r williams

This would be a great addition to Wolfram|Alpha's dataset. You may want to consider suggesting it in Wolfram|Alpha's feedback form at the bottom of the search results page.

If Wolfram|Alpha doesn't give the solution, you may need to use Mathematica and write out some calculations. This is how I would do that.

(* Get a geographic polygon of Hunan Provence*)
poly = AdministrativeDivisionData[Entity["AdministrativeDivision", {"Hunan", "China"}], "Polygon"]

(*Break the points of the border polygon into pairs*)
Partition[#, 2, 1] &@poly[[1, 1, 1]]

(*Calculate the GeoDistance between the pairs*)
Apply[GeoDistance, #] & /@ Partition[#, 2, 1] &@poly[[1, 1, 1]]]

(*Add then all together with Total*)
Total[
 Apply[GeoDistance, #] & /@ Partition[#, 2, 1] &@poly[[1, 1, 1]]
 ]

The result I get from this is that border is roughly 1909.72 Miles long.

POSTED BY: Sean Clarke
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract