2

I have 2 polygons I downloaded from public databases and I used the Bing aerial map with the OpenLayers plugin. They are aligned PERFECTLY, they are in the area they are supposed to and everything was great. Everything is in EPSG:4326 - WGS 84. The problem is when I did the composition I needed the coordinates to show up and... they are wrong, they simply do not reflect the real coordinates.

For reference, I took from literature the coordinates of the centroid of my principal polygon: 25°29'28.4350", -100°31'38.9740", also I put this coordinates on Google Maps and they are correct. But my map (composition) show completely different coordinates 6°51'0.000" 11°0'0.00" (no exactly in the centroid, but they still very different from each other)...

I think I'm using the same format of coordinates (WGS 84) but I am very confused, I don't know how to change the coordinate in order for they to match.

Also, I obtained the coordinates from the centroid of my polygon (to see what is the problem) in the properties table and obtained coordinates that are way closer but still off: y=25 x=-101.

I just have no clue to what to do.

4
  • Welcome to Geographic Information Systems! Welcome to GIS SE! We're a little different from other sites; this isn't a discussion forum but a Q&A site. Your questions should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that. Please check out our short tour for more about how the site works
    – Ian Turton
    May 13 at 16:20
  • Bing maps are likely in Web Mercator, not geographic WGS84.
    – Vince
    May 13 at 16:24
  • Thanks! just to clarify, my polygons are aligned as they should to the bing map. So if this might be the source tof the ploblem, is might be the source of the problem. How can I change it to wgs84 or otherwise fix the problem? May 13 at 16:28
  • 1
    Nearly every modern mapping application supports "on-the-fly reprojection", so you won't see that the projections don't match (the viewport defines the target coordinate reference, which is likely to be the same as the basemap). The biggest mistake you can make is to change the defined projection of a data layer when what you really want to do is reproject the data -- this is the most frequent question in GIS SE.
    – Vince
    May 13 at 18:02
1

As mentioned by @Vince, probably not all your layers are in EPSG:4326. To get coordinate values in EPSG:4326 of any layer, regardless of the CRS it is saved in, apply this expression to get the x-coordinate value (replace x by y for y value). You don't even have to know the CRS of the layer: the variable @layer_crs retrieves it automatically, so this expression works whatever CRS the layer is in:

x (transform(centroid($geometry), @layer_crs ,'EPSG:4326'))

This returns decimal degrees. To have the values in degrees, minuts and second, enclose the expression as argument to the function to_dms( )

Screenshot: a simplified polygon of France in EPSG:3857. The field calculator calculates the x-coordinate in EPSG:3857 in d:m:s format - the preview at the bottom says: 2°31′29.6075″

enter image description here

2
  • Thank u. Do you know if it is possible to do this with the bing aerial map? I can´t access its properties or attribute table. May 14 at 3:58
  • Bing aerial map is loaded as XYZ tiles? Than it's not possible: basically you load a raster image. This has no attributes or (geometric) properties you could use. It's not more than a background image.
    – Babel
    May 14 at 6:45

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.