2

So what I have is a dataset of mines (coal, bauxite, iron ore etc) in Central India and their lat, long. I also have the values for actual area of each of these mines, as per Environmental clearance documents.

I initially tried looking at Google earth satellite imagery to digitize polygons showing the actual extent of each of these mines. However not all of these mines have begun operations. So satellite imagery does not tell me how big these mines will eventually be and I ended up just making a point layer for the mines

I was hoping to prepare a web map (in cartodb) and one in qgis that allows me to style the point layer according to real area of the mine. Hence if the area of the mine is 100 hectares the point should show as a circle of area 100 hectares and accordingly adjust at different zoom levels. Is there an easy way to do this? one which doesn't involve a lot of code.

2
  • What do you mean by "adjust accordingly at different zoom levels"? You want the circles to get smaller so they are always the representative area? – Spacedman Oct 12 '15 at 7:39
  • Yes, you got that right! – Craig Dsouza Oct 16 '15 at 7:43
1

The key to doing this in QGIS is to use a "single symbol" style, a single marker within that, and set the size via the expression editor. In this case, you want the area to be equal to the area field in your data, so your expression is sqrt("areafield") - the square root is necessary because otherwise you scale the radius of the circle.

You also need to do two other things: first make sure the size is set to use "Map Units" and not "millimeters" or other paper units - without that the points will scale nicely with the zoom. Secondly, you might have to scale your expression by a factor depending on your coordinate system. Oh, you'll have to be using a projected coordinate system too - lat-long (epsg 4326 and similar wont work). Get the units of your projected coordinate system and figure out how to scale the square of those to your field units. So if your CRS is in metres, how many square metres in a hectare? Is it 10000? If so, then change the expression to sqrt("fieldname")/10000 - which gives you a size (radius) in metres for your circle.

This might be getting a bit fragile, and will be tricky if you are working in lat-long coordinates, so the other way would be to create small circular polygons of the correct area centred on your points rather than coax the symbology system to do something its not really designed for. You can do this using a buffer of the correct radius. The buffer tool has a box for specifying a field for the buffer radius, you need to compute this field as the square root of your area (again with a scale factor). There's no expression editor in the buffer radius field, so you'll have to create this as a new attribute in the attribute table.

I'd give you a worked example if you want to paste a few lines of x,y,area data into your question for a couple of example points.

1
  • I got it figured out, thanks for your help. Using 'map units' rather than millimeters was the key element I hadn't figured out and also the expression field editor bit. I tried your first solution rather than the second, since I wanted to get the effect with styling and avoid creating a separate shapefile. Left a detailed response below – Craig Dsouza Oct 16 '15 at 7:41
0

Including a couple of snapshots below to explain what I figured out. I chose Single symbol, simple marker, changed units from millimeters to map units (my CRS was UTM 44 for Central India). Next went to the 'Advanced' button on the right of the menu and selected 'Scale diameter' and also 'Size Scale field'> Expression, then entered the following expression

2*sqrt(("Land_area_in_Hectares"*10000)/3.14)

Picture of styling menu

The expression multiplies the land area in hectares that is already known within my data, converts it to area in metres^2 by multiplying by 10,000. This is then divided by Pi (3.14) since I want the symbol area to be a circle of the given area and the area of a circle is Pi * r^2. The sqrt then gives the radius and multiplying that by 2 gives the diameter. The Advanced menu option I had chosen was 'Scale diameter' hence the formula for diameter.

One thing to remember is keep the 'Size' field set to 1, since that represents a scale of 1:1. If you select 2 the area of the marker is shown as twice the actual area of the plot of land.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.