NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

How can the area of a map from OpenStreetMap be determined in the form of Xkm x Ykm, given the following information:

Left Longitude = 103.554879 Right Longitude = 103.740497 Top Latitude = 1.585770 Bottom Latitude = 1.490873

Any ideas? Thanks a lot!

asked 13 Oct '15, 10:47

amatek's gravatar image

amatek
11112
accept rate: 0%


This is not an OpenStreetMap specific question and should better have been asked at a general GIS or geography Q&A site. (Edit: I see it was cross posted. Not generally a recommended practice as it wastes helpers' time.)

You can use PostGIS for this. PostgreSQL with the PostGIS extension is a database system but often handy to do quick geometry or geography calculations like this:

# select st_area(
     st_setsrid(
        st_makebox2d(
            st_makepoint(103.55487,1.490873),st_makepoint(103.740497, 1.585770)
        ),
     4326)::geography);

    st_area      
------------------
  216753707.811525
(1 row)

The area is returned in square metres.

permanent link

answered 13 Oct '15, 13:11

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

edited 13 Oct '15, 13:26

Thanks a lot. Since the image has a resolution of 17408x9216, the area should then be around 141723578m x 75030130m ?

(13 Oct '15, 13:49) amatek

No, 141723578 * 75030130 is 10633538481405140 and not 216753707. Your aspect ratio seems to be about 1.88:1, so you're looking at an area of perhaps 20186 * 10737, assuming the earth is flat.

(13 Oct '15, 16:43) Frederik Ramm ♦

This isn't a simple question, as the answer won't be a square as the Earth isn't flat, so the bottom edge will be a different length to the top edge. Additionally because of the spherical bulge the surface will be greater than the 'flat' area. I think this might answer your question if you're willing to approximate the Earth to a sphere.

Edit: Of course this won't be in the format Xkm x Ykm but give the area in square km, if you specify a value for R, the radius of your spherical Earth, in km, for which 6,371km is an approximation.

permanent link

answered 13 Oct '15, 11:37

EdLoach's gravatar image

EdLoach ♦
19.5k16156280
accept rate: 22%

edited 13 Oct '15, 11:41

Thanks for your response. Actually, I downloaded a map enclosed by those coordinates to be used in a large-scale simulation. Since the image is in XxY format (resolution of 17,408 x 9,216 to be precise), I would like to get an approximate value for my simulation area.

(13 Oct '15, 11:50) amatek

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×213
×63
×55
×45

question asked: 13 Oct '15, 10:47

question was seen: 6,261 times

last updated: 13 Oct '15, 16:43

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum