Tag Info

Hot answers tagged

16

Google Maps Mania blog points to example of Swiss Administrative Boundaries Map: The code from Vasile is on github.


14

Open field calculator, select the new column and type the following expression For area: $area For perimeter: $perimeter Make sure your layer is in a projected coordinate system (not lat/long ) and in correct units. ( i.e. if your layer's projection has 'meters' as units, your area will be square meters ) Note that reprojecting layers on-the-fly does not ...


11

There are three different ways to find and store polygon area into a feature class with arcpy: 1) field calculator, 2) "classic" arcpy cursors, and 3) arcpy.da cursors. Some of this is borrowed from my previous answer about using SearchCursor. 1. Field calculator When using field calculator, there are three different expression types that use different ...


10

I generally use the character ² or U+00B2. So it is km², without requiring any special formatting. If you have a MS Windows keyboard, type the sequence: Alt+0178 Other platforms have different ways of typing this character. You can also copy/paste the Unicode character. More info: http://www.fileformat.info/info/unicode/char/b2/index.htm


9

Try this formula (assuming your source is WGS1984, if not then you'll need to adjust the ellipsoid used by the second line): area = rad(x2 - x1) * (2 + sin(rad(y1)) + sin(rad(y2))) + rad(x3 - x2) * (2 + sin(rad(y2)) + sin(rad(y3))) + rad(x4 - x3) * (2 + sin(rad(y3)) + sin(rad(y4))) + rad(x5 - x4) * (2 + sin(rad(y4)) + sin(rad(y5))) area = abs(area * ...


9

Here's a link to some code that'll yield the area of a simple polygon (originally from the World Wind Forum): http://forum.worldwindcentral.com/showthread.php?t=20724. This solves the problem on a sphere, roughly based on the relationship: S = area of polygon; theta is the sum of interior angles in radians; n is the number of vertices; r is the radius of ...


9

It is a consequence of a theorem of Archimedes (c. 287-212 BCE) that for a spherical model of the earth, the area of a cell spanning longitudes l0 to l1 (l1 > l0) and latitudes f0 to f1 (f1 > f0) equals (sin(f1) - sin(f0)) * (l1 - l0) * R^2 where l0 and l1 are expressed in radians (not degrees or whatever). l1 - l0 is calculated modulo 2*pi (e.g., -179 ...


9

You are doing nothing wrong: In QGIS Lisboa and 2.1.0 (dev) the areas calculate perfectly, in QGIS 2.01-3 (standalone) not. This is a known QGIS 2.0.1 bug and has a ticket: https://hub.qgis.org/issues/9031 Simply turn off On-the-fly-reprojection while calculating the new field, or try again with the latest dev build from OSGEO4W.


9

There is a relatively simple exact formula for the area of any spherical quadrangle bounded by parallels (lines of latitude) and meridians (lines of longitude). It can be derived straightforwardly using basic properties of the ellipse (of major axis a and minor axis b) that is rotated around its minor axis to produce the ellipsoid. (The derivation makes a ...


8

Accuracy of calculated results depends on a number of discrete processes, which can all compound inaccuracy in the final dataset. The importance of Metadata in this situation, is it can be used to explain error and even identify steps error is introduced. The most important thing is to understand that ground truthing your results, if performed correctly ...


8

You have to set your Project CRS also to UTM fuseau 35 Sud (Settings/Project Settings/CRS). CRS for shapefile and project may differ, but measuring is always done in project CRS.


8

I would try the Union tool with NO_GAPS. NO_GAPS —A feature will be created for the areas in the output that are completely enclosed by polygons. This feature will have blank attributes. You can then select the features with blank attributes below a threshold size and calculate their attributes to be the same as the original polygon - or copy/paste ...


7

PostGIS 1.5 introduced a new GEOGRAPHY type. The GEOGRAPHY type allows for unprojected coordinates on a spheroid to be stored in a PostGIS table, and some analysis functions to be performed upon them. ST_Area queries can be performed upon GEOGRAPHY type polygons in order to calculate their area in square meters. The following query outputs the area of ...


7

This is a problem that everyone solves with a slight difference. IMHO, Yahoo did a great job with WOEIDs. As far as what is the most efficient way, it seems the answer is too subjective and dependent on your application.


7

Almost all global rasters twice as long as high, and especially those with numbers of rows and columns being nice multiples of 180, use ("unprojected") geographic coordinates. Therefore this one almost surely uses square cells of 0.1 degree. Please confirm this in the grid's metadata if possible. The conversion from square degree to square meter depends on ...


7

For the Project coordinate reference system, you have to choose a projected CRS, which uses real metres as units. Openlayers Plugin uses Google mercator, which is only corresponding to real meters at the aequator. The further north you come, the more distorted the length units are (look at Greenland in Openstreetmap, it is not so big in reality). By ...


6

You have a closing paren in the wrong place towards the end of your query. I tried this and got a NaN return, SELECT ST_AREA(ST_Transform(ST_GeomFromText('POLYGON((871325.790874952 6105405.3261047,871418.748307692 6105359.72944624,871346.22022442 6105215.141258,871254.85408906 6105261.72007212,871325.790874952 6105405.3261047))',4326),31467)) As sqm; ...


6

As MappaGnosis indicated, you could write a little script for this. Here's one called polygonbuffer which takes three arguments: The output file name, the radius of your buffer, and the number of corners of the polygons. Open a Python console in QGIS, paste the script and press enter to define the function, then call using something like ...


6

Very interesting question! I'd note that the geography area calculation is extremely close (in your last example, 3 msq difference over an area of 20000000 msq. (0.000015%) Since we know that census manages its data inside Oracle Spatial, I'd guess that what you're seeing is a very small difference in the implementation of geodetic area calculation between ...


6

The quickest way that I am aware of, is to use the Shapely library (requires the GEOS Engine, you can find a one-click installer for shapely here if you're on windows) The manual provides a dead-on example of what your question: >>> from shapely.geometry import Point >>> a = Point(1, 1).buffer(1.5) >>> b = Point(2, ...


5

Here is the really easy way. Add a field to your existing feature class. Right click on the field title and choose "Calculate Geometry". You'll then have the option to pick your desired coordinate system and units of measure. One note: This calculation is static, so you will need to recalculate anytime you make changes.


5

Kirk If you are doing this within Arcmap and you have an open table, have you ruled out using the Calculate Geometry option after right-clicking on the field. If your dataframe is already set in the projection that you want you should be able to use its coordinate system without the prior projection issue.


5

You could also try using the MaxMind GeoLite City dataset. This dataset is a point layer that contains both the AreaCode and MetroCode (Example: AreaCode - MetroCode - XXXX). If you have a metrocode, you might be able to get closer than just with area code by finding the nearest City point that shares both the area code and metrocode of the phone number ...


5

The latest PostGIS has a "Geography" data type which does calculations on Lat/Lon WGS84 spatial reference system data, and returns the distance or area results in meters/sq. meters based on the WGS84 ellipsoid. So you could bring your country data into PostGIS in WGS84 Lat/Lon, using Geography instead of Geometry and then create the buffers, and do the area ...


5

if you´re looking for something like this(labels denote area in sqkm): You can just intersect the Fishnet with the Polygon Layer.


5

I would recommend clipping the raster to the shapefile, then in the resulting raster you can look at the number of cells present for each of your classes. The area can be calculated by multiplying the number of cells by the area covered each pixel (cell size squared). It's a different approach than the equally valid solution offered above but from a ...


5

First save the CSV points to a shapefile. Then try the Points2One plugin to convert the points to a polygon. Then you'll be able to use the Field calculator to get the area of the polygon.


5

Your units are in decimal degrees and they should be in a projected coordinate system. If you still have the gps unit, you can change it to something like an appropriate UTM projection then download the coordinates and use those in your calculation.


5

Would something like this work for you? I'm assuming that the right of way area includes both sides of the road and that you know the length of the road you are measuring. // Use the same sq distance measurement as your buffer, a sq meter area uses a buffer in meters var_area = 500 road_length = 100 buffer_distance = (var_area/road_length)/2 ...


4

Here's the source for the simplified calculation that we make in OpenLayers. This method comes from "Some Algorithms for Polygons on a Sphere" (Robert. G. Chamberlain and William H. Duquette, NASA JPL Publication 07-03). The code linked to above is for determining the area of a linear ring (with geographic coordinates). Areas for Polygons and ...



Only top voted, non community-wiki answers of a minimum length are eligible