0

I use a shapefile of the US counties and I want to create buffer zones around the centroid of each county. However, the distance is measured in decimal degrees. As far as I understood, I have to change the Layer CRS. My problem is that I don't find a matching layer. Is there a layer that I can use for the whole USA? I tried it with WGS84 Pseudo-Mercator (EPSG: 6871) but if I apply this layer, I cannot find my map of the counties anymore.


Has anybody already created such buffer zones? It should not be that complicated but it doesn't work

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
Julian H.
  • 19
  • 3
  • 4
    Actually, you never want distance as measured by Web Mercator (which cannot produce accurate distances), and you don't want to change the source CRS (which corrupts the source file). Instead you want to change the map canvas CRS, probably to USGS CONUS Alber's equal area. – Vince Aug 31 '22 at 11:38
  • I understand that it is better to not change the source CRS. I just checked the CRS of the layer (under "properties" of the layer) and it is written that the assigned CRS is an invalid projection. What does this mean? – Julian H. Aug 31 '22 at 12:14
  • See https://gis.stackexchange.com/a/438809/88814 – Babel Aug 31 '22 at 14:38
  • Reproject your data (don't set the projection) to US National Atlas, a search will find the code. – Ian Turton Aug 31 '22 at 16:28

2 Answers2

1

Create a Virtual Field in your table: (1) create a line, (2) transform it to UTM zone and (3) take the line's length

Create a virtual field for the table

Throw in the formula

Enter distance formula

Take this for copy pasta:

length(
    transform(
        make_line($geometry, make_point(13.26816, 52.31255)),
    'EPSG:4326',
    'EPSG:32632')
)
n1nj4
  • 144
  • 6
-1

Thank you all for your advice! While searching for the code, I found this website and it really helped:

http://www.qgistutorials.com/de/docs/3/working_with_projections.html

(1. project -> properties -> CRS -> select initial CRS) 2. select features -> select all counties (I used freehand and draw a rectangle including all counties) 3. processing -> toolbox -> vector general -> reproject layer -> choose desired CRS 4. only select new reprojected layer on the right side 5. project -> properties -> CRS -> select new/desired CRS

Julian H.
  • 19
  • 3