Re: how to calculate the area of polygon?
Paul Wessel <[email protected]>
| Newsgroups | gmane.comp.gis.gmt.user |
|---|---|
| Message-ID | <[email protected]> |
gmtspatial -Q will either compute areas for closed polygons or line length for unclosed lines. Your polygon is not closed so it is assumed to be a line and you get the length of the line and its mid point. We may want to add a modifier to "force closure of lines to make polygons" but it is not there yet. If I close your polygon then I get gmtspatial poly.data -Q 15 -55 100 assuming cartesian data and gmtspatial poly.data -Q -fg 15 -55.1025678246 707841.648502 if I tell it the data are geographic. On Dec 5, 2013, at 2:43 PM, Namba Takaya <[email protected]> wrote: > Dir Sir > > According to your suggestion, > > I tried to do the script below to calculate the area of the polygon with gmtspatial, but the result is strange as unexpected. > > Could you tell me how to solve the problem? > > gmtspatial poly.data -Q > > poly.data is like > 20:00 -50:00 > 20:00 -60:00 > 10:00 -60:00 > 10:00 -50:00 > > regards, > > takaya > > Date: Thu, 28 Nov 2013 15:48:05 +0100 > From: [email protected] > Subject: Re: [GMT-HELP] how to calculate the area of polygon? > To: [email protected] > > In GMT5 you can do this using gmtspatial, > > If you are stuck with GMT4 it should be possible to do so using grdvolume if you first define a grid file in which all the points inside your polygon has a constant value differing from the points outside, then apply grdcontour to the countour value equal to the value you have chosen inside your polygon. > > regP > > > On 11/28/2013 03:35 PM, Namba Takaya wrote: > Dear sir > > > Could you tell me how to calculate the area of polygon(hour points) like > > 1. 5:00E 55:00S > 2. 6:00E 55:00S > 3. 6:00E 56:00S > 4. 5:00E 56:00S > > regards, > > takaya > > -- > ******************************************************************************** > Peter Schmidt Tel: +46-18-4717104 > Swedish National Seismological Network (SNSN) Mobile: +46-73-3190975 > Dept. of Earth Sciences:geophysics e-mail: > [email protected] > > Uppsala University > Villavagen 16 > SE-75236 Uppsala > ******************************************************************************** > > To unsubscribe, send the message "signoff gmt-help" to [email protected] To unsubscribe, send the message "signoff gmt-help" to [email protected]