In QGIS the location of the marker can be changed, without changing the coordinates in the Attribute Table. This is done by changing the X or Y values in the Offset function, located in the Layer Styling panel.
When a positive value is adding to the X bar the Marker moves to the left, and vice versa. Just like a X-axis standard system.
However, adding a negative value to the Y bar will move the Marker up. Which is opposite to the a Y-axis.
What is the logic that the offset function is working by?
Answer
In graphic design and computer programming, the origin is at the top/left corner of the screen or page, and the y-axis increases as you go down the page.
According to this question on Game Development SE, the reason for this is historical, going back to the way TVs with cathode ray tubes worked. Even though we don't use CRTs anymore, this plotting method is now common practice. This system is particularly confusing when you're working with a GIS, where map features have geospatial positions defined in a projected coordinate system where Y-coordinates increase as you go up/north.
In QGIS, this coordinate system is used for the symbol "offset" settings, as well as for positioning items in the print composer.
Try this alternate method to offset your points. This method only uses geospatial coordinates.
Use a Geometry Generator style. Choose "point" for the geometry type. Define the geometry with this expression:
make_point( $x + Xoffset, $y + Yoffset)
Substitute your own offset values for the terms Xoffset
and Yoffset
. Offset amounts should be in the same units as those used by the point layer's coordinate reference system. In my example below, my points are in a CRS that uses feet. I added a "simple marker" at the feature's actual geographic location so you can see the offset of the "geometry generator" marker.
No comments:
Post a Comment