1

In QGIS I want to know how can I find the scale of a map. I have state boundaries with me, and when I calculate the length of the boundary, it comes out to be something like 245.854.

This most definitely cannot be a state perimeter because states have very large boundaries.

How can I know what is the scale to which if I multiply 245.854, I would get the actual geographic value?

This is my line file, I want to know the actual geographical length according to the map, for example, if I am getting my total as 245 units, to what factor should I multiply it to know its actual conversion into the real world?

The data is Located in India, and here is the file: https://drive.google.com/drive/folders/1deA7GxeNK54hXrOGBp910-v7gMYsjEQg?usp=sharing, the data I uploaded was ESPG 4326, but I converted it to ESPG 3857 so that I can make buffers around line and I get meters in the buffer window

enter image description here

7
  • 3
    245.854 sounds like the totally correct geographic value. But since this is degrees, it is a useless value. So, since your data probably is in CRS EPSG 4326, you need to transform/reproject it first, to a CRS using m as unit of measurement.
    – Erik
    Jun 18, 2021 at 4:49
  • No, my data is in CRS EPSG 3857 which uses 'm' as unit of measurement, my shp file is a line file and I am using $length to calculate the length of total lines. Jun 18, 2021 at 4:56
  • 1
    What state is this? Can you include a picture of your map?
    – PolyGeo
    Jun 18, 2021 at 5:17
  • 4
    Perhaps see gis.stackexchange.com/questions/242545/… on the wisdom of using epsg:3857 for distance measurement.
    – nmtoken
    Jun 18, 2021 at 5:28
  • 2
    Whatever factor you use: based on CRS 4326 or 3857, results will be always wrong. Only way to get accurate results is to use a correct CRS. No need of any factor to multiply. QGIS does not consider scale for measurements, this is a visualization thing only that has no connection to how measurements are calculated. As long as you don't tell us more details, it's difficult to give more advice. Can you provide your data for testing? Probably they are in the wrong CRS, that's why you get wrong measurements. To get help, tell us what CRS your data is in and where on Earth they are located.
    – Babel
    Jun 18, 2021 at 8:40

1 Answer 1

6

The solution

You have defined a wrong CRS. To solve the problem: Right-click your layer, set CRS back to EPSG:4326. Now it is in the correct place: Always load a basemap in the background to check if your data is in the right place!

Now re-project your layer to an appropriate CRS (e.g. EPSG:7755, but there might be better ones) with one of these two solutions:

  1. right click on your layer / Export / Safe features as... and select the CRS you want to reproject to
  2. Menu Processing / Toolbox / Reproject layer and select the CRS you want to reproject to

Now you can use $length to get length in meters, $length/1000 to get length in km.

The problem

The data you provided come with a wrong CRS definition: if I load your data and add a basemap, they are in the Atlantic, nearby the intersection of the equator with the prime meridian (0° E/W). The CRS of your data is set to EPSG:3857, but in fact the coordinate values are saved in EPSG:4326 or lat/lon format: this leads to a wrong interpretation and localization.

You probably changed the layer CRS: never do that, see here (you probably did what is described in point 2): https://gis.stackexchange.com/a/383437/88814

Screenshot: drag-and-drop a XYZ-Tile like OpenStreetMap from the Browser-Panel to the layer panel. Make sure your lines are correctly located. Otherwise, follow the steps above: set CRS back to EPSG:4326 enter image description here

10
  • If i am using a plugin how can I know which CRS to choose to get the correct values? Jun 18, 2021 at 15:42
  • What plugin do you want to use? It does not depend on plugin or not. You should select an appropriate CRS for the area of your interest. See more docs.qgis.org/3.16/en/docs/gentle_gis_introduction/… and here docs.qgis.org/3.16/en/docs/user_manual/introduction/…
    – Babel
    Jun 18, 2021 at 15:54
  • Local UTM zone could be a good choice in your case - look for the one where your area fits in. See also here, section "which coordinate system should you use for the measurement?": esri.com/arcgis-blog/products/js-api-arcgis/mapping/…
    – Babel
    Jun 18, 2021 at 15:55
  • 3
    If you get a length of 282.23, it means you did not follow the steps from my answer: 1.) set CRS back to EPSG:4326 2.) re-project, 3) add a basemap for control. If you don't follow this procedure, you will never get any meaningful values. I repeat for the 3rd time: YOU DON'T NEED A FACTOR TO MULTIPLY! Before starting to program a plugin, I would advice to make yourself comfortable with the basic concepts of GIS/QGIS. To add a basemap, see: gis.stackexchange.com/a/217670/88814 - If your line-layer does not fall in the right place (India), you know something is wrong.
    – Babel
    Jun 18, 2021 at 20:49
  • 2
    You're welcome, you already awarded my effort by accepting the answer: thats how this site works. You reward answers by accepting and/or upvoting. You always should select the CRS manually, so the plugin should have an option to select the CRS. For details, post a new question here as comments are not for extended discussions.
    – Babel
    Jun 19, 2021 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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