Error occurs under Windows in QGIS 2.8.3 and 2.10.1, answers to similar questions e.g. 57418 have not helped.
The shapefile in question was created as follows:
- Vector/GPS/GPS tools/Load GPX file (Routes)
- Layer / save as ESRI shapefile [….\epsg4326\routes.shp]
The failing sequence is:
- Start a new map/add vector layer [routes.shp]
- Open attribute table
- Add new column AREA [decimal real width=17 precision=8]
- Manually edit both AREA values to verify format.
- Select all entries [2 entries]
- Field calculator / existing /AREA / geometry / $area
Always get NULL
I have tried countless combinations of width and precision for AREA. I have uninstalled/reinstalled/installed different releases. All to no avail.
What's up Doc?
Beginning to smell a rat in the direction of either the GPS tool or the shapefile. Starting with the shapefile, how may I independently verify it?
Best Answer
There are two things you get wrong:
Save As ...
, notSet Layer CRS
for that.A closed way is not automatically a polygon. In QGIS, you can use
Vector -> Geometry Tools -> Lines to Polygons
to create a polygon layer from the data. If you still get no result, tryVector -> Geometry Tools -> Check Geometry Vailidity
.Self-intersection means that the line crosses itself somewhere (not necessarily at the ends). GPS data is prone for that, if you stand still, and the unit is improving its reception quality.